View Single Post
Old 15th October 2011, 13:21   #1  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Plugin: MinMax

I'd like to use masktools to find the minimum luma on each line. Manao made the suggestion to recursively use a small list of relative coordinates.
I am using mt_luts(last, last, mode="min", pixels="-1 0 0 0", expr="y")
So we have a line like
6 5 4 3 2 1 255 255
But the filter is processed from right to left, after luts:
6 5 4 3 2 1 255 255
Then he suggests resizing in half to save work, but the right half is deleted in YUV modes, so we have to do it specially with
pointresize(last.width/2,last.height,1,0,last.width,last.height):
5 3 1 255
After further iterations:
5 3 1 1
3 1 255 255
3 1 1 255
1 255
A couple problems, you can't keep halving the size unless you padded it out to the nearest power of 2, or typically abou 1024. The padding should be luma=255.
The final answer is the first pixel. I need to expand that back to the original width.
I guess I could do one more luts then pointresize.
Is that going to work?

Last edited by jmac698; 15th October 2011 at 22:02.
jmac698 is offline   Reply With Quote