MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_ID KernelBufId | //in |
This function performs a general convolution operation on the source buffer using the specified filter, storing results in the specified destination buffer. This function supports two types of filters: Finite Impulse Response (FIR) filters and Infinite Impulse Response (IIR) filters. FIR filters operate on a finite neighborhood, while IIR filters take in account all values in an image. You can specify either a predefined or a custom FIR or IIR filter.
This function provides a number of predefined FIR. For predefined FIR filters, the overscan is set to transparent overscan pixel values, saturation is enabled for results, and the kernel's default center pixel is set as the top-left pixel of the central elements in a neighborhood. When using predefined FIR filters, you cannot change operation control settings except for the overscan.
This function provides two types of predefined IIR filters. Predefined IIR filters, M_SHEN_FILTER() and M_DERICHE_FILTER(), use a recursive implementation, and the overscan pixel values are ignored. The normalization factor is automatically set so that it is possible to use the full data range of the destination buffer without overflows, and the result is given in the number of bits of the destination buffer. When using predefined IIR filters, you cannot change operation control settings except for the smoothness value. To use an IIR filter in kernel mode, you must use a custom IIR filter.
This function also accepts a custom FIR or IIR filter with which you can customize operation control settings. To define a custom filter, you must allocate a kernel buffer using MbufAlloc1d() or MbufAlloc2d(). Note that the kernel buffer size can be constrained by the available resources.
To define a custom FIR filter, you must load the kernel buffer with values, using MbufPut(). To define a custom IIR filter, use MbufControlNeighborhood() with M_FILTER_TYPE, M_FILTER_OPERATION, and M_FILTER_MODE; the kernel values are automatically calculated based on these settings.
When using custom FIR or IIR filters, you can change default operation control settings using MbufControlNeighborhood().
For predefined and custom FIR filters, when using 32-bit integer buffers and saturation is disabled, the accumulator buffer is a 32-bit integer buffer (MIL_INT); whereas, when saturation is enabled, the accumulator buffer is a 64-bit floating-point internal buffer (double). For IIR filters, when using 32-bit floating-point source or destination images, operations are performed using floating-point precision; whereas, for other types of images, operations are performed using fixed-point precision.
For custom FIR filters, this function will internally separate a large kernel into two 1-dimensional kernels, if possible, to increase the speed of the convolution operation. For more information on separating kernels, see the Finite Impulse Response (FIR) filters subsection of the Custom spatial filters section of Chapter 4: Advanced image processing.
Custom FIR filters containing a unique value (such as uniform kernels or average kernels) are dealt with by a specifically targeted algorithmic optimization.
If the source and destination are multi-band buffers, the same filter is applied to every band of the source buffer.
Specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.
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.
Note that for an FIR filter or custom IIR filter which uses a kernel mode implementation, the size of the image buffer must be greater or equal to the size of the kernel.
The source image buffer must be either unsigned M_MONO8, M_MONO16 or M_BGR32 packed.
Specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.
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.
Note that for an FIR filter or custom IIR filter which uses a kernel mode implementation, the size of the image buffer must be greater or equal to the size of the kernel.
The source image buffer must be either unsigned M_MONO8, M_MONO16 or M_BGR32 packed.
Specifies the filter to use. Set this parameter to a predefined filter or the identifier of the kernel buffer which defines the custom filter.
To specify a custom FIR or IIR filter, set this parameter to the following:
For specifying a custom FIR or IIR
filter
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
Kernel Buffer ID |
Specifies the identifier of the kernel buffer, allocated using MbufAlloc...() with M_KERNEL. (more details...) |
To specify a predefined FIR filter, set this parameter to one of the following:
For specifying a predefined FIR
filter
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EDGE_DETECT_PREWITT_FAST + |
Computes the gradient of the image using the following operation, which is based on a Prewitt filter. |
||||||||||||||||||||||||||||||||||||||
M_EDGE_DETECT_SOBEL_FAST + |
Computes the gradient of the image using the following operation, which is based on a Sobel filter. |
||||||||||||||||||||||||||||||||||||||
M_HORIZONTAL_EDGE_PREWITT + |
Computes the absolute value of the horizontal derivative of the image using the horizontal Prewitt edge detection filter. |
||||||||||||||||||||||||||||||||||||||
M_HORIZONTAL_EDGE_SOBEL + |
Computes the absolute value of the horizontal derivative of the image using the horizontal Sobel edge detection filter. |
||||||||||||||||||||||||||||||||||||||
M_LAPLACIAN_4 + |
Computes the Laplacian values of the image using the following 4-connected Laplacian edge detection filter. |
||||||||||||||||||||||||||||||||||||||
M_LAPLACIAN_8 + |
Computes the Laplacian values of the image using the following 8-connected Laplacian edge detection filter. |
||||||||||||||||||||||||||||||||||||||
M_SHARPEN_4 + |
Performs a sharpening operation on the image using the following 4-connected Laplacian filter combined with the original image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHARPEN_8 + |
Performs a sharpening operation on the image using the following 8-connected Laplacian filter combined with the original image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SMOOTH + |
Performs a smoothing operation on the image using the following smoothing filter. |
||||||||||||||||||||||||||||||||||||||
M_VERTICAL_EDGE_PREWITT + |
Computes the absolute value of the vertical derivative of the image using the vertical Prewitt edge detection filter. |
||||||||||||||||||||||||||||||||||||||
M_VERTICAL_EDGE_SOBEL + |
Computes the absolute value of the vertical derivative of the image using the vertical Sobel edge detection filter. |
You can add one of the following values to the above-mentioned values to specify how to determine the value of a destination pixel when its associated point falls outside the source buffer.
For specifying how to determine the value
of a destination pixel when its associated point falls outside the
source buffer
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_DISABLE |
Disables overscanning temporarily. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_FAST |
Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. (more details...) |
To specify a predefined IIR filter, set this parameter to one of the following:
For specifying a predefined IIR
filter
|
|||||||||||||||||||||||||||||||||||||||
Value |
Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
Specifies a Canny-Deriche Infinite Support Exponential filter. (more details...) |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
This parameter specifies the type of operation to perform. You can set this parameter to one of the following: |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
This parameter specifies the degree of smoothness (strength of the denoising) applied by the convolution operation. You can set this parameter to one of the following: |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
Specifies a Shen-Castan Infinite Support Exponential filter. (more details...) |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
This parameter specifies the type of operation to perform. You can set this parameter to one of the following: |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
This parameter specifies the degree of smoothness (strength of the denoising) applied by the convolution operation. You can set this parameter to one of the following: |
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||||
|
† | a | b | c | 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. |