Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

CStructuringElement Class Reference

Basic morphological operation on images with structuring elements. More...

#include <StructuringElement.h>

Inheritance diagram for CStructuringElement

Inheritance graph

[legend]
Collaboration diagram for CStructuringElement:

Collaboration graph

[legend]
List of all members.

Public Methods

 CStructuringElement ()
 CStructuringElement (int *pix, int nb, int *extrem, int nbe)
 Create a convex structuring element.

 CStructuringElement (double alpha)
 Create a line structuring element with angle alpha (in degree) center in its middle.

 CStructuringElement (CImageGrey *img)
 Create a generic structuring element from image *img.

virtual ~CStructuringElement ()
 Destructor, for the cleaning-up.

EltStructT TypeGet () const
 Return the type of the element (mostly debuging purpose).

int WidthGet () const
 Return the width of the element.

int HeightGet () const
 Return the height of the element.

int BaricenterXGet () const
 Return the x-baricenter.

int BaricenterYGet () const
 Return the y-baricenter.

void Translate (int x, int y)
 Translate the element. More...

CImageGreycreateImage (PIXEL color=1)
 Create an image from the structuring element.

CImageGreydilate (CImageGrey *img, int size)
 Generic dilation.

CImageGreyerode (CImageGrey *img, int size)
 Generic erosion.

CImageGreytest (int x1, int y1, int x2, int y2)
 Draw test.


Protected Methods

void updateMax (ListPixelT *remove, ListPixelT *add, LPPIXEL start)
 update the maximum for the dilation.

void updateMin (ListPixelT *remove, ListPixelT *add, LPPIXEL start)
 update the minimum for the erosion.

void init (CImageGrey *image)
 first thing to do before a generic dilation or erosion.

int offset (CPixel pix)
 return the offset computed in init().

CImageGreydilate1Gen (CImageGrey *img)
 Dilate the image *im with the structuring element.

CImageGreyerode1Gen (CImageGrey *img)
 Erode the image *im with the structuring element.

CImageGreydilateGen (CImageGrey* img, int size)
 Dilation with convex element. More...

CImageGreyerodeGen (CImageGrey* img, int size)
 Dilation with convex element. More...

CImageGreydilate1Conv (CImageGrey* img, CImageGrey* imgOut, ListPixelT *lpix, int size)
 Dilation size 1 with convex element.

CImageGreyerode1Conv (CImageGrey* img, CImageGrey* imgOut, ListPixelT *lpix, int size)
 Erosion size 1 with convex element.

CImageGreydilateConv (CImageGrey* img, int size)
 Dilation with convex element. More...

CImageGreyerodeConv (CImageGrey* img, int size)
 Erosion with convex element. More...

CImageGreydilateLinear (CImageGrey *img, int size)
 Dilation with linear element. More...

CImageGreyerodeLinear (CImageGrey *img, int size)
 Erosion with linear element. More...

void BresenhamOffset (int x1, int y1, int x2, int y2, int *pb, int *rlc, int nx)
 Compute the offset of a Bresenham line, stored in a run-length code. More...


Protected Attributes

PIXEL histo [512]
PIXEL maximum
PIXEL minimum
int LineLength
int centerx
int centery
int Width
int Height
int top
int left
int bottom
int right
int baricenterx
int baricentery
double alpha
 angle for linear element.

ListPixelT allpixels
 All the pixels of the structuring element.

ListPixelT removeBottom
 Lists which are used in Talbot algorithm.

ListPixelT removeLeft
ListPixelT removeRight
ListPixelT addBottom
ListPixelT addLeft
ListPixelT addRight
ListPixelT extremSet
 List of extrem pixel to use with convex element.

EltStructT type
 Type of the structuring element.


Private Methods

void computeMaxG (LPPIXEL f, int *p, PIXEL *g, int k, int nx)
void computeMaxH (LPPIXEL f, int *p, PIXEL *h, int k, int nx)
void computeMaxGH (PIXEL *gh, PIXEL *g,PIXEL *h,int k,int nx)
void computeMaxH2 (LPPIXEL f, int *p, PIXEL *h2, int k, int nx)
void computeMaxR (LPPIXEL f, int *p, PIXEL *g, PIXEL *h, PIXEL *gh, PIXEL *h2, int k, int nx)
void computeMinG (LPPIXEL f, int *p, PIXEL *g, int k, int nx)
void computeMinH (LPPIXEL f, int *p, PIXEL *h, int k, int nx)
void computeMinGH (PIXEL *gh, PIXEL *g,PIXEL *h,int k,int nx)
void computeMinH2 (LPPIXEL f, int *p, PIXEL *h2, int k, int nx)
void computeMinR (LPPIXEL f, int *p, PIXEL *g, PIXEL *h, PIXEL *gh, PIXEL *h2, int k, int nx)

Detailed Description

Basic morphological operation on images with structuring elements.

Author(s):
Laurent Najman
Date:
8/8/01
Keywords:
Image Processing
Version:
Id: StructuringElement.h,v 1.1 2001/09/04 19:54:02 laurentnajman Exp
Content:
This class is for basic morphological operators (dilations and erosions) with generic structuring elements. It implements the best know-to-date algorithms for specific elements.

Note:
As it is now, only in 8 connectivity... To be improved

Warning:
This paragraphe has to be enhanced !!!


Member Function Documentation

void CStructuringElement::BresenhamOffset ( int x1,
int y1,
int x2,
int y2,
int * pb,
int * rlc,
int nx ) [protected]
 

Compute the offset of a Bresenham line, stored in a run-length code.

Bresenham algorithm to draw a line

Parameters:
x1  
y1   the first point of the line
x2  
y2   the last point
pb   an array of int of size nx that will contain the offset
rlc   an array of int of size nx that will contain the run-length code
nx   the "size" of the line/the size of pb and rlc

Note:
pb and rlc should have been allocated before. LineLength should have been set before.

void CStructuringElement::Translate ( int x,
int y )
 

Translate the element.

Not always implemented everywhere (yet)!!!

CImageGrey * CStructuringElement::dilateConv ( CImageGrey * img,
int size ) [protected]
 

Dilation with convex element.

Dilation with a convex structuring Element. Implements logarithmic decomposition in Boomgaard thesis.

CImageGrey * CStructuringElement::dilateGen ( CImageGrey * img,
int size ) [protected]
 

Dilation with convex element.

Dilation with a generic structuring element Implements Talbot's thesis

CImageGrey * CStructuringElement::dilateLinear ( CImageGrey * img,
int size ) [protected]
 

Dilation with linear element.

Dilatation with a linear structuring element - 3 max per pixels. Implements "Recursive Implementation of Erosions and Dilations Along Discrete Lines at Arbitrary Angles" P. Soille, E.J. Breen, and R. Jones IEEE PAMI Vol. 18, No. 5, May 1996, pp. 562-567

CImageGrey * CStructuringElement::erodeConv ( CImageGrey * img,
int size ) [protected]
 

Erosion with convex element.

Erosion with a convex structuring Element. Implements logarithmic decomposition in Boomgaard thesis.

CImageGrey * CStructuringElement::erodeGen ( CImageGrey * img,
int size ) [protected]
 

Dilation with convex element.

Dilation with a generic structuring element Implements Talbot's thesis

CImageGrey * CStructuringElement::erodeLinear ( CImageGrey * img,
int size ) [protected]
 

Erosion with linear element.

Erosion with a linear structuring element - 3 min per pixels. Implements "Recursive Implementation of Erosions and Dilations Along Discrete Lines at Arbitrary Angles". P. Soille, E.J. Breen, and R. Jones. IEEE PAMI Vol. 18, No. 5, May 1996, pp. 562-567.


The documentation for this class was generated from the following files:
Generated at Sun May 12 19:04:30 2002 for OpenMorpho by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000