Now, I want to write about the functions of OpenCV* for manipulate the structural element and apply the operations of erosion and dilatation.
The following function creates the structural element:
IplConvKernel* cvCreateStructuringElementEx( int cols,
int rows,
int anchor_x,
int anchor_y,
int shape,
int* values=NULL );
CV_SHAPE_RECT
, square element;CV_SHAPE_CROSS
, element in disc;CV_SHAPE_ELLIPSE
, elliptic element;CV_SHAPE_CUSTOM
, element defined by user. In this case, the parametervalues
specifies the mask, delimiting the vicinity of the pixel in analysis.
CV_SHAPE_CUSTOM
.Function of erosion:
void cvErode( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );
Function of dilatation:
void cvDilate( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );
- src: Input image;
- dst: Output image;
- element: Structural element. If it's
NULL
, the structural element is a square 3x3; - iterations: Number of times for apply the operation.
More informations here.
----------------------
* OpenCV (Open Computational Vision) is a API for development using Computational Vision. It's a very powerful set of functions for capture, processing and showing of images and videos.
Nenhum comentário:
Postar um comentário