Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i found some formulas, plz correct me , if i am wrong. And also comment here anything regarding to these formulas. I am using visual c++ and opencv in vs2010. i found formulas for first 4 affine invariant moments. .

lf_I1 = (im_moments->mu20 * im_moments->mu02 - pow(im_moments->mu11,2)) / pow(im_moments->m00,4);

lf_I2 = (-(pow(im_moments->mu30,2)) * (pow(im_moments->mu30,2)) + 6 * im_moments->mu30 im_moments->mu21 * im_moments->mu03 - 4*im_moments->mu30*(pow(im_moments->mu12,3))) / (pow(im_moments->m00,10));

lf_I3 = (im_moments->mu20 * im_moments->mu21 * im_moments->mu03 - im_moments->mu20 * pow(im_moments->mu12,2) - im_moments->mu11  * im_moments->mu30 * im_moments->mu03 + im_moments->mu11 * im_moments->mu21 * im_moments->mu12 + im_moments->mu02  * im_moments->mu30 * im_moments->mu12 - im_moments->mu02 * pow(im_moments->mu21,2)) / pow(im_moments->m00,7);

lf_I4 = (-pow(im_moments->mu20,3) * pow(im_moments->mu03,2) + 6 * pow(im_moments->mu20,2) * im_moments->mu11 * im_moments->mu12 * im_moments->mu03 -3 * pow(im_moments->mu20,2) * im_moments->mu02 * pow(im_moments->mu12,2) - 6 * im_moments->mu20 * pow(im_moments->mu11,2) * im_moments->mu21 * im_moments->mu03 - 6 * im_moments->mu20 * pow(im_moments->mu11,2) * pow(im_moments->mu12,2) + 12 * im_moments->mu20 * im_moments->mu11 * im_moments->mu02 * im_moments->mu21 * im_moments->mu12 - 3 * im_moments->mu20 * pow(im_moments->mu02,2) * pow(im_moments->mu21,2) + 2 * pow(im_moments->mu11,3) * im_moments->mu30 * im_moments->mu03 + 6 * pow(im_moments->mu11,3) * im_moments->mu21 * im_moments->mu12 - 6 * pow(im_moments->mu11,2) * im_moments->mu02 * im_moments->mu30 * im_moments->mu12 - 6 * pow(im_moments->mu11,2) * im_moments->mu02 * pow(im_moments->mu21,2) + 6 * im_moments->mu11 * pow(im_moments->mu02,2) * im_moments->mu30 * im_moments->mu21 - 1 * pow(im_moments->mu02,3) * pow(im_moments->mu30,2)) / pow(im_moments->m00,11);