This interface provide functionalities of morphology operations. More...
Public Member Functions | |
void | BottomHat (ILImage *img, ILImage *result) |
void | Close (ILImage *img, ILImage *result) |
void | Dilate (ILImage *img, ILImage *result) |
void | Erode (ILImage *img, ILImage *result) |
void | Gradient (ILImage *img, ILImage *result) |
void | Open (ILImage *img, ILImage *result) |
void | SetMorphShape (LPVMorphShape shape, int kWidth, int kHeight) |
void | TopBottomHat (ILImage *img, ILImage *result) |
void | TopHat (ILImage *img, ILImage *result) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
Properties | |
int | MorphHeight [get] |
The height of the structuring element size. More... | |
LPVMorphShape | MorphShape [get] |
The shape of the structuring element. More... | |
int | MorphWidth [get] |
The width of the structuring element size. More... | |
This interface provide functionalities of morphology operations.
Morphology is a set of operations based on the predefined structuring elements. For each pixel, the operator compares its value with its neighbors, then assign the comparison result to output image. Structuring elements define the region of neighbors and specifically which ones should be compared. Dilate and erode is the basic morphology operation, all others are combination of them. Dilate takes the maximum as result, while erode does the exactly opposite.
To use this interface, you should create a LImageMorph object.
Erase small elements and details from given images. Bottom-hat operation is the equivalent of subtracting the input image from the result of performing a morphological closing operation on the input image.
\[ I' = close( I, element ) - I \]
[in] | img | The input image |
[out] | result | Return result image |
Close operation, reduces or completely removes dark areas of the image. Close operation is a dilation followed by an erosion.
\[ I' = erode(dilate( I, element ) \]
[in] | img | The input image |
[out] | result | Return result image |
Dilate operation. The value of the output pixel is the maximum value of all the pixels that fall within the structuring element's size and shape.
\[ I'(x,y) = \max _{(i,j): , \texttt{element} (i,j) \ne0 } I (x+i,y+j) \]
[in] | img | The input image |
[out] | result | Return result image |
Erode operation. The value of the output pixel is the minimum value of all the pixels that fall within the structuring element's size and shape.
\[ I'(x,y) = \min _{(i,j): , \texttt{element} (i,j) \ne0 } I (x+i,y+j) \]
[in] | img | The input image |
[out] | result | Return result image |
Gradient operation, output a morphological gradient image. Gradient operation is the equivalent of subtracting and erosion from a dilation.
\[ I' = dilate( I, element ) - erode( I, element ) \]
[in] | img | The input image |
[out] | result | Return result image |
Open operation, slightly decreased overall brightness, removing small amounts of bright pixels and enhancing the remaining bright features. Open operation is an erosion followed by a dilation.
\[ I' = dilate(erode( I, element ) \]
[in] | img | The input image |
[out] | result | Return result image |
void SetMorphShape | ( | LPVMorphShape | shape, |
int | kWidth, | ||
int | kHeight | ||
) |
Set the structuring element used in morphology operations of specified shape and size.
[in] | shape | The structuring element's shape. |
[in] | kWidth | The width of the element size, should be an odd number, say, 3, 5, 7, etc. |
[in] | kHeight | The height of the element size, should be an odd number, say, 3, 5, 7, etc. |
Each output pixel represents the maximum value of TopHat or BottomHat.
[in] | img | The input image |
[out] | result | Return result image |
Extracts small elements and details from given images. Top-hat operation is the equivalent of subtracting the result of performing a morphological opening operation on the input image from the input image itself.
\[ I' = I - open( I, element ) \]
[in] | img | The input image |
[out] | result | Return result image |
|
get |
The height of the structuring element size.
|
get |
The shape of the structuring element.
|
get |
The width of the structuring element size.