View Single Post
Old 19th April 2011, 21:38   #8  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
mx=means of x
x=ref(i)=the first list of numbers to correlate
y=v(i)=the second list of numbers to correlate
my=mean of y
sxy=sum of (x-mx)*(y-my)
s2x=sum of (x-mx)^2
s2y=sum of (y-mx)^2
r=the correlation (between -1 and 1, where close to 1 means the originals are equivalent)
mt has 32bit precision for intermediates, but I can only store an 8 bit result. If I break the calculation into steps, I have to store a result. The result then limits the precision. And you don't need average luma, you can either resize or have a copy of an average in all pixels at once.
Do you want to try to write it? It would be useful, I just don't think it's possible.

Here's the first two calculations:
Code:
l=blankclip(60,16,32,pixel_type="YV12",color_yuv=$648080)#luma=100
r=blankclip(l,color_yuv=$C88080)#luma=200
x=stackhorizontal(l,r)
y=stackhorizontal(r,l)
mx=mt_lutf(x,x,expr="x")
my=mt_lutf(y,y,expr="x")
mx#all grey image with luma=150

Last edited by jmac698; 19th April 2011 at 22:00.
jmac698 is offline   Reply With Quote