Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ImageMaskCV Class Reference

Binary image mask implementation. More...

#include <ImageMaskCV.h>

List of all members.

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.
ImageMaskCVoperator= (const ImageMaskCV &other)
ImageMaskCVsubMask (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

Detailed Description

Binary image mask implementation.

Author:
David Gossow (RX), Viktor Seib (R20)
Note:
Each pixel of the binary mask is represented a byte (0:masked, 255:unmasked)

Definition at line 26 of file ImageMaskCV.h.


Member Enumeration Documentation

Enumerator:
dilateOperation 
erodeOperation 

Definition at line 110 of file ImageMaskCV.h.

Enumerator:
MASKED 
VISIBLE 

Definition at line 30 of file ImageMaskCV.h.


Constructor & Destructor Documentation

The constructor.

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.


Member Function Documentation

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.

Note:
Affects only areas that can fully be included within the circular mask (no border treatment)
void ImageMaskCV::erode ( float  radius = 1.0)

Generates a circle with the given radius around each unmasked pixel.

Note:
Affects only areas that can fully be included within the circular mask (no border treatment)
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.

Leave only borders between masked and unmasked areas as VOID.

bool ImageMaskCV::findValue ( int  x,
int  y,
unsigned char  value,
float  radius 
)
Returns:
true if the given value could be found within the given radius around (x,y)
unsigned char* ImageMaskCV::getData ( ) [inline]
Returns:
Pointer to the raw mask data
Warning:
Unsafe access to internal data. Avoid use if not neccesary.
This pointer gets invalid when applying filters etc.

Definition at line 103 of file ImageMaskCV.h.

Returns:
center of gravity of all unmasked pixels
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)
Returns:
new ImageMaskCV covering only the given subarea

Member Data Documentation

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.


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


robbie_architecture
Author(s): Viktor Seib
autogenerated on Mon Oct 6 2014 02:53:09