First time here? Check out the FAQ!

Ask Your Question
0

What is the cartToPolar angle direction in OpenCV?

asked Apr 8 '13

Milanista gravatar image

updated Apr 8 '13

Hello!

I would like to ask, where exactly the angle computed by carToPolar function points? For example, if I have a 3x3 MAT matrix, and the angle at point [1,1] is 45°, it will point to [2,2] or [0,2] ?

Thank you

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Apr 8 '13

Basically it the output is calculated clockwise starting from the x - axis. This is dependant on how the axes in OpenCV are actually visualized. So take a look at the following picture.

image description

This means that if a point [1,1] has a gradient angle of 45°, it will point towards the pixel that is at 45° looking from the coordinate center. In this case it will be [2,2]. An angle of 90° would point to [2,0].

Preview: (hide)

Comments

Thank you very much!

Milanista gravatar imageMilanista (Apr 8 '13)edit

If it helped you, accept the answer, so that this topic appears solved. You are welcome!

StevenPuttemans gravatar imageStevenPuttemans (Apr 8 '13)edit

Question Tools

Stats

Asked: Apr 8 '13

Seen: 3,582 times

Last updated: Apr 08 '13