Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > HDTV / DVB / TiVo
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st November 2006, 05:12   #1  |  Link
mitsubishi
Registered User
 
Join Date: Sep 2006
Location: UK
Posts: 416
Removing BBC HD logo

Hi, if you've read any of my previous posts, you'll know I am still not knowing what I doing yet..

But what I am currently trying is removing logo from BBC HD. I am using delogo. I tried this before with a five US broadcast of Nightmares and Dreamscapes, which almost worked, there was tiny bit of noise (if that's what you'd call it) but nothing much. Unfortunaly on one scene where it was in front of sky it failed miserably. That time I ran the analyse functions, then tweaked up the masks in paint until it worked.

OK so I thought being a HD source it may work better and you know what I think it has. Bearing in mind I don't know the first thing about image editting, so am using paint.net. What I did this time was :

Find a frame with logo on black background. Select everything but a box around logo and fill blue. Using mid Tolerance, fill logo red. This is analysis and deblend mask. Fill in logo white, this is colour mask. Then for the alpha mask I inversed colours and gradually filled the whole thing with black using a very low transparency until I got it right.

So far it looks great, can only just make out the logo on some backgrounds, but not in the annoying way like with the Five US one.

Well I'm asking if there is another way a better filter or something before I try to tweak up the masks a bit more, it was only a random thought and five minutes work. I'll upload my masks and a sample if I can find or someone can recomend a site.

BTW this is the AVS I used.
Code:
DirectShowSource("D:\test\test.ts", audio=false, pixel_type="RGB")
FlipVertical()
LoadVirtualDubPlugin("C:\Documents and Settings\Administrator\Desktop\StaxRip_0.9.9.2\Applications\VirtualDubMod\plugins\delogo.vdf", "DeLogo", 2)
DeLogo(1, "", "D:/test/ana.bmp", "D:/test/a.bmp", "D:/test/c.bmp", "", 15, 40, 0, 0)
LanczosResize(944,528)

ConvertToYV12()
EDIT: Here's a sample, section chose at random: http://www.mytempdir.com/1073664 (12mb)
And here are my masks: http://www.mytempdir.com/1073666 (9kb)

Last edited by mitsubishi; 21st November 2006 at 05:35.
mitsubishi is offline   Reply With Quote
Old 21st November 2006, 07:03   #2  |  Link
mitsubishi
Registered User
 
Join Date: Sep 2006
Location: UK
Posts: 416
Actually it's better than even thought at first, I may reformat my first post to be more of a guide. The questions I'm really asking are 1) Is there is a better filter, a native avisynth one perhaps?
2) Do you think my masks are as good as they'll get?

I've looked for the worst possible section of video and created another sample. You can make out the logo most just when it cuts to the chick. Maybe someone with better eyesight can determine whether my mask is a fraction too dark or thats the limit of the technique.

Sample 2:
High Quality - http://www.mytempdir.com/1073726 (14MB)
Mid Quality - http://www.mytempdir.com/1073719 (7MB)
mitsubishi is offline   Reply With Quote
Old 21st November 2006, 22:44   #3  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
There's many filters, xlogo, logoaway, msu delogo, and logotools, DeKafka.

Logotools works great.
NoLogoAuto(clip,clip,10000)
where 10000 is a frame with black+logo. It can use a formula to compute the exact logo. I derived this formula myself recently. I think this approach should obsolete all others.
The statistical process of delogo is always going to cause errors and noise.

http://forum.doom9.org/archive/index.php/t-64031.html
jmac698 is offline   Reply With Quote
Old 21st November 2006, 23:56   #4  |  Link
mitsubishi
Registered User
 
Join Date: Sep 2006
Location: UK
Posts: 416
Quote:
Originally Posted by jmac698 View Post
The statistical process of delogo is always going to cause errors and noise.
Statistical process? I'm creating the masks manually and only using the alpha deblend function, where does statistics come into it? I'm not getting any noise, it's nearly perfect, just a touch of the old logo on some bluey backgrounds, maybe my mask needs the blue channel tweaking. Did you check my samples?

Thanks, I'm trying to get logotools to work, but can't convince it to load the filter.
Code:
main=DirectShowSource("D:\test\test.ts", audio=false)
logoclip=ImageSource("D:\test\clip.bmp")
LoadPlugin("C:\Documents and 

Settings\Administrator\Desktop\StaxRip_0.9.9.2\Applications\old_plugins\LoadPluginEx2.dll")
LoadPlugin("C:\Documents and 

Settings\Administrator\Desktop\StaxRip_0.9.9.2\Applications\old_plugins\LogoTools.dll")
NoLogoAuto(main,logoclip, 0)
crop(4,4,-4,-4)
LanczosResize(1024,576)
Trim(2515,46319)
ConvertToYV12()
Quote:
LoadPlugin: unable to load "C:\Documents and Settings\Administrator\Desktop\StaxRip_0.9.9.2\Applications\old_plugins\LogoTools.dll"
(D:\test\LBr.avs, line 3)
mitsubishi is offline   Reply With Quote
Old 22nd November 2006, 01:16   #5  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
In the delogo guide, I used virtualdub, add delogo filter, load in the manually created analysis mask, then click show preview, and click sample video, in order to create the other masks (alpha, color). I believe, these masks are created by interpolating the video around the edges of the mask, and using that to estimate the logo.
Notice the button which says reset statistics.
The only way to not use statistics is to supply the alpha mask and color mask yourself, though I don't know how you could create these.

I had to use LoadPluginEx.dll, then LogoTools.dll in that order.

http://forum.doom9.org/showthread.php?s=&threadid=57875

I just put loadpluginex.dll and logotools.dll in old/ folder, then those are the last two that I loadplugin(). It works for me.
Ok, that's what you did too. I took this loadpluginex from elsewhere however... don't know where... yes, do a search with windows, it will search inside zips of other filters packages you have, that's how I found a few copies... ok, it's in warpsharppackage 25

http://niiyan.net/?WarpSharpPackage

Last edited by jmac698; 22nd November 2006 at 01:23.
jmac698 is offline   Reply With Quote
Old 22nd November 2006, 01:58   #6  |  Link
mitsubishi
Registered User
 
Join Date: Sep 2006
Location: UK
Posts: 416
Thanks, yeah, thats the link I found, I copied the error wrong, its the loadpluginex.dll that it couldn't load I checked and the reason it wasn't working is the dll contains the text of a 404 error! Was just about to hunt down another when I saw you'd updated your post to give me a link, cheers. So now it is loading. It doesn't appear to be doing anything right now though, will have to play around to see if I can get it working.

Yeah DeLogo uses some sort of analysis if you want it to create the masks, but I've not had great results that way. I gave a brief explaination of how I created my masks in the first post.

1) Take snapshot of logo on black background
2) Fill in all logo with pure red, use this as deblend mask.
3) Fill all logo in pure white, use this as colour mask.
4) Take original snapshot, inverse the colour, then gradually darken until correct to get alpha mask. You have to darken as the alpha is offset to 200.

OK, off to try and get this logotools working now.

BTW yeah while I was walking home today I thought it would be quite simple to make an app to automatically create the masks using this method. Then I thought it would be even better to write a filter to do the whole thing, might have a crack one day.

EDIT: Figured it out, as I'm using an image for my logoclip, I had to convert to yuy2. Lets itself down in places, doesn't seem quite as good as my Delogo method.

Last edited by mitsubishi; 22nd November 2006 at 02:25.
mitsubishi is offline   Reply With Quote
Old 22nd November 2006, 16:57   #7  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I understand your method now, I've done the same thing to even out some noisy masks by hand, but I found it very hard to adjust the brightness with a paint program precisely.
There is a problem with that method, the edges of logos are antialiased.
Anyhow, what you are doing can be done with the virtualdub version of the same filter, by moving the alpha slider. (I think).
As for logoaway, I got it to work perfectly with white transparent logos (except for some noise). There is a formula to calculatee the exact alpha if you know the original pixels, on a black screen you assume those pixels = 16.
jmac698 is offline   Reply With Quote
Old 22nd November 2006, 17:22   #8  |  Link
mitsubishi
Registered User
 
Join Date: Sep 2006
Location: UK
Posts: 416
Yeah I started tidying up the auto masks with some SD, but this is completely manual. I think the sliders are just to help it out with the auto masks. You have to darken in this method as the alpha is offset so it can represent a negative alpha.

Surely the aliasing is being taken care of by using the inverse of the black backed image?
Quote:
There is a formula to calculatee the exact alpha if you know the original pixels, on a black screen you assume those pixels = 16.
Not entirely sure what this means, will mull it over

I found a frame where I could see the logo with logotools to compare. (I changed to using the video rather than the YUY2 converted image to make it fair, although results seem identical)

Logotools


DeLogo


It may be tweakable with the 'NoLogoM' function to get a better result, I will play this evening.
mitsubishi is offline   Reply With Quote
Old 22nd November 2006, 22:55   #9  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
It took a minute to see the logo, but it's slightly dark with logotools. NoLogoM can fudge this to be a bit brighter.
jmac698 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.