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.
The source image buffer must be unsigned monochrome 8- or 16-bit.
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.
The destination image buffer must be unsigned monochrome 8- or 16-bit.
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 one of the following two predefined structuring elements. Note that these predefined structuring elements are not available for any other type of operation.
For area open or area close
operations
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_3X3_CROSS |
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL structuring element buffer identifier |
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 | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | |||||||||||||||||||
M_AREA_OPEN |
Specifies an area open operation. |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | |||||||||||||||||||
M_BOTTOM_HAT |
Specifies a bottom-hat operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_CLOSE |
Specifies a close operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_DILATE |
Specifies a dilation operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_ERODE |
Specifies an erosion operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_HIT_OR_MISS |
Specifies a hit or miss transformation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Supports only M_GRAYSCALE mode. |
† | d | |||||||||||||||||||||||||||||||||||||
M_LEVEL |
Specifies a window leveling operation on a pixel neighborhood basis. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_MATCH |
Specifies a matching operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Supports only M_GRAYSCALE mode. |
† | d | |||||||||||||||||||||||||||||||||||||
M_OPEN |
Specifies an open operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_THICK |
Specifies a thickening operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Supports only M_GRAYSCALE mode. |
† | d | |||||||||||||||||||||||||||||||||||||
M_THIN |
Specifies a thinning operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Supports only M_GRAYSCALE mode. |
† | d | |||||||||||||||||||||||||||||||||||||
M_TOP_HAT |
Specifies a top-hat operation. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s |
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
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
M_BINARY |
Treats non-zero pixels as ones (1) during processing. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Both the source and destination buffers must be packed binary. |
† | d | |||||||||||||||||||||||||||||||||||||
M_GRAYSCALE |
Uses the source image's gray values for processing. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |