Quantcast Avisynth: New Logo Removal Filter - Page 2 - digitalFAQ.com Forums [Archives]
  #21  
10-31-2003, 05:00 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
I re-created you script using a Mpeg2 source and confirmed the issue. (funny that it didn't come up with an Mjpeg source?) It was a problem with a error message that wan't comming up.

I have "fixed" the dll and re-posted it on to my site. Please download the new version and try again.


Sorry about that.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
10-31-2003, 07:28 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
Originally Posted by MrTibs
Sorry about that.
Take it easy!
Thats why we are here, ... to figure out and optimize.
Anyhow GREAT work MrTips!
Reply With Quote
  #23  
11-01-2003, 11:40 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Mr Tibs, hi Nicksteel, hi incredible:
I'm jumping here from VideoCapture forum. As I explained there I've been making use of Xlogo. But I'm now giving a try NoLogo filter.

I work also with mpeg2 captures, so my case is similar to Nicksteel'.
I managed to make the filter work. NoLogoAuto detected the logo, but it just "painted" it in black, and now I've got the same logo but in black (I really don't know if this is the way the filter is supposed to work. Please Mr Tibs, make me know).

So I tried NoLogoM,... but I just don´t know what the parameters are supposed to do, and how to adjust them. These are my last adjustments:
Quote:
NoLogoM(clip,logoclip,6,10,578,42,80,26,1,255,30)
But with these ones, all I get is a black logo (smaller than that with NoLogoAuto, but still visible in black) .

Can you help me with these parameters?. Because I still haven't compared it with Xlogo, but I believe it works faster, and maybe as the conversion is to YUY2 and back to YV12, we won´t lose much quality.
Thanx for your filter, and for your help. As you see, several of us are interested in your work, Mr Tibs.
Reply With Quote
  #24  
11-01-2003, 03:02 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
I'm getting same results.
Reply With Quote
  #25  
11-01-2003, 03:10 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
@digitall.doc

To answer your question, no NoLogo is not supposed to turn the logo black. Infact, you should get very simular results from NoLogo and Xlogo even though they are not based on the same source code.

I suspect that when you get a black logo result, you are applying the filter to a frame where the logo wasn't present. This is what I created the IfLogo and IfNoLogo filters for.

The first thing I would try is put NoLogoAuto into debug mode (see higher in this thread). Next I would make a note of the frame number with a black logo and then comment out NoLogo and re-check the source frame to see if it is there. Finally, I would double check the frame I was using as my logo source frame to be sure the logo is there also.

Judging from your NoLogoM settings, the logo you are trying to remove is in the top right of the frame. The settings you choose are:

1=Use the full opacity of the logo. (If you find the logo is removed well in darker areas but too much in lighter areas, reduce this number to fractions of one.)
255=Change the scale for the removal from 222 to 255. You modify this if you find the the logo is under or over corrected in the darker or lighter ares but pretty good in the centre.
30=lighten the area under the logo by 30. If the logo is removed correctly but is leaving a dark "shadow" behind. (Use negative numbers to darken the area under the logo.)

If all that fails, send me a couple of screen shots of the problem frame before removal (and the logo on a black background). (mrtibsvideo@yahoo.com)
Reply With Quote
  #26  
11-03-2003, 08:00 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Hi MrTibs:
sorry I didn't answer earlier: job. I tried putting NoLogoAuto in debug mode... what's supposed to have happend?. All I can see is the image with irregular white lines across the image, and the logo surrounded in white, and the logo white parts in black. When comment out NoLogoAuto, the logo is there, as you said. And my logoclip has the logo indeed.
So, I guess I'll try to make a couple of screenshots, and send then to you, to see what I'm doing wrong.
Reply With Quote
  #27  
11-03-2003, 02:11 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
I suspect that the logo you are trying to remove is not transparent but opaque. Does the logo seem transparent when it is over lighter (not white) areas?

It is pretty easy to test this using LumaGraph. Download lumagraph from my site and set it so the the revesed line goes through the middle of the logo. Load the script into Vdub and watch the graph where the logo is. If the values of the logo area don't fluctuate, then you have a opaque logo. If they move up and down with the area around them, the his is probably a semi-transparent logo.

To explain what "may" be happening... If the brightness of the logo is always 238 or higher, then NoLogo is always going to remove at least 238 from the frame thus producing a black logo. With transparent logos, the difference between the area behind the logo and the logo is proportional to the value above the logo in LumaGraph. I know that sounds confusing but if you watch the video with LumaGraph running, you'll see what I mean.

Edit: is the logo you are trying to remove the space channel logo? Perhaps I can try capturing from a friend's house so that I can work on an actual sample.
Reply With Quote
  #28  
11-03-2003, 05:18 PM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Mr Tibs:
Oh, you're right, my friend. I'm afraid it's an opaque one (you can see it in the screenshots I sent you). And now I can remember than your previous filter LogoBlend was intended to remove transparent logos, and I guess that is the same for NoLogo.
I'm sorry if this is the case, I made you lose your time. If not, and I can still remove my logo with your filter, make me know.
I'll wait for your news
Reply With Quote
  #29  
11-04-2003, 12:22 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Your best bet is XLogo or DeKafka. Here is my version of DeKafka

Quote:
################################
logoframe=4
brightnesschange=20
xpos=273
ypos=374
width=34
height=65
xborder=352-xpos-width
yborder=480-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)
This would work just like NoLogo. You could use Xlogo to get the dimensions. The advantage of using this DeKafka is you don't need to create a template.
Reply With Quote
  #30  
11-04-2003, 03:09 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Mr Tibs:
Hmmm... sorry... thank you... errr
Well, I will try Dekafka. But as I'm so lazy after so much testing , can you help me with a couple of things... else:
- In what colorspace does Dekafka work (I work in YV12)?
- Does it work with Avisynth 2.5.2?
- Do you know if it converts internally to another colorspace (slower,...)?
- And... where can I download it from?

Buf, thank you friend.
Reply With Quote
  #31  
11-04-2003, 08:32 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, Ok, I guess you think I shouldn't be so lazy so I looked for some information on Dekafka (Doom9 forum, avisynth,..) but not much.
In avisynth page I found a function, similar to your Dekafka version, but not the same. So, is your Dekafka version to be included directly in the script, or to be saved as a function (*.avsi)?. Is it supposed to substitute the Dekafka function?. And, last (by now), what function is LogoMask, do I have to load a .dll, or is included in avisynth?.
Sorry me for making so many questions, but you're very helpful and I'm learning a lot .
Reply With Quote
  #32  
11-04-2003, 09:35 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
DeKafka is not realy a filter but rather a script function. It uses standard filters to do the job. The Dekafka script function and be downloaded from the avisynth site. It is designed for 2.5 and YV12. It doesn't do internal colour conversion.

My Dekafka will work for either 2.x or 2.5 and is designed for YUY2. You can use my DeKafka simply by pasting it into you script after de-interlacing. Then adjust the variables until it does the job.
Reply With Quote
  #33  
11-04-2003, 10:55 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Can you change setting in your "DeKafka" that will highlight logo area, like 0 in NoLogo?
Reply With Quote
  #34  
11-04-2003, 11:14 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, set brigthness change to 0 and it will show you the logo area:

Quote:
################################
logoframe=4
brightnesschange=0
xpos=273
Reply With Quote
  #35  
11-04-2003, 11:24 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
Yes, set brigthness change to 0 and it will show you the logo area:

Quote:
################################
logoframe=4
brightnesschange=0
xpos=273
Actually, 0 removes the logo.

LoadPlugin("C:\aa\MPEG2Dec3.dll")
LoadPlugin("C:\aa\old\loadpluginex2.dll")
LoadPlugin("C:\aa\old\LogoTools.dll")
LoadPlugin("C:\aa\undot.dll")

logoclip=avisource("c:\aa\testsource.avi").convert toYUY2(interlaced=true)

clip0=avisource("c:\aa\testsource.avi").converttoY UY2(interlaced=true)

clip1=avisource("c:\aa\testsource.avi").converttoy uy2()
clip2=avisource("c:\aa\testsource.avi").converttoy uy2()
clip3=avisource("c:\aa\testsource.avi").converttoy uy2()
clip4=avisource("c:\aa\testsource.avi").converttoy uy2()
clip5=avisource("c:\aa\testsource.avi").converttoy uy2()
clip6=avisource("c:\aa\testsource.avi").converttoy uy2()
clip7=avisource("c:\aa\testsource.avi").converttoy uy2()
clip8=avisource("c:\aa\testsource.avi").converttoy uy2()
clip9=avisource("c:\aa\testsource.avi").converttoy uy2()
clip=clip0+clip1+clip2+clip3+clip4+clip5+clip6+cli p7+clip8+clip9

undot(clip)

################################
logoframe=4
brightnesschange=0
xpos=540
ypos=410
width=110
height=28
xborder=352-xpos-width
yborder=480-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)
Reply With Quote
  #36  
11-04-2003, 02:15 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
First, you are right, I had removed the debug mode from LogoMask and hadn't changed the documenatation.

Second, I went back to check DeKafka and it does convert to RGB so it may not work some some others.

Third, presently LogoMask only operates on the Luma so you may not get the results you desire. I did a quick hack to make it work in colour as well, but I can't post it until later today.


For now, here are the changes that should work for you. I tested it on my sample video so it should work for you.

Quote:
################################
logoframe=4
brightnesschange=5
xpos=540
ypos=410
width=110
height=28
xborder=Width(clip)-xpos-width
yborder=Height(clip)-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
# uncomment following line for debug mode
logosrc=logosrc.Levels(0,1,255,255,0)

LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)
On the otherhand, you could use the existing DeKafka before you do any colour conversion. I would suggest you either use the exising DeKafka or wait a day so that I can work on my DeKafka script a little bit. (I wrote it as an example rather than a ready-to-use function.)
Reply With Quote
  #37  
11-04-2003, 02:48 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
I'll wait, as your functions are much easier to use. I tried xlogo until I gave up in frustration.
Reply With Quote
  #38  
11-04-2003, 03:15 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
My captures are YV12, so I only do conversion if filters require it. How should I use "brightnesschange"? For instance, should I start at some value and increase/decrease until the logo disappears?

I like this version of DeKafka.
Reply With Quote
  #39  
11-05-2003, 09:29 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
@nicksteel

I would start out at say 20 and increase as us suggest. The debug line I added in the last post should show you the logo area. I would uncomment the debug line and play with the brightness change until the logo is clearly outlined. I don't know how much noise there is in your source but I don't realy undersand why it wouldn't work with a brightnesschange of 5. (Perhaps I am still missing something.)
Reply With Quote
  #40  
11-05-2003, 10:42 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
@nicksteel

I would start out at say 20 and increase as us suggest. The debug line I added in the last post should show you the logo area. I would uncomment the debug line and play with the brightness change until the logo is clearly outlined. I don't know how much noise there is in your source but I don't realy undersand why it wouldn't work with a brightnesschange of 5. (Perhaps I am still missing something.)
See what you mean. I would find it nice if a debug line could outline the xy borders around the logo so the mask area would be very obvious.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Light Noise removal filter supermule Avisynth Scripting 15 05-18-2006 09:03 AM
Recording Video: Logo Removal nicksteel Video Encoding and Conversion 3 11-24-2003 08:21 AM
KVCD: logo removal on previously encoded captures? nicksteel Video Encoding and Conversion 2 11-02-2003 05:22 AM
Avisynth: Dekafka Logo Removal (like on the SciFI channel) nicksteel Avisynth Scripting 17 10-29-2003 09:56 PM
Avisynth: New Logo removal filter (alpha) - comments welcome MrTibs Avisynth Scripting 1 08-08-2003 05:44 PM

Thread Tools



 
All times are GMT -5. The time now is 01:09 PM  —  vBulletin © Jelsoft Enterprises Ltd