PDA

View Full Version : Bypass processing on a logo


Si
9th August 2003, 19:59
I just know someone has already done this :o

I'm trying to use KernelDeInt as a postprocessor for my PFR filter but I'd like not have KernelDeInt process the pixels near the station id logo on my captures.

Has anyone a script/filter that can take the region around a logo, save it and then put the region back again - something like

AviSource("Test.avi")
...
SaveLogo(20,30,50,62)
KernelDeint()
RestoreLogo(20,30,50,62)
return last

I don't want to try to persuade neuron2 with building it into KernelDeInt itself until I proved its worth doing

All suggestions welcome.

regards

Simon

Si
10th August 2003, 02:00
Managed it myself :)

...
mainclip=PFR(EnablePP=true) # Parameter only available in my debug version at the moment - I'm experimenting
savedlogo=Crop(mainclip,22,42,52,20)
KernelDeInt(mainclip,order=1,map=true)
Layer(savedlogo, op="add", level=255, x=22, y=42, use_chroma=true)


Seems to do the job (in YUY2 colourspace anyway)

I think the technique could be used to avoid any artifacts around logos with any deinterlacer.

Anyone got a better way that maybe works in YV12 as well?

regards
Simon

cheap-red-wine
10th August 2003, 07:38
Why don't you just make a quick hack to the KernelDeint() source? It appears to be a simple matter.

Si
10th August 2003, 10:18
KernelDeInt is in active development - so I'd end up spending more time modifying each release than modifying my own filter :)

regards
Simon

cheap-red-wine
10th August 2003, 17:45
Originally posted by siwalters
KernelDeInt is in active development - so I'd end up spending more time modifying each release than modifying my own filterYou're too modest, Simon. Just put this line:

if (y > 10 && y < 100 && x > 50 && x < 200) continue;

after these existing lines:

for (x = 0; x < w; x++)
{

You can visualize the excluded area this way:

KernelDeint(order=1,threshold=0,map=true)

If this took more than a few minutes, I'd be really surprised!

Si
11th August 2003, 01:10
Well, it would certainly take me more than a few minutes to check whether missing all that code out would let the filter pass through the original source pixels :)

My 1st guess it that the output pixels would be undefined.

My 2nd guess is that the method wouldn't work properly in YV12 - so no gain over my script method.

(But what would I know - I'm a BBC Basic expert ;) )

But my point is that Donald's still actively modifying it - hopefully working on my last request which was to "fatten" the motion map :)

regards
Simon

cheap-red-wine
11th August 2003, 03:00
Well, yes, your points are correct, but the changes would be minor to allow for them. I was just giving the gist of an approach.

I suppose it would be better to wait for the code base to stabilise.

siwalters: 1
cheap-red-wine: 0

:D

FredThompson
12th August 2003, 08:40
Static logo or dynamic?

If static, set an insanely deep temporal smoother in VirtualDub. This will help to clean up the logo. Then do a screen grab, manually clean up the logo and use Donald Graft's logo filter to drop it in. I don't personally mess with transparency but you could do that as well.

If dynamic...yuck.