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:
can someone help me with this

Subject: can someone help me with this

From: Regina

Date: 8 Mar, 2009 23:42:02

Message: 1 of 9

hi!

i really have a difficulty in analyzing the star skeleton of a given image.
i need to get the angle and i don't seem to get how to do it.
i hope someone will help me with this.

http://www.vision.cs.chubu.ac.jp/04/pdf/VSAM08.pdf

the pdf above explains how to get the angle and i dont get how.
i have already the extremal points of the skeleton and my problem is to get the angle.
if someone is willing to help me with this.
i will post my codes here as well as my sample images

thanks

Subject: can someone help me with this

From: ImageAnalyst

Date: 9 Mar, 2009 00:56:57

Message: 2 of 9

Regina
Did you read down as far as equation (7)?
It says the angle is the arctangent of (x - xcentroid)/(y - ycentroid)
What about that don't you understand?

Subject: can someone help me with this

From: Roger Stafford

Date: 9 Mar, 2009 01:18:02

Message: 3 of 9

"Regina " <velasquezregina@rocketmail.com> wrote in message <gp1l4a$2ud$1@fred.mathworks.com>...
> hi!
>
> i really have a difficulty in analyzing the star skeleton of a given image.
> i need to get the angle and i don't seem to get how to do it.
> i hope someone will help me with this.
>
> http://www.vision.cs.chubu.ac.jp/04/pdf/VSAM08.pdf
>
> the pdf above explains how to get the angle and i dont get how.
> i have already the extremal points of the skeleton and my problem is to get the angle.
> if someone is willing to help me with this.
> i will post my codes here as well as my sample images
>
> thanks

  In the paper you mentioned they give equation (7):

 theta = arctan((lx-xc)/(ly-yc))

where fig. 5a shows theta being measured counterclockwise from the downward-pointing positive y-axis toward the right-pointing positive x-axis. You could do this computation in matlab with:

 theta = atan((lx-xc)/(ly-yc));

However I would recommend using

 theta = atan2(lx-xc),ly-yc);

instead since its results remain valid even for "legs" that have been raised more than pi/2 (90 degrees) above horizontal. Also 'atan2' is more accurate for angles that are near pi/2 where 'atan' would have accuracy difficulties.

  Note that both functions give angles in radians, not degrees. To get degrees with 'atan2', multiply by 180/pi.

  The angle phi as shown in fig. 5b seems to be defined differently. If the x and y axes are defined the same, phi would be measured clockwise from the vertical negative y-axis toward the right-pointing positive x-axis, so you could find it with

 phi = atan2(lx-xc,yc-ly);

  It seems a shame to introduce confusion by these two different definitions of angles. Perhaps that is the reason you had trouble with this, Regina.

Roger Stafford

Subject: can someone help me with this

From: Regina

Date: 10 Mar, 2009 00:06:04

Message: 4 of 9

hi mr stafford

thanks for your help.
i'll try our suggestion and i hope it works!

thanks again

regina

Subject: can someone help me with this

From: Regina

Date: 11 Mar, 2009 06:32:04

Message: 5 of 9

hi mr stafford

can you explain to me how to code equation 6 found in the pdf?
i cant seem to understand it

thanks

Subject: can someone help me with this

From: Roger Stafford

Date: 11 Mar, 2009 08:19:01

Message: 6 of 9

"Regina " <velasquezregina@rocketmail.com> wrote in message <gp7lt4$34l$1@fred.mathworks.com>...
> hi mr stafford
>
> can you explain to me how to code equation 6 found in the pdf?
> i cant seem to understand it
>
> thanks

  The way I interpret equation (6), you are to select as pair (lx,ly), from among the set of those (xs,ys) for which ys < yc, that one for which xs is minimum (that is, farthest to the left.) If I have that right, you can do it this way. Suppose xs and ys are both vectors of the extremal point coordinates.

 p = find(ys<yc); % Limit the choice to ys's which are below yc
 [lx,q] = min(xs(p); % From among these choose the smallest xs
 ly = ys(p(q)); % Then choose its matching ys

  This presupposes that a ys element exists which is less than the threshold value yc. Otherwise p is empty and no valid answer is produced.

  This is simple to compute but in my opinion it is a rather crude criterion to use. If yc is too high, a hand may be chosen, and if it is too low, no answer is forthcoming. Ideally the angle should also play some role in the selection of (lx,ly).

Roger Stafford

Subject: can someone help me with this

From: Regina

Date: 11 Mar, 2009 09:55:03

Message: 7 of 9

hi mr stafford

i have already implemented the code that you have given and im really thankful for your help.
however, i have a difficulty in determining the value for phi because it just gives the inverse plot of theta.
how would i implement equation 6 of the pdf for the torso angle or phi?
thanks!

Subject: can someone help me with this

From: Regina

Date: 12 Mar, 2009 00:30:05

Message: 8 of 9

hi mr stafford

i have already implemented the code that you have given and im really thankful for your help.
however, i have a difficulty in determining the value for phi because it just gives the inverse plot of theta.
how would i implement equation 6 of the pdf for the torso angle or phi? and also how is the pre-emphasis filter done and how to use autocorrelation in the signal?

thanks for all the help!

Subject: can someone help me with this

From: Manal

Date: 16 Jun, 2010 17:17:05

Message: 9 of 9

"Regina " <velasquezregina@rocketmail.com> wrote in message <gp9l2c$jl9$1@fred.mathworks.com>...
> hi mr stafford
>
> i have already implemented the code that you have given and im really thankful for your help.
> however, i have a difficulty in determining the value for phi because it just gives the inverse plot of theta.
> how would i implement equation 6 of the pdf for the torso angle or phi? and also how is the pre-emphasis filter done and how to use autocorrelation in the signal?
>
> thanks for all the help!

Hi regina
could you help me in this algorithm
I am don't know how to extract the extreme points by using the zero-crossings

waiting to hair from you
thanks

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