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

Binary image mask implementation. More...

#include <ImageMask.h>

List of all members.

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.
ImageMaskoperator= (const ImageMask &other)
ImageMasksubMask (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

Detailed Description

Binary image mask implementation.

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

Definition at line 26 of file ImageMask.h.


Member Enumeration Documentation

enum ImageMask::maskOperationT [private]
Enumerator:
dilateOperation 
erodeOperation 

Definition at line 112 of file ImageMask.h.

Enumerator:
MASKED 
VISIBLE 

Definition at line 30 of file ImageMask.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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

Leave only borders between masked and unmasked areas as VOID.

bool ImageMask::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* ImageMask::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 105 of file ImageMask.h.

Returns:
center of gravity of all unmasked pixels
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::operator= ( const ImageMask other)
ImageMask* ImageMask::subMask ( Box2D< int >  area)
Returns:
new ImageMask covering only the given subarea

Member Data Documentation

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.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43