PyrImage Class Reference

Multi-resolution pyramidal image. More...

#include <pyrimage.h>

List of all members.

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.
PyrImageclone () 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 PyrImageload (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


Detailed Description

Multi-resolution pyramidal image.

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.


Constructor & Destructor Documentation

PyrImage::PyrImage ( IplImage *  im,
int  nblev,
bool  build_it = false 
)

Definition at line 46 of file pyrimage.cpp.

References build(), images, and nbLev.

Referenced by clone(), and load().

PyrImage::~PyrImage (  ) 

Definition at line 61 of file pyrimage.cpp.

References images, and nbLev.


Member Function Documentation

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.

References images, and nbLev.

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.

Returns:
0 on failure or a valid PyrImage that has to be deleted by the caller.

Definition at line 73 of file pyrimage.cpp.

References build(), and PyrImage().

IplImage* PyrImage::operator[] ( unsigned  i  )  [inline]

Definition at line 103 of file pyrimage.h.

References images.

CvScalar PyrImage::randomSample ( float  u,
float  v,
float  sigma2,
float *  grad = 0 
) const

Definition at line 405 of file pyrimage.cpp.

References bicubicSample(), and nbLev.

void PyrImage::resetImageROI (  ) 

reset a region of interest using OpenCV cvResetImageROI()

Definition at line 167 of file pyrimage.cpp.

References images, and nbLev.

void PyrImage::set ( CvScalar  val = cvScalarAll(0)  ) 

Set all pixels of all levels to a constant value.

Definition at line 132 of file pyrimage.cpp.

References images, and nbLev.

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.

Parameters:
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]

apply a gaussian blur on level 0.

Definition at line 110 of file pyrimage.h.

References images.

void PyrImage::swap ( PyrImage a  ) 

Definition at line 158 of file pyrimage.cpp.

References images, and nbLev.


Member Data Documentation

IplImage** PyrImage::images

const int PyrImage::nbLev


The documentation for this class was generated from the following files:

Generated on Tue Mar 30 15:53:25 2010 for Polyora by  doxygen 1.5.9