Ask Your Question

# What is the cartToPolar angle direction in OpenCV?

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

edit retag close merge delete

## 1 answer

Sort by » oldest newest most voted

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.

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].

more

## Comments

Thank you very much!

( 2013-04-08 09:09:22 -0500 )edit

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

( 2013-04-08 09:38:32 -0500 )edit

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2013-04-08 06:26:15 -0500

Seen: 2,324 times

Last updated: Apr 08 '13