Binary image mask implementation. More...
#include <ImageMask.h>
Public Types | |
enum | MaskValues { MASKED = 0, VISIBLE = 255 } |
Public Member Functions | |
void | apply (puma2::GrayLevelImage8 &image, unsigned char fillValue=0) |
void | apply (puma2::ColorImageUV8 &image, unsigned char fillU=0, unsigned char fillV=0) |
void | apply (puma2::ColorImageRGB8 &image, unsigned char fillR, unsigned char fillG, unsigned char fillB) |
void | dilate (float radius=1.0) |
Generates a circle with the given radius around each masked pixel. | |
void | erode (float radius=1.0) |
Generates a circle with the given radius around each unmasked pixel. | |
void | expand (const ImageMask &other) |
Bitwise OR operation. Enlarges the unmasked areas by those of the other histogram. | |
void | fill (unsigned char value) |
Overwrite whole mask. | |
void | findBorders () |
Leave only borders between masked and unmasked areas as VOID. | |
bool | findValue (int x, int y, unsigned char value, float radius) |
Box2D< int > | getBoundingBox () |
unsigned char * | getData () |
Point2D | getGravCenter () |
unsigned | getHeight () |
unsigned | getWidth () |
void | grayOut (puma2::ColorImageRGB8 &colorImage, puma2::GrayLevelImage8 &graimageY) |
replace masked areas by gray values | |
void | grayOut (puma2::ColorImageRGB8 &colorImage) |
ImageMask () | |
The constructor. | |
ImageMask (const ImageMask &other) | |
Copy / assignment. | |
ImageMask (unsigned width, unsigned height, unsigned char *data=0) | |
Takes ownership of the given mask data. If no data is given, the mask is filled with VOID. | |
ImageMask (unsigned width, unsigned height, unsigned char *data, char maskedMin, char maskedMax) | |
Creates a mask, values between maskMin and maskMax are considered as void (0) | |
ImageMask (puma2::GrayLevelImage8 &image, unsigned char minVal, unsigned char maxVal=255) | |
Creates a mask by masking pixels above the given value. | |
ImageMask (puma2::ColorImageUV8 &image, unsigned char minValU, unsigned char minValV) | |
ImageMask (puma2::GrayLevelImage8 &foregroundY, puma2::ColorImageUV8 &foregroundUv, puma2::GrayLevelImage8 &backgroundY, puma2::ColorImageUV8 &backgroundUv, int threshold) | |
Creates a difference mask. | |
ImageMask & | operator= (const ImageMask &other) |
ImageMask * | subMask (Box2D< int > area) |
~ImageMask () | |
The destructor. | |
Private Types | |
enum | maskOperationT { dilateOperation, erodeOperation } |
Private Member Functions | |
void | createCircularKernel (float radius, int *&maskOffset, int &halfMaskSize, unsigned &maskLength) |
creates a circular filter kernel and stores the offsets off all occupied pixels in an array | |
void | maskOperation (maskOperationT operation, float radius) |
Private Attributes | |
unsigned char * | m_Data |
unsigned | m_Height |
unsigned | m_Width |
Binary image mask implementation.
Definition at line 26 of file ImageMask.h.
enum ImageMask::maskOperationT [private] |
Definition at line 112 of file ImageMask.h.
Definition at line 30 of file ImageMask.h.
The constructor.
ImageMask::ImageMask | ( | const ImageMask & | other | ) |
Copy / assignment.
ImageMask::ImageMask | ( | unsigned | width, |
unsigned | height, | ||
unsigned char * | data = 0 |
||
) |
Takes ownership of the given mask data. If no data is given, the mask is filled with VOID.
ImageMask::ImageMask | ( | unsigned | width, |
unsigned | height, | ||
unsigned char * | data, | ||
char | maskedMin, | ||
char | maskedMax | ||
) |
Creates a mask, values between maskMin and maskMax are considered as void (0)
ImageMask::ImageMask | ( | puma2::GrayLevelImage8 & | image, |
unsigned char | minVal, | ||
unsigned char | maxVal = 255 |
||
) |
Creates a mask by masking pixels above the given value.
ImageMask::ImageMask | ( | puma2::ColorImageUV8 & | image, |
unsigned char | minValU, | ||
unsigned char | minValV | ||
) |
ImageMask::ImageMask | ( | puma2::GrayLevelImage8 & | foregroundY, |
puma2::ColorImageUV8 & | foregroundUv, | ||
puma2::GrayLevelImage8 & | backgroundY, | ||
puma2::ColorImageUV8 & | backgroundUv, | ||
int | threshold | ||
) |
Creates a difference mask.
The destructor.
void ImageMask::apply | ( | puma2::GrayLevelImage8 & | image, |
unsigned char | fillValue = 0 |
||
) |
void ImageMask::apply | ( | puma2::ColorImageUV8 & | image, |
unsigned char | fillU = 0 , |
||
unsigned char | fillV = 0 |
||
) |
void ImageMask::apply | ( | puma2::ColorImageRGB8 & | image, |
unsigned char | fillR, | ||
unsigned char | fillG, | ||
unsigned char | fillB | ||
) |
void ImageMask::createCircularKernel | ( | float | radius, |
int *& | maskOffset, | ||
int & | halfMaskSize, | ||
unsigned & | maskLength | ||
) | [private] |
creates a circular filter kernel and stores the offsets off all occupied pixels in an array
void ImageMask::dilate | ( | float | radius = 1.0 | ) |
Generates a circle with the given radius around each masked pixel.
void ImageMask::erode | ( | float | radius = 1.0 | ) |
Generates a circle with the given radius around each unmasked pixel.
void ImageMask::expand | ( | const ImageMask & | other | ) |
Bitwise OR operation. Enlarges the unmasked areas by those of the other histogram.
void ImageMask::fill | ( | unsigned char | value | ) |
Overwrite whole mask.
void ImageMask::findBorders | ( | ) |
Leave only borders between masked and unmasked areas as VOID.
bool ImageMask::findValue | ( | int | x, |
int | y, | ||
unsigned char | value, | ||
float | radius | ||
) |
Box2D<int> ImageMask::getBoundingBox | ( | ) |
unsigned char* ImageMask::getData | ( | ) | [inline] |
Definition at line 105 of file ImageMask.h.
Point2D ImageMask::getGravCenter | ( | ) |
unsigned ImageMask::getHeight | ( | ) | [inline] |
Definition at line 108 of file ImageMask.h.
unsigned ImageMask::getWidth | ( | ) | [inline] |
Definition at line 107 of file ImageMask.h.
void ImageMask::grayOut | ( | puma2::ColorImageRGB8 & | colorImage, |
puma2::GrayLevelImage8 & | graimageY | ||
) |
replace masked areas by gray values
void ImageMask::grayOut | ( | puma2::ColorImageRGB8 & | colorImage | ) |
void ImageMask::maskOperation | ( | maskOperationT | operation, |
float | radius | ||
) | [private] |
ImageMask* ImageMask::subMask | ( | Box2D< int > | area | ) |
unsigned char* ImageMask::m_Data [private] |
Definition at line 122 of file ImageMask.h.
unsigned ImageMask::m_Height [private] |
Definition at line 125 of file ImageMask.h.
unsigned ImageMask::m_Width [private] |
Definition at line 124 of file ImageMask.h.