Binary image mask implementation. More...
#include <ImageMaskCV.h>
Public Types | |
enum | MaskValues { MASKED = 0, VISIBLE = 255 } |
Public Member Functions | |
void | apply (cv::Mat &image, unsigned char fillValue=0) |
void | apply (cv::Mat &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 ImageMaskCV &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 (cv::Mat &colorImage, cv::Mat &graimageY) |
replace masked areas by gray values | |
void | grayOut (cv::Mat &colorImage) |
ImageMaskCV () | |
The constructor. | |
ImageMaskCV (const ImageMaskCV &other) | |
Copy / assignment. | |
ImageMaskCV (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. | |
ImageMaskCV (unsigned width, unsigned height, unsigned char *data, char maskedMin, char maskedMax) | |
Creates a mask, values between maskMin and maskMax are considered as void (0) | |
ImageMaskCV (cv::Mat &image, unsigned char minVal, unsigned char maxVal=255) | |
Creates a mask by masking pixels above the given value. | |
ImageMaskCV (cv::Mat &foregroundY, cv::Mat &foregroundUv, cv::Mat &backgroundY, cv::Mat &backgroundUv, int threshold) | |
Creates a difference mask. | |
ImageMaskCV & | operator= (const ImageMaskCV &other) |
ImageMaskCV * | subMask (Box2D< int > area) |
~ImageMaskCV () | |
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 ImageMaskCV.h.
enum ImageMaskCV::maskOperationT [private] |
Definition at line 110 of file ImageMaskCV.h.
Definition at line 30 of file ImageMaskCV.h.
The constructor.
ImageMaskCV::ImageMaskCV | ( | const ImageMaskCV & | other | ) |
Copy / assignment.
ImageMaskCV::ImageMaskCV | ( | 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.
ImageMaskCV::ImageMaskCV | ( | unsigned | width, |
unsigned | height, | ||
unsigned char * | data, | ||
char | maskedMin, | ||
char | maskedMax | ||
) |
Creates a mask, values between maskMin and maskMax are considered as void (0)
ImageMaskCV::ImageMaskCV | ( | cv::Mat & | image, |
unsigned char | minVal, | ||
unsigned char | maxVal = 255 |
||
) |
Creates a mask by masking pixels above the given value.
ImageMaskCV::ImageMaskCV | ( | cv::Mat & | foregroundY, |
cv::Mat & | foregroundUv, | ||
cv::Mat & | backgroundY, | ||
cv::Mat & | backgroundUv, | ||
int | threshold | ||
) |
Creates a difference mask.
The destructor.
void ImageMaskCV::apply | ( | cv::Mat & | image, |
unsigned char | fillValue = 0 |
||
) |
void ImageMaskCV::apply | ( | cv::Mat & | image, |
unsigned char | fillR, | ||
unsigned char | fillG, | ||
unsigned char | fillB | ||
) |
void ImageMaskCV::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 ImageMaskCV::dilate | ( | float | radius = 1.0 | ) |
Generates a circle with the given radius around each masked pixel.
void ImageMaskCV::erode | ( | float | radius = 1.0 | ) |
Generates a circle with the given radius around each unmasked pixel.
void ImageMaskCV::expand | ( | const ImageMaskCV & | other | ) |
Bitwise OR operation. Enlarges the unmasked areas by those of the other histogram.
void ImageMaskCV::fill | ( | unsigned char | value | ) |
Overwrite whole mask.
void ImageMaskCV::findBorders | ( | ) |
Leave only borders between masked and unmasked areas as VOID.
bool ImageMaskCV::findValue | ( | int | x, |
int | y, | ||
unsigned char | value, | ||
float | radius | ||
) |
Box2D<int> ImageMaskCV::getBoundingBox | ( | ) |
unsigned char* ImageMaskCV::getData | ( | ) | [inline] |
Definition at line 103 of file ImageMaskCV.h.
Point2D ImageMaskCV::getGravCenter | ( | ) |
unsigned ImageMaskCV::getHeight | ( | ) | [inline] |
Definition at line 106 of file ImageMaskCV.h.
unsigned ImageMaskCV::getWidth | ( | ) | [inline] |
Definition at line 105 of file ImageMaskCV.h.
void ImageMaskCV::grayOut | ( | cv::Mat & | colorImage, |
cv::Mat & | graimageY | ||
) |
replace masked areas by gray values
void ImageMaskCV::grayOut | ( | cv::Mat & | colorImage | ) |
void ImageMaskCV::maskOperation | ( | maskOperationT | operation, |
float | radius | ||
) | [private] |
ImageMaskCV& ImageMaskCV::operator= | ( | const ImageMaskCV & | other | ) |
ImageMaskCV* ImageMaskCV::subMask | ( | Box2D< int > | area | ) |
unsigned char* ImageMaskCV::m_Data [private] |
Definition at line 120 of file ImageMaskCV.h.
unsigned ImageMaskCV::m_Height [private] |
Definition at line 123 of file ImageMaskCV.h.
unsigned ImageMaskCV::m_Width [private] |
Definition at line 122 of file ImageMaskCV.h.