A class that does space-variant processing with log polar transform. More...
#include <Foveator/LPTFoveator.H>
Classes | |
struct | ltPoint2D |
a function object for the key compare in multimap | |
Public Member Functions | |
LPTFoveator (const Image< PixRGB< byte > > &img, int lptW, int lptH) | |
Construct a LPTFoveator for img. | |
~LPTFoveator () | |
Destructor. | |
virtual bool | setOrigin (Point2D< int > pt) |
Set origin point (center of foveation). | |
virtual bool | setOrigin (int x, int y) |
Set origin point (center of foveation). | |
Image< PixRGB< byte > > | foveate (void) |
Perform log-polar foveation and return resulting image. | |
Image< PixRGB< byte > > | getLPT (void) |
Perform log-polar transform and return map image. | |
Image< PixRGB< byte > > | invLPT (const Image< PixRGB< byte > > &img) |
Perform inverse log-polar transform on a map image to get foveated image. | |
Static Public Member Functions | |
static Image< PixRGB< byte > > | foveate (const Image< PixRGB< byte > > &img, int lptW, int lptH, int x, int y, bool getMap=false) |
Perform one log-polar foveation without a LPTFoveator. | |
static Image< PixRGB< byte > > | invLPT (const Image< PixRGB< byte > > &img, int w, int h, int x, int y) |
Get foveated image from log-polar map image. |
A class that does space-variant processing with log polar transform.
A log-polar transform (LPT) maps pixels of the original image to a smaller "map" image that holds pixel data. The LPT transforms rectangular coordinates into , where r is a function of the log of the radius from the point to the origin, and is the angle from the horizontal axis.
For points close to the origin, the result is that the LPT mapping is almost one-to-one, while in the periphery many pixels may correspond to a single ordered pair of , resulting in some degree of data loss. To display the foveated image an inverse LPT must be performed with the invLPT() set of methods.
LPTFoveator is very fast compared with BlurFoveator and PyrFoveator, and is useful for compression. However, there is a significant amount of blockiness in the periphery in the foveated image, and it seems that noise can have a serious effect on image quality.
Definition at line 33 of file LPTFoveator.H.
Construct a LPTFoveator for img.
This constructor will create a LPTFoveator that handles img and all other images of the same dimensions.
img | image to be foveated | |
lptW | width of log-polar map image, controls radial detail | |
lptH | height of log-polar map image, controls angular detail |
Definition at line 16 of file LPTFoveator.C.
References Foveator::height, setOrigin(), and Foveator::width.
LPTFoveator::~LPTFoveator | ( | ) |
Destructor.
Definition at line 28 of file LPTFoveator.C.
Image< PixRGB< byte > > LPTFoveator::foveate | ( | const Image< PixRGB< byte > > & | img, | |
int | lptW, | |||
int | lptH, | |||
int | x, | |||
int | y, | |||
bool | getMap = false | |||
) | [static] |
Perform one log-polar foveation without a LPTFoveator.
This function is for foveating ONE image with a call such as LPTFoveator::foveate(). It is not optimized for foveating multiple images.
img | image to be foveated | |
lptW | width of log-polar map image, controls radial detail | |
lptH | height of log-polar map image, controls angular detail | |
x | horizontal coordinate of origin | |
y | vertical coordinate of origin | |
getMap | set this to true if you want to have this function return map image rather than foveated image |
Definition at line 135 of file LPTFoveator.C.
References Image< T >::getWidth(), invLPT(), log(), max(), NO_INIT, pix, and Image< T >::setVal().
Perform log-polar foveation and return resulting image.
Implements Foveator.
Definition at line 78 of file LPTFoveator.C.
Perform log-polar transform and return map image.
Definition at line 86 of file LPTFoveator.C.
References PixRGB< T >::blue(), Image< T >::getVal(), PixRGB< T >::green(), NO_INIT, Foveator::original, pix, PixRGB< T >::red(), and Image< T >::setVal().
Referenced by foveate().
Image< PixRGB< byte > > LPTFoveator::invLPT | ( | const Image< PixRGB< byte > > & | img, | |
int | w, | |||
int | h, | |||
int | x, | |||
int | y | |||
) | [static] |
Get foveated image from log-polar map image.
This function can be used to perform an inverse log-polar transform without a LPTFoveator. It is not optimized for performing this operation on multiple images, but it would be faster to use this function on an map image than to call LPTFoveator::foveate() again with getMap = true.
img | image to be foveated | |
w | width of original image (before LPT) | |
h | height of original image (before LPT) | |
x | horizontal coordinate of origin | |
y | vertical coordinate of origin |
Definition at line 244 of file LPTFoveator.C.
References log(), max(), NO_INIT, and Image< T >::setVal().
Perform inverse log-polar transform on a map image to get foveated image.
This function can do an inverse log-polar transform on an image returned by LPTFoveator::getLPT(). It will be important that this function must be called from the same LPTFoveator object that created the map image, or from one with the same configuration parameters. Also, the origin must not have been changed since the map image was generated.
img | map image (source from which foveated image will be created) |
Definition at line 123 of file LPTFoveator.C.
References Foveator::height, NO_INIT, Image< T >::setVal(), and Foveator::width.
Referenced by foveate().
bool LPTFoveator::setOrigin | ( | int | x, | |
int | y | |||
) | [virtual] |
Set origin point (center of foveation).
Set origin point to two int arguments, returns true if successful
x | horizontal coordinate of origin | |
y | vertical coordinate of origin |
Reimplemented from Foveator.
Definition at line 70 of file LPTFoveator.C.
References setOrigin().
bool LPTFoveator::setOrigin | ( | Point2D< int > | pt | ) | [virtual] |
Set origin point (center of foveation).
Set origin point to Point2D<int> argument, returns true if successful
pt | center of foveation |
Reimplemented from Foveator.
Definition at line 37 of file LPTFoveator.C.
References Foveator::height, Point2D< T >::i, log(), max(), Foveator::origin, Foveator::setOrigin(), and Foveator::width.
Referenced by LPTFoveator(), and setOrigin().