how to use lut for atan

asked 2015-05-31 00:33:25 -0500

neal gravatar image

Here is the problem: I have a mat whose value is y/x, and I want to compute the angle of each point in the mat, so I am going to use look-up table for this. But, as you know, the value of tan() between 1-90 degree are always double. So I don't know how exactly to figure this value? Is there anyone can provide me with some advice? Thank you very much!

edit retag flag offensive close merge delete

Comments

1

you could use fastAtan2 instead

berak gravatar imageberak ( 2015-05-31 01:25:15 -0500 )edit

I want to operate on mat.

neal gravatar imageneal ( 2015-06-01 04:02:55 -0500 )edit

how do you get that Mat ?

if you had 2 sobel outputs it would look like:

hal::fastAtan2(sobel_x.ptr<float>(0), sobel_y.ptr<float>(0), result.ptr<float>(0), I.total(), true);
berak gravatar imageberak ( 2015-06-01 04:18:14 -0500 )edit