Ask Your Question
0

How to use Tan-1 in OpenCV

asked 2017-07-03 03:16:46 -0600

jjabaram gravatar image

I want to calculate with this formula

tan-1(Image 1 / Image2)

how to implement it in OpenCV. Thank you.

edit retag flag offensive close merge delete

Comments

Not sure what you're trying to achieve. Calculating atan makes sense only if the Mat objects would contain coordinate values, something like the result of meshgrid in Matlab/Octave. You can't really calculate atan of an image - there is no such thing that I would be aware of.

KjMag gravatar imageKjMag ( 2017-07-03 05:22:02 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-07-03 06:53:40 -0600

LBerger gravatar image

updated 2017-08-01 05:45:13 -0600

You should use phase function

Mat xxx = (Mat_<float>(2, 2) << 1, 2, 3, 4);
Mat yyy = (Mat_<float>(2, 2) << 1, 2, 4, 5),angle;
phase(xxx,yyy,angle);
cout<<angle;

results are :

[0.78523159, 0.78523159;
 0.92740309, 0.89609587]
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-07-03 03:16:46 -0600

Seen: 1,440 times

Last updated: Aug 01 '17