#include <pyrimage.h>
Public Member Functions | |
PyrImage (IplImage *im, int nblev, bool build_it=false) | |
~PyrImage () | |
void | build () |
build the pyramid from level 0 by calling cvPyrDown() | |
void | setPixel (unsigned x, unsigned y, CvScalar &val) |
Set a pixel a every precision level. | |
void | set (CvScalar val=cvScalarAll(0)) |
Set all pixels of all levels to a constant value. | |
PyrImage * | clone () const |
make an exact copy of this image, reallocating all memory. | |
IplImage * | operator[] (unsigned i) |
CvScalar | bicubicSample (float x, float y, int l, float *grad=0) const |
(x,y) at normal image coordinates (level 0). grad is a 3x2 matrix. | |
CvScalar | randomSample (float u, float v, float sigma2, float *grad=0) const |
void | smoothLevel0 (int kernelSize=3) |
apply a gaussian blur on level 0. | |
void | setImageROI (CvRect rect) |
set a region of interest using OpenCV cvSetImageROI() | |
void | resetImageROI () |
reset a region of interest using OpenCV cvResetImageROI() | |
void | swap (PyrImage &a) |
Static Public Member Functions | |
static PyrImage * | load (int level, const char *filename, int color, bool fatal=true) |
try to load an image with cvLoadImage() and build a PyrImage. | |
static int | convCoord (int x, int from, int to=0, unsigned method=0) |
Convert a coordinate from one level to another. | |
static float | convCoordf (float x, int from, int to=0) |
Convert a subpixel coordinate from one level to another. | |
Public Attributes | |
const int | nbLev |
IplImage ** | images |
Represent a multi-precision pyramidal image. images[0] is the largest image. images[nbLev-1] is the smallest image.
Each level is 4 times smaller than the previous one: width and height are divided by 2.
Definition at line 59 of file pyrimage.h.
PyrImage::PyrImage | ( | IplImage * | im, | |
int | nblev, | |||
bool | build_it = false | |||
) |
PyrImage::~PyrImage | ( | ) |
CvScalar PyrImage::bicubicSample | ( | float | x, | |
float | y, | |||
int | l, | |||
float * | grad = 0 | |||
) | const |
(x,y) at normal image coordinates (level 0). grad is a 3x2 matrix.
Definition at line 393 of file pyrimage.cpp.
References cvBicubicSample(), and images.
Referenced by randomSample().
void PyrImage::build | ( | ) |
build the pyramid from level 0 by calling cvPyrDown()
Definition at line 67 of file pyrimage.cpp.
Referenced by kpt_tracker::add_frame(), load(), kpt_tracker::process_frame(), vobj_tracker::process_frame_pipeline(), kpt_tracker::process_frame_pipeline(), pyr_yape::pyramidBlurDetect(), and PyrImage().
PyrImage * PyrImage::clone | ( | ) | const |
make an exact copy of this image, reallocating all memory.
Definition at line 138 of file pyrimage.cpp.
References images, nbLev, and PyrImage().
int PyrImage::convCoord | ( | int | x, | |
int | from, | |||
int | to = 0 , |
|||
unsigned | method = 0 | |||
) | [static] |
Convert a coordinate from one level to another.
Definition at line 89 of file pyrimage.cpp.
Referenced by setImageROI(), and setPixel().
float PyrImage::convCoordf | ( | float | x, | |
int | from, | |||
int | to = 0 | |||
) | [static] |
Convert a subpixel coordinate from one level to another.
Definition at line 108 of file pyrimage.cpp.
Referenced by pyr_yape::detect().
PyrImage * PyrImage::load | ( | int | level, | |
const char * | filename, | |||
int | color, | |||
bool | fatal = true | |||
) | [static] |
try to load an image with cvLoadImage() and build a PyrImage.
Definition at line 73 of file pyrimage.cpp.
References build(), and PyrImage().
IplImage* PyrImage::operator[] | ( | unsigned | i | ) | [inline] |
CvScalar PyrImage::randomSample | ( | float | u, | |
float | v, | |||
float | sigma2, | |||
float * | grad = 0 | |||
) | const |
void PyrImage::resetImageROI | ( | ) |
reset a region of interest using OpenCV cvResetImageROI()
Definition at line 167 of file pyrimage.cpp.
void PyrImage::set | ( | CvScalar | val = cvScalarAll(0) |
) |
void PyrImage::setImageROI | ( | CvRect | rect | ) |
set a region of interest using OpenCV cvSetImageROI()
Definition at line 146 of file pyrimage.cpp.
References convCoord(), images, and nbLev.
void PyrImage::setPixel | ( | unsigned | x, | |
unsigned | y, | |||
CvScalar & | val | |||
) |
Set a pixel a every precision level.
Compute coordinates for each precision level, and call cvSet2d() on it. This method is slow.
x | x coordinate for level 0 | |
y | y coordinate for level 0 | |
val | pixel value to change. |
Definition at line 119 of file pyrimage.cpp.
References convCoord(), images, and nbLev.
void PyrImage::smoothLevel0 | ( | int | kernelSize = 3 |
) | [inline] |
void PyrImage::swap | ( | PyrImage & | a | ) |
IplImage** PyrImage::images |
Definition at line 124 of file pyrimage.h.
Referenced by visual_object::add_frame(), bicubicSample(), build(), clone(), pyr_yape::cmp_orientation(), kpt_tracker::create_frame(), pyr_yape::detect(), kpt_tracker::detect_keypoints(), icvInitPyramidalAlgorithm(), vobj_tracker_view::keyPressEvent(), myCalcOpticalFlowPyrLK(), operator[](), VSView::paintGL(), pyr_keypoint::prepare_patch(), pyr_yape::pyr_yape(), pyr_yape::pyramidBlurDetect(), PyrImage(), resetImageROI(), pyr_yape::select_level(), set(), setImageROI(), setPixel(), smoothLevel0(), swap(), vobj_tracker_view::timerEvent(), VSView::timerEvent(), and ~PyrImage().
const int PyrImage::nbLev |
Definition at line 123 of file pyrimage.h.
Referenced by build(), clone(), pyr_yape::cmp_orientation(), pyr_yape::detect(), kpt_tracker::detect_keypoints(), icvInitPyramidalAlgorithm(), myCalcOpticalFlowPyrLK(), pyr_yape::pyramidBlurDetect(), PyrImage(), randomSample(), resetImageROI(), set(), setImageROI(), setPixel(), pyr_yape::stat_points(), swap(), kpt_tracker::track_ncclk(), pyr_yape::~pyr_yape(), and ~PyrImage().