Two function files that can be applied on an image to calculate the seven invariant moments defined by Hu(1962)in terms of centralized Moments for purpose of shape recognition . The function to be used directly by the user is
feature_vec(A),where A is a 2D matrix representing an image.
Inside this function another function :cent_moment(p,q,A)is called to calculate the normalized central moments
You can use it in separate.But you don't need to do so when using feature_vec(A)
Attached with the two functions is a pdf file containing short mathematical notes about the theory of Invariant Moments.
Thanks for the contribution, the code is quite readable and nicely done.
After tinkering with images, that have been rotated/scaled/translated, I noted some discrepancies between theoretically identical results and your script's output. The following lines in fecture_vec.m need to be corrected to: