I have been doing a fair bit of searching around for an answer to my issue here.. hopefully someone can tell me where im going wrong.
im trying to replicate matlabs regionprops function to calculate major/minor axis lengths, and think i understand most of what it's doing but im a little lost.
my understanding was that the axis lengths are equal to the eigenvalues of the covariance matrix (of the regions pixel coordinates) but the numbers i am getting are far from what matlab is returning.
so far i am: 1)extracting coordinates as an n-by-2 matrix. 2)subtracting the x/y means from the matrix. 3)calculating covariance matrix (matrix'.matrix)/num_pixels 4)calculating eigenvalues from the covariance matrix
but the values i get are way away from what matlab is returning. am i doing completely the wrong thing here or am i just making a mistake in the working?