PDA

View Full Version : Absolute Subtraction


HighInBC
8th October 2004, 03:39
I need to subtract one clip from the other and get an absolute answer.

The Subtract() command and the Layer() command both crop values to 0 if they go below it, what I would like is an absolute answer.

say pixel 'a' is 120, and pixel 'b' is 130, then I would like 10:
120-130 = -10, absolute of -10 is 10

like 'abs(a-b)' or ((a-b)<0)? ((a-b)*-1) : (a-b)

This would help me alot, -HighInBC

Manao
8th October 2004, 06:45
Get the Masktools, and use either YV12LUTxy ( YV12LUTxy(clip1, clip2, yexpr = "x y - abs", uexpr = "x y - abs", vexpr = "x y - abs", y=3, u=3, v=3) ) or YV12Subtract ( YV12Subtract(clip1, clip2, tol = 0, widerange = false, y=3, u=3, v=3 ) ). The later will be the faster.

Have a look at the documentation to understand all the settings :

http://jourdan.madism.org/~manao/MaskTools-v1.5.4.zip
http://jourdan.madism.org/~manao/MaskTools.htm

HighInBC
8th October 2004, 17:18
Thankyou so much, I was looking at YV12LUT but I did not understand it. Wow, what a usefull command for pretty much anything.

-HighInBC