|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiArctanLUT.h>
Inheritance diagram for lti::arctanLUT:


Public Member Functions | |
| arctanLUT () | |
| float | operator() (const float dy, const float dx) const |
| float | operator() (const double &dy, const double &dx) const |
| float | operator() (const int dy, const int dx) const |
Protected Types | |
| typedef const float * | cfloatptr |
Static Protected Member Functions | |
| static void | constructArcTanLUT () |
Static Protected Attributes | |
| static const cfloatptr * | atanLUT |
The provided functionality is similar to std::atan2(y,x) which computes arctan(y/x) returning also the right angle quadrant.
This method is used in time critical operations. It is not appropriate if you need exact computations of the arctan. For that you can use the standard method std::atan2, which is of course much more time expensive.
As a mono-state class, only one instance of the LUT will be created.
To use it, just create an instance and use the operator() as if you were using std::atan2:
lti::arctanLUT myatan2; float angle = myatan2(20,10);
The returned angle will be always possitive 0 <= angle < 2*Pi (in radians)
|
|
Type required to create the LUT as a const structure.
|
|
|
Construct the class Here, the LUT will be build just once (if not already done). The first time you construct this class, it will take about 0.15 seconds to build the LUT. |
|
|
construct a atan2 LUT. It will assume that the difference values of the gradients will be always between -255 and 255. The 1MB Memory required should not be a problem in modern PCs anymore!. |
|
||||||||||||
|
Compute the arctan(dx/dy). This is the fastest method, but the value range of the input variables is restricted.
|
|
||||||||||||
|
Compute the arctan(dx/dy). It is a little bit slower than the other atan2() method, as it needs to scale the input values into the range -255 and 255. If you need a extremely efficient computation, try the other atan2() method.
|
|
||||||||||||
|
Compute the arctan(dx/dy). It is a little bit slower than the other atan2() method, as it needs to scale the input values into the range -255 and 255. If you need a extremely efficient computation, try the other atan2() method.
|
|
|
the arctanLUT with floats. After calling constructArcTanLUT() the valid index range for both dimensions will be between -255 and 255. The arctanLUT[dy][dx] is equivalent to atan2(dy,dx) (but much faster). The entries will always be between 0 and 2*Pi. |