Log in

View Full Version : exclude filters an area of video


byme
24th June 2010, 13:41
Is possible have a script when a video area remains excluded?

for example

http://file2.net/thb/100624/3858yh.png (http://file2.net/100624img3858yh.png.html)

Didée
24th June 2010, 13:43
I would be more concerned about the colors. Why the woman has green hair, and why the shadows of skin are green and purple.

Guest
24th June 2010, 13:44
Yes. You can do it with creative use of multiple processing of the same clip combined with masked Overlay(). There may be a simpler way but I am not aware of it.

byme
24th June 2010, 13:53
I would be more concerned about the colors. Why the woman has green hair, and why the shadows of skin are green and purple.

I not noticed this thing

depend probably of the capture card... :confused:

say that I should adjust colors?

byme
24th June 2010, 13:55
Yes. You can do it with creative use of multiple processing of the same clip combined with masked Overlay(). There may be a simpler way but I am not aware of it.

you explain me, or make me a sample script for how to?

:thanks:

Gavino
24th June 2010, 14:11
Yes. You can do it with creative use of multiple processing of the same clip combined with masked Overlay(). There may be a simpler way but I am not aware of it.
Slightly simpler is to Crop out the area not to be processed and Overlay the result back onto the filtered original.

c = Crop(x,y,w,h)
Filter(...).Overlay(c, x=x, y=y)

This avoids the need for a mask, but can only be used if the cropped area respects possible mod2 restrictions.

byme
24th June 2010, 14:45
great Gavino, it worked!

thanks also to Didée and neuron2


can put the crop first of BlindDeHalo in this script created by Didée

src = AviSource("C:\Users\Propietario\Documents\Edit Video\Untitled 1.avi").ConvertToYV12()
c = Crop(942, 572, 80, 80)
BDH3 = src.BlindDeHalo3(strength=80, sharpness=0.0, interlaced=false)
#BDH3_med = BDH3.repair(BDH3.MedianBlur(2,-333,-333),1) # using radius 2
BDH3_med = BDH3.repair(BDH3.repair(BDH3.MedianBlur(3,-333,-333),1),1) # using radius 3
BDH3_diff = mt_makediff(src,BDH3)
BDH3_med_diff = mt_makediff(BDH3,BDH3_med)
DD = mt_lutxy(BDH3_diff,BDH3_med_diff,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?")

BDH3.mt_adddiff(DD,U=2,V=2) # the result

FastLineDarkenMOD2(strength=48, luma_cap=255, threshold=0, thinning=96)
Overlay(c, x=942, y=572)
GradFunkMirror()
ConvertToRGB()

in this way gives me error

Didée
24th June 2010, 15:23
I would be more concerned about the colors. Why the woman has green hair, and why the shadows of skin are green and purple.

I not noticed this thing
[...]
say that I should adjust colors?Well, sorry. Seems that my browser is to blame!

FireFox is showing me bad colors on this picture. Internet Explorer 8 is showing it as intended. This is what I've seen:

FireFox 3.6.4:
http://img706.imageshack.us/img706/9994/ff364.th.png (http://img706.imageshack.us/i/ff364.png/)

Internet Explorer 8:
http://img404.imageshack.us/img404/189/ie8.th.png (http://img404.imageshack.us/i/ie8.png/)

Did you use Software with Color Managment to create this screenshot?


OT: By accident, someone knows if it's a setting in FireFox that needs to be adjusted?

(For years I've been using the dont-you-ever-useit IE. Now I've switched to the behailed FireFox. And now this. Hehe.)

Edit: Nope. gfx.color_managment.XXX in FF is already set. Playing with the settings eventually makes all other content rendered falsely. But it never cuts into that PNG graphic, which always looks green & purple.

Midzuki
24th June 2010, 15:25
Another possibility: selective cropping && filtering,
++ the required combination of Stacks().

Yes, I'm an idiot who likes to complicate things. :o :D

Gavino
24th June 2010, 15:40
src = AviSource("C:\Users\Propietario\Documents\Edit Video\Untitled 1.avi").ConvertToYV12()
c = Crop(942, 572, 80, 80)
in this way gives me error
You haven't given Crop any input to work on. Here you need
c = src.Crop(942, 572, 80, 80)

Gavino
24th June 2010, 15:46
Another possibility: selective cropping && filtering,
++ the required combination of Stacks().
Yes, instead of using Overlay, you can construct the complete frame from a combination of 'StackHorizontal's and 'StackVertical's. A bit more complicated, but this will be faster.

Guest
24th June 2010, 16:01
A bit more complicated... A bit more? :eek:

Didée
24th June 2010, 16:13
For a 80x80 exclusion area, it's just not worth the hassle. It could even be that the overhead from calling the filter(s) multiple times (for the surrounding slices) makes the overall process slower.

That sort of exclusion is rather sloppy anyway. Depending on the actual kind of filtering, you'll have not much fun with the borders of the exclusion area. Eventually the whole rectangle will "stick out", think about color adjustments and such.

Gavino
24th June 2010, 16:28
For a 80x80 exclusion area, it's just not worth the hassle. It could even be that the overhead from calling the filter(s) multiple times (for the surrounding slices) makes the overall process slower.
By 'it', are you referring to the StackHorizontal/Vertical approach?
You only need to call the filter once on the whole clip, then chop it up with Crop and put the various pieces together, along with the unfiltered section, using the StackXXX. Overlay is quite slow and memory-intensive, while Crop and Stack are very fast.
And if you write it as a function, you only have the hassle once and you can reuse the code on other occasions.
That sort of exclusion is rather sloppy anyway. Depending on the actual kind of filtering, you'll have not much fun with the borders of the exclusion area. Eventually the whole rectangle will "stick out", think about color adjustments and such.
You're right, in general terms. But here I think the exclusion area is a logo, which sticks out anyway.

Didée
24th June 2010, 17:17
You only need to call the filter once on the whole clip, then chop it up with Crop and put the various pieces together, along with the unfiltered section, using the StackXXX.
Ah, okay ... yes, I was thinking [that you were thinking] of individually processing the surrounding slices. I didn't see that you had Overlay is quite slow and memory-intensive in mind.

Sure, Overlay. One of my least-beloved Avisynth filters.

When colorspace allows, Layer() is faster. And MaskTools' "mt_lutxy()" is even faster. Both have those often-forgotten "x" and "y" parameters that allow to offset the secondary clip.

byme
24th June 2010, 18:09
You haven't given Crop any input to work on. Here you need
c = src.Crop(942, 572, 80, 80)

ok, thanks!

byme
24th June 2010, 18:15
Well, sorry. Seems that my browser is to blame!

FireFox is showing me bad colors on this picture. Internet Explorer 8 is showing it as intended. This is what I've seen:

FireFox 3.6.4:
http://img706.imageshack.us/img706/9994/ff364.th.png (http://img706.imageshack.us/i/ff364.png/)

Internet Explorer 8:
http://img404.imageshack.us/img404/189/ie8.th.png (http://img404.imageshack.us/i/ie8.png/)

Did you use Software with Color Managment to create this screenshot?


OT: By accident, someone knows if it's a setting in FireFox that needs to be adjusted?

(For years I've been using the dont-you-ever-useit IE. Now I've switched to the behailed FireFox. And now this. Hehe.)

Edit: Nope. gfx.color_managment.XXX in FF is already set. Playing with the settings eventually makes all other content rendered falsely. But it never cuts into that PNG graphic, which always looks green & purple.

I played a bit with this http://file2.net/thb/100624/6388cr.png (http://file2.net/100624img6388cr.png.html)


at me Firefox not create that problem

byme
24th June 2010, 18:18
For a 80x80 exclusion area, it's just not worth the hassle. It could even be that the overhead from calling the filter(s) multiple times (for the surrounding slices) makes the overall process slower.

That sort of exclusion is rather sloppy anyway. Depending on the actual kind of filtering, you'll have not much fun with the borders of the exclusion area. Eventually the whole rectangle will "stick out", think about color adjustments and such.

better that way...

I did not understand what is Stacks() :p

Midzuki
24th June 2010, 21:16
I did not understand what is Stacks() :p

StackHorizontal() and StackVertical()

http://avisynth.org.ru/docs/english/corefilters/stack.htm