Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Hu monents

Subject: Hu monents

From: joveria

Date: 20 Jul, 2011 20:00:10

Message: 1 of 8

Hi,
I am using

mji=sum(sum array(x,y).(x-x')^j.(y-y')^i)

formula to compute hu moments. I want to know that I am doing this right or is there any other formula to compute hu moments?
Or is this the right formula for calculating hu moments?

Subject: Hu monents

From: Roger Stafford

Date: 21 Jul, 2011 02:53:09

Message: 2 of 8

"joveria" wrote in message <j07c4a$1bo$1@newscl01ah.mathworks.com>...
> Hi,
> I am using
>
> mji=sum(sum array(x,y).(x-x')^j.(y-y')^i)
>
> formula to compute hu moments. I want to know that I am doing this right or is there any other formula to compute hu moments?
> Or is this the right formula for calculating hu moments?
- - - - - - - - - - - -
  See http://en.wikipedia.org/wiki/Image_moment

Roger Stafford

Subject: Hu monents

From: joveria

Date: 21 Jul, 2011 10:43:08

Message: 3 of 8


when hu moments give values in exponentials then what does it mean? is it giving right or wrong answer. plz guide me in this
 thanks in advance

Subject: Hu monents

From: Roger Stafford

Date: 21 Jul, 2011 16:58:09

Message: 4 of 8

"joveria" wrote in message <j08vrs$899$1@newscl01ah.mathworks.com>...
>
> when hu moments give values in exponentials then what does it mean? is it giving right or wrong answer. plz guide me in this
> thanks in advance
- - - - - - - - - -
  What you have shown in your first posting is the formula for an image's central moments. If you consult the Wikipedia referenc I gave you, these can be used to compute the eta scale invariant moments, and these in turn can be used to compute the eight different Hu moments in accordance with the formulas given there.

  I don't understand your question where you wrote, "hu moments give values in exponentials". The only exponentials involved are the "orders" associated with the various moments. What exactly are you asking?

Roger Stafford

Subject: Hu monents

From: joveria

Date: 21 Jul, 2011 17:26:09

Message: 5 of 8


i have computed moment invariants by
m02=sum(sum(double(im).*(row-centroid(1))^0.*(col-centroid(2))^2)

 then normalized them by using this

n02=m02/area^gamma
gamma=2+(0+2)/2

n i got value like this: 3.456e4

my question is: does normalizing give value in exponentials as i got to know that normalization should not be in exponentials

Subject: Hu monents

From: Roger Stafford

Date: 21 Jul, 2011 18:04:08

Message: 6 of 8

"joveria" wrote in message <j09nfh$jcf$1@newscl01ah.mathworks.com>...
>
> i have computed moment invariants by
> m02=sum(sum(double(im).*(row-centroid(1))^0.*(col-centroid(2))^2)
>
> then normalized them by using this
>
> n02=m02/area^gamma
> gamma=2+(0+2)/2
>
> n i got value like this: 3.456e4
>
> my question is: does normalizing give value in exponentials as i got to know that normalization should not be in exponentials
- - - - - - - - -
  Your question is still not clear to me, Joveria. You ask, "does normalizing give value in exponentials" and "normalization should not be in exponentials". I don't know what you mean by that. What "exponentials" are you referring to? In what way is that related to the 3.456e4 answer you received? There seems to be a language barrier here. Can you give some concrete set of numbers in terms of which to pose that question?

  A second point: In your code

 n02=m02/area^gamma
 gamma=2+(0+2)/2

I assume that 'area' is just m00. If so, it looks as if the gamma should be:

 gamma = 1+(0+2)/2

rather than what you have. See the formula for eta_i_j in the Wikipedia reference.

Roger Stafford

Subject: Hu monents

From: sarah

Date: 22 Jul, 2011 05:06:10

Message: 7 of 8

Sorry Roger, i am not able to explain you my problem. By exponential i mean in the power of 10. I am getting values like this:
I1=0.2812,-0.0073,24.8925,15.4261,837.1579
I2=0.0761,0.0280,845.1402,355.8602,7.0071e+05
I3=0.007,3.2219e-04,506.2985,94.0678,3.7975e+07
I4=0.0043,1.7355e-04,360.7009,57.3486,3.7911e+07
I5=2.5865e-05,7.8553e-09,6.1117e+05,1.4601e+15
I6=-6.7652e+09,8.3733e+08,-5.4083e+18,-9.7474e+17,3.1191e+20

these are values of differents objects in one image: hope you now understand

Subject: Hu monents

From: joveria

Date: 23 Jul, 2011 08:32:11

Message: 8 of 8

Sorry Roger, i am not able to explain you my problem. By exponential i mean in the power of 10. I am getting values of hu moments like this:
 I1=0.2812,-0.0073,24.8925,15.4261,837.1579
 I2=0.0761,0.0280,845.1402,355.8602,7.0071e+05
 I3=0.007,3.2219e-04,506.2985,94.0678,3.7975e+07
 I4=0.0043,1.7355e-04,360.7009,57.3486,3.7911e+07
 I5=2.5865e-05,7.8553e-09,6.1117e+05,1.4601e+15
 I6=-6.7652e+09,8.3733e+08,-5.4083e+18,-9.7474e+17,3.1191e+20
 
 these are values of differents objects in one image: hope you now understand now
 now my q is: are these values are correct? means can i get these types of values?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us