#include <CMotion2DImage.h>
Public Methods | |
CMotion2DImage () | |
CMotion2DImage (const CMotion2DImage< Type > &) | |
CMotion2DImage (unsigned nb_rows, unsigned nb_cols) | |
CMotion2DImage (unsigned nb_rows, unsigned nb_cols, Type value) | |
~CMotion2DImage () | |
bool | Init (unsigned nb_rows, unsigned nb_cols) |
bool | Init (unsigned nb_rows, unsigned nb_cols, Type value) |
bool | Resize (unsigned nb_rows, unsigned nb_cols) |
void | Subsample () |
bool | And (CMotion2DImage< Type > &A, CMotion2DImage< Type > &B) |
bool | And (CMotion2DImage< Type > &A, CMotion2DImage< Type > &B, Type label) |
bool | MedianFilter (unsigned filterRowSize, unsigned filterColSize) |
unsigned | GetRows () const |
unsigned | GetCols () const |
unsigned | GetNumberOfPixel () const |
Type * | operator[] (unsigned i) |
const Type * | operator[] (unsigned i) const |
void | operator= (Type x) |
void | operator= (const CMotion2DImage< Type > &image) |
CMotion2DImage< Type > | operator- (const CMotion2DImage< Type > &image) |
Public Attributes | |
Type * | bitmap |
Type ** | row |
Each image is build using two structures (an array bitmap which size is [nb_cols*nb_rows]) and an array of pointer rows (which size is [nb_rows]) the ith element in the row array. row[i] is a pointer toward the ith "line" of the image (i.e., bitmap +i*nb_cols )
Such a structure allows a fast access to each element of the image. If i is the ith rows and j the jth column, the value of this pixel is given by I[i][j] (that is equivalent to row[i][j]).
This is a template class, therefore the type of each element of the array is not a priori defined.
The CMotion2DImage class is only provided for convenience in order to build the Motion2D example programs. Therefore, image input/output manipulations are restricted and only supported for PNG (see ReadPNG() and WritePNG() functions), RAW and PNM file format.
A RAW image file contains simply the list of pixel values with no header. That is why the number of columns and of rows must be given by the user. For RAW file format images, two sets of functions exist, one for the traditional 8-bits images named RAW8 (see functions ReadRAW8() and WriteRAW8()), the other for 9 to 16 bits images named RAW16 (see functions ReadRAW16() and WriteRAW16()).
The different PNM formats are PGM P5 (see functions ReadPGM() and WritePGM()) and PPM P6 (see functions ReadPPM() or WritePPM()). To know more about this image file format: man png, man pgm or man ppm.
Motion2D.cpp, and Warping.cpp.
|
Default constructor. No memory allocation is done.
|
|
Copy constructor. |
|
Constructor. Allocates memory for an image of nb_rows rows and nb_cols columns and set all the elements of the bitmap to 0. If the image was already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.
|
|
Constructor. Allocates memory for an image of nb_rows rows and nb_cols columns and set all the elements of the bitmap to value. If the image was already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.
|
|
Destroys the image. Free the memory used by the image. |
|
Computes a "specific" AND between the A et B images.
|
|
Computes the logical AND between the A et B images. C = A & B
|
|
Returns the number of columns of an image.
|
|
Returns the number of pixels in the image. This number reflects the image size. |
|
Returns the number of rows of an image.
|
|
Allocates memory for an image of nb_rows rows and nb_cols columns and set all elements of the bitmap to value.
|
|
Allocates memory for an image of nb_rows rows and nb_cols columns. Elements of the bitmap are not initialized. If the image was already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.
|
|
Apply a median filter to the image. The filter size is given by the filterRowSize and filterColSize parameters.
|
|
Makes a difference between 2 images returns a reference to the difference image. |
|
Assigns a copy of image to this image and returns a reference to this image. |
|
Set each element of the bitmap to x. |
|
Allows a direct access to the bitmap to get the value of the pixel located at the ith line and jth column: [i][j] = (row[i])[j]. |
|
Allows a direct access to the bitmap to change the value of the pixel located at the ith line and jth column: [i][j] = (row[i])[j]. |
|
Allocates memory for an image of nb_rows rows and nb_cols columns. Elements of the bitmap are not initialized. If the image was already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.
|
|
Subsample the image. The subsampled image is given in I. The number of rows and columns of this image is divided by two. To determine the pixel value, we consider the mean value of the four neighbours. |
|
The bitmap array associated to the image.
|
|
The row array to access to the first element of a line. |