It takes gray image as an input and outputs vector of first 8 hu moments of order 3
Ishrat Badami (2019). Hu Moments of order 3 (https://www.mathworks.com/matlabcentral/fileexchange/35552-hu-moments-of-order-3), MATLAB Central File Exchange. Retrieved .
Create scripts with code, output, and formatted text in a single executable document.
David Denteh (view profile)
Ross Marchant (view profile)
Needs updating to fix errors. I think 3 or 4 have mistakes
Fixed versions I believe:
I_one = mu_20 + mu_02;
I_two = (mu_20 - mu_02)^2 + 4*mu_11^2;
I_three = (mu_30 - 3*mu_12)^2 + (3*mu_21 - mu_03)^2;
I_four = (mu_30 + mu_12)^2 + (mu_21 + mu_03)^2;
I_five = (mu_30 - 3*mu_12)*(mu_30 + mu_12)*((mu_30 + mu_12)^2 - 3*(mu_21 + mu_03)^2) + (3*mu_21 - mu_03)*(mu_21 + mu_03)*(3*(mu_30 + mu_12)^2 - (mu_21 + mu_03)^2);
I_six = (mu_20 - mu_02)*((mu_30 + mu_12)^2 - (mu_21 + mu_03)^2) + 4*mu_11*(mu_30 + mu_12)*(mu_21 + mu_03);
I_seven = (3*mu_21 - mu_03)*(mu_30 + mu_12)*((mu_30 + mu_12)^2 - 3*(mu_21 + mu_03)^2) - (mu_30 - 3*mu_12)*(mu_21 + mu_03)*(3*(mu_30 + mu_12)^2 - (mu_21 + mu_03)^2);
I_eight = mu_11*((mu_30 + mu_12)^2 - (mu_03 + mu_21)^2) - (mu_20 - mu_02)*(mu_30 + mu_12)*(mu_21 + mu_03);
issa mansour (view profile)
Julien Jemine (view profile)
Also you forgot parenthesis in I_eight. It should be
I_eight = mu_11*((mu_30 + mu_12)^2 - (mu_03 + mu_21)^2) - (mu_20 - mu_02)*(mu_30 + mu_12)*(mu_21 + mu_03);
Thanks for sharing!
alok vashisth (view profile)
dd
Mikhail Breslav (view profile)
Also I_six should have a mu_11 term after the 4* term.
Mikhail Breslav (view profile)
It looks like you forgot to square mu_11 in your implementation. For I_two it should be 4*mu_11^2