bazar  1.3.1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PyrImage Class Reference

Multi-resolution pyramidal image. More...

#include <pyrimage.h>

Public Member Functions

 PyrImage (IplImage *im, int nblev)
 ~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)
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()

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 40 of file pyrimage.h.

Constructor & Destructor Documentation

PyrImage::PyrImage ( IplImage *  im,
int  nblev 
)

Definition at line 27 of file pyrimage.cpp.

References images, and nbLev.

Referenced by clone(), and load().

PyrImage::~PyrImage ( )

Definition at line 39 of file pyrimage.cpp.

References images, and nbLev.

Member Function Documentation

void PyrImage::build ( )

build the pyramid from level 0 by calling cvPyrDown()

Definition at line 45 of file pyrimage.cpp.

References images, and nbLev.

Referenced by object_view::build(), object_view::build_from_image_0(), load(), and pyr_yape::pyramidBlurDetect().

PyrImage * PyrImage::clone ( ) const

make an exact copy of this image, reallocating all memory.

Definition at line 116 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 67 of file pyrimage.cpp.

Referenced by pyr_yape::save_image_of_detected_points(), setImageROI(), and setPixel().

float PyrImage::convCoordf ( float  x,
int  from,
int  to = 0 
)
static
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 51 of file pyrimage.cpp.

References build(), and PyrImage().

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

Definition at line 83 of file pyrimage.h.

References images.

void PyrImage::resetImageROI ( )

reset a region of interest using OpenCV cvResetImageROI()

Definition at line 136 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 110 of file pyrimage.cpp.

References images, and nbLev.

void PyrImage::setImageROI ( CvRect  rect)

set a region of interest using OpenCV cvSetImageROI()

Definition at line 124 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
xx coordinate for level 0
yy coordinate for level 0
valpixel value to change.

Definition at line 97 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 86 of file pyrimage.h.

References images.

Referenced by object_view::build_from_image_0().

Member Data Documentation

IplImage** PyrImage::images
const int PyrImage::nbLev

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