How to use Tan-1 in OpenCV
I want to calculate with this formula
tan-1(Image 1 / Image2)
how to implement it in OpenCV. Thank you.
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]
Asked: 2017-07-03 03:16:46 -0600
Seen: 1,480 times
Last updated: Aug 01 '17
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.