MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_ID StructElemBufId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT NbIterationOrArea, | //in |
MIL_INT64 ProcMode | //in |
This function performs one of several morphological transformations on the specified source image, using a user-defined or predefined structuring element.
If the source and destination are multi-band buffers, the same structuring element is applied to every band of the source buffer.
Specifies the identifier of the source image buffer.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Specifies the identifier of the destination image buffer.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Specifies the structuring element to use. For all operations except area opening and area closing operations, you must specify the identifier of the structuring element buffer which defines the required structuring element.
For M_AREA_OPEN or M_AREA_CLOSE operations, you must specify either an M_3X3_CROSS or an M_3X3_RECT structuring element. Note that these predefined structuring elements are not available for any other type of operation.
For specifying the structuring element
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_3X3_CROSS |
Specifies a cross (+) structuring element whose neighborhood size is 3x3 pixels. In this case, there are 5 valid neighborhood pixels; the function ignores the pixels located at the four corners of the neighborhood. (summarize)Specifies a cross (+) structuring element whose neighborhood size is 3x3 pixels. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_3X3_RECT |
Specifies a structuring element whose neighborhood size is 3x3 pixels. In this case, there are 9 valid neighborhood pixels. (summarize)Specifies a structuring element whose neighborhood size is 3x3 pixels. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL structuring element buffer identifier |
Specifies a custom structuring element to use, allocated, using MbufAlloc...() with an M_STRUCT_ELEMENT attribute. This structuring element is to be loaded with structuring-element values, using MbufPut(). These values can be set to M_DONT_CARE to specify that the corresponding source image pixels should not be taken into account during the operation. You can set the overscan type and the center of the structuring element, using MbufControl(). For window leveling operations, the structuring element buffer must contain only 0 or M_DONT_CARE values. The center structuring element value must not be a M_DONT_CARE value. (summarize)Specifies a custom structuring element to use, allocated, using MbufAlloc...() with an M_STRUCT_ELEMENT attribute. (more details...) |
Specifies the operation to perform. Supported operations are given in the table below.
For specifying the type of operation to
perform
|
|||||||||||||||||||||||||||||||||||||||
Value | Description |
MIL system-specific tooltip (‡) |
|||||||||||||||||||||||||||||||||||||
M_AREA_CLOSE |
Specifies an area close operation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_AREA_OPEN |
Specifies an area open operation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_BOTTOM_HAT |
Specifies a bottom-hat operation. This operation is the equivalent to a close operation (M_CLOSE), followed by a subtraction of the source image from the results. (summarize)Specifies a bottom-hat operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_CLOSE |
Specifies a close operation. This operation is equivalent to a dilation followed by an erosion. (summarize)Specifies a close operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_DILATE |
Specifies a dilation operation. When performing a binary dilation, if any of the structuring element values match the corresponding neighborhood values, the center pixel is set to the maximum value of the buffer (for example, 0xff for an 8-bit buffer); otherwise, it remains unchanged. In effect, binary dilation adds layers to the objects. When performing a grayscale dilation, this operation adds each structuring element value to the corresponding pixel value in the neighborhood, and then replaces the center pixel of the neighborhood with the maximum value from the resulting neighborhood values. The pixels that correspond to M_DONT_CARE in the structuring element are ignored. (summarize)Specifies a dilation operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_ERODE |
Specifies an erosion operation. When performing a binary erosion, if the structuring element does not match the corresponding neighborhood values exactly, the center pixel is set to zero; otherwise, it remains unchanged. In effect, binary erosion peels off layers of objects. When performing a grayscale erosion, this operation subtracts each structuring element value from the corresponding pixel value in the neighborhood, and then replaces the center pixel of the neighborhood with the minimum value from the resulting neighborhood values. The pixels that correspond to M_DONT_CARE in the structuring element are ignored. (summarize)Specifies an erosion operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_HIT_OR_MISS |
Specifies a hit or miss transformation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_LEVEL |
Specifies a window leveling operation on a pixel neighborhood basis. This operation finds the minimum and maximum pixel values in a neighborhood, and then creates a linear mapping such that these map to the minimum and maximum possible values of the image buffer. It then replaces the center pixel of the neighborhood with its corresponding value in the mapping. If the destination image buffer is a floating-point buffer, each pixel will be set to a value between 0 and 1. The pixels that correspond to M_DONT_CARE in the structuring element are ignored. (summarize)Specifies a window leveling operation on a pixel neighborhood basis. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_MATCH |
Specifies a matching operation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_OPEN |
Specifies an open operation. This operation is equivalent to an erosion, followed by a dilation. (summarize)Specifies an open operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_THICK |
Specifies a thickening operation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_THIN |
Specifies a thinning operation. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_TOP_HAT |
Specifies a top-hat operation. This operation is the equivalent to an open operation (M_OPEN) followed by a subtraction of the results from the source image. (summarize)Specifies a top-hat operation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa |
Specifies a value that is dependent on the morphological operation chosen.
For an area opening or area closing operation, this parameter specifies the minimum area, in pixels. For an M_HIT_OR_MISS, M_MATCH, or M_LEVEL operation, this parameter must be set to 1. For the other morphological operations, this parameter specifies the number of times to iterate the operation.
If the number of iterations is set to 0, and ProcMode is set to M_BINARY, the source image is binarized and the result is copied into the destination image buffer. If the number of iterations is set to 0, and ProcMode is set to M_GRAYSCALE, the source image is copied into the destination image buffer.
Specifies the processing mode to use. This parameter can be set to one of the following:
For specifying the processing mode
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_BINARY |
Treats non-zero pixels as ones (1) during processing. |
||||||||||||||||||||||||||||||||||||||
M_GRAYSCALE |
Uses the source image's gray values for processing. The resulting pixels will be grayscale. You must use this processing mode to perform an M_TOP_HAT, M_BOTTOM_HAT, or M_LEVEL operation. (summarize)Uses the source image's gray values for processing. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |