MIL_ID Drv1ImageBufIdOrFilterContextImId, | //in |
MIL_ID SrcOrDrv2ImageBufId, | //in |
MIL_ID SrcOrDrv3ImageBufId, | //in |
MIL_ID Drv4ImageBufId, | //in |
MIL_ID Drv5ImageBufId, | //in |
MIL_ID Dst1ImageBufId, | //in |
MIL_ID Dst2ImageBufId, | //in |
MIL_DOUBLE Param, | //in |
MIL_INT64 Operation, | //in |
MIL_INT64 ControlFlag | //in |
This function performs a differential operation on an image, based on either automatically calculated or specified derivative images. This function can be used, for example, to calculate the gradient magnitude and orientation (angle) of edges in an image, or to sharpen an image.
You can have MimDifferential() automatically calculate the required derivatives (in X and Y) of the source image by passing a linear IIR filter image processing context (previously allocated using MimAlloc() with M_LINEAR_FILTER_IIR_CONTEXT). MimDifferential() calculates the derivatives using IIR filters. You can partially define how the derivatives are calculated by configuring the IIR filter image processing context using MimControl(). MimDifferential() ignores the M_FILTER_OPERATION setting.
You can have MimDifferential() use precalculated derivatives by passing derivative image buffers: most operations require one image buffer with the derivative in X, and another with the derivative in Y (for the first derivatives, this is synonymous with passing the vertical and horizontal edge detection images, respectively). Passing precalculated derivatives is useful if you need to calculate the derivatives using a specific filter operation (for example, using MimConvolve() with a predefined FIR filter or a custom kernel), or use the derivatives with multiple functions (in which case, it is more efficient to calculate the derivatives only once).
Note that some operations require the first derivative images, while others require the second derivative images.
Specifies the identifier of an image buffer that stores a derivative, or a linear IIR filter context. The image buffer must not have a region of interest (ROI) associated with it. Specifying an image buffer with an ROI will cause an error.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of an image buffer that stores the source image, or a derivative. The image buffer must not have a region of interest (ROI) associated with it. Specifying an image buffer with an ROI will cause an error.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier an image buffer that stores the source image (for a sharpenig operation), or a derivative. The image buffer must not have a region of interest (ROI) associated with it. Specifying an image buffer with an ROI will cause an error.
Set this parameter to M_NULL if not used.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of the first destination image buffer. The image buffer must not have a region of interest (ROI) associated with it. Specifying an image buffer with an ROI will cause an error.
Set this parameter to M_NULL if not used. In this case, you cannot set Dst2ImageBufId to M_NULL.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of the second destination image buffer. The image buffer must not have a region of interest (ROI) associated with it. Specifying an image buffer with an ROI will cause an error.
Set this parameter to M_NULL if not used. In this case, you cannot set Dst1ImageBufId to M_NULL.
See the Parameter associations section for possible values that can be specified.
Specifies an attribute of the operation to perform. Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
Specifies the differential operation to perform.
See the Parameter associations section for possible values that can be specified.
Specifies a control setting for the operation to perform. Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
The table below lists possible values for the Drv1ImageBufIdOrFilterContextImId, SrcOrDrv2ImageBufId, SrcOrDrv3ImageBufId, Dst1ImageBufId, Dst2ImageBufId, Param, Operation, and ControlFlag parameters.
Set unused source and destination parameters to M_NULL. Set other unused parameters to M_DEFAULT.
For specifying the differential
operation
|
|||||||||||||||||||||||||||||||||||||||
|
Description | ||||||||||||||||||||||||||||||||||||||
Drv1ImageBufIdOrFilterContextImId | |||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId | |||||||||||||||||||||||||||||||||||||||
SrcOrDrv3ImageBufId | |||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId | |||||||||||||||||||||||||||||||||||||||
Dst2ImageBufId | |||||||||||||||||||||||||||||||||||||||
Param | |||||||||||||||||||||||||||||||||||||||
ControlFlag | |||||||||||||||||||||||||||||||||||||||
M_GRADIENT |
Performs a gradient operation. (summarize)Performs a gradient operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer ID |
Specifies the identifier of a float or signed image buffer, indicating the first derivative in X. (summarize)Specifies the identifier of a float or signed image buffer, indicating the first derivative in X. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of a float or signed image buffer, indicating the first derivative in Y. (summarize)Specifies the identifier of a float or signed image buffer, indicating the first derivative in Y. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient magnitude; that is: sqrt(Ix*Ix+Iy*Iy). To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst2ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient magnitude; that is: sqrt(Ix*Ix+Iy*Iy). (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst2ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient orientation. For an unsigned destination buffer, the angle is returned from 0° to 360° (counter-clockwise) and mapped to the entire range of the destination buffer. For example, for an 8-bit unsigned buffer, the angles of 0°, 90°, 180°, and 270° map to 0, 64, 128, and 192, respectively. For a signed destination buffer, mapping is done in both the positive and negative range of the buffer and represents angle values from -180° to 180°. For example, for an 8-bit signed buffer, the angles of -180°, -90°, 0°, and 90° map to -128, -64, 0 and 64, respectively. For a floating-point buffer, the results are not mapped and are returned in the range of 0° to 360°. To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst1ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient orientation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Linear IIR filter context ID |
Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (summarize)Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of the source image buffer (of any type) from which to extract the derivatives and compute the gradient. (summarize)Specifies the identifier of the source image buffer (of any type) from which to extract the derivatives and compute the gradient. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient magnitude; that is: sqrt(Ix*Ix+Iy*Iy). To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst2ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient magnitude; that is: sqrt(Ix*Ix+Iy*Iy). (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst2ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient orientation. For an unsigned destination buffer, the angle is returned from 0° to 360° (counter-clockwise) and mapped to the entire range of the destination buffer. For example, for an 8-bit unsigned buffer, the angles of 0°, 90°, 180°, and 270° map to 0, 64, 128, and 192, respectively. For a signed destination buffer, mapping is done in both the positive and negative range of the buffer and represents angle values from -180° to 180°. For example, for an 8-bit signed buffer, the angles of -180°, -90°, 0°, and 90° map to -128, -64, 0 and 64, respectively. For a floating-point buffer, the results are not mapped and are returned in the range of 0° to 360°. To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst1ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the gradient orientation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GRADIENT_SQR |
Performs a square gradient operation. (summarize)Performs a square gradient operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer ID |
Specifies the identifier of a float or signed image buffer, indicating the first derivative in X. (summarize)Specifies the identifier of a float or signed image buffer, indicating the first derivative in X. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of a float or signed image buffer, indicating the first derivative in Y. (summarize)Specifies the identifier of a float or signed image buffer, indicating the first derivative in Y. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient magnitude; that is: Ix*Ix+Iy*Iy . To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst2ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient magnitude; that is: Ix*Ix+Iy*Iy . (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst2ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient orientation. For an unsigned destination buffer, the angle is returned from 0° to 360° (counter-clockwise) and mapped to the entire range of the destination buffer. For example, for an 8-bit unsigned buffer, the angles of 0°, 90°, 180°, and 270° map to 0, 64, 128, and 192, respectively. For a signed destination buffer, mapping is done in both the positive and negative range of the buffer and represents angle values from -180° to 180°. For example, for an 8-bit signed buffer, the angles of -180°, -90°, 0°, and 90° map to -128, -64, 0 and 64, respectively. For a floating-point buffer, the results are not mapped and are returned in the range of 0° to 360°. To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst1ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient orientation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Linear IIR filter context ID |
Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (summarize)Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (summarize)Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient magnitude; that is: Ix*Ix+Iy*Iy . To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst2ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient magnitude; that is: Ix*Ix+Iy*Iy . (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst2ImageBufId |
Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient orientation. For an unsigned destination buffer, the angle is returned from 0° to 360° (counter-clockwise) and mapped to the entire range of the destination buffer. For example, for an 8-bit unsigned buffer, the angles of 0°, 90°, 180°, and 270° map to 0, 64, 128, and 192, respectively. For a signed destination buffer, mapping is done in both the positive and negative range of the buffer and represents angle values from -180° to 180°. For example, for an 8-bit signed buffer, the angles of -180°, -90°, 0°, and 90° map to -128, -64, 0 and 64, respectively. For a floating-point buffer, the results are not mapped and are returned in the range of 0° to 360°. To not return this information, set this parameter to M_NULL. In this case, you cannot set Dst1ImageBufId to M_NULL. (summarize)Specifies the identifier of a float or unsigned image buffer in which to write the results of the square gradient orientation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_LAPLACIAN |
Performs a Laplacian operation. (summarize)Performs a Laplacian operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer ID |
Specifies the identifier of a float or signed image buffer, indicating the second derivative in X. (summarize)Specifies the identifier of a float or signed image buffer, indicating the second derivative in X. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of a float or signed image buffer, indicating the second derivative in Y. (summarize)Specifies the identifier of a float or signed image buffer, indicating the second derivative in Y. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or signed image buffer in which to write the results of the Laplacian operation; that is: Ixx+Iyy . (summarize)Specifies the identifier of a float or signed image buffer in which to write the results of the Laplacian operation; that is: Ixx+Iyy . (more details...) |
||||||||||||||||||||||||||||||||||||||
Linear IIR filter context ID |
Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (summarize)Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (summarize)Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of a float or signed image buffer in which to write the results of the Laplacian operation; that is: Ixx+Iyy . (summarize)Specifies the identifier of a float or signed image buffer in which to write the results of the Laplacian operation; that is: Ixx+Iyy . (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SHARPEN |
Performs a sharpening operation. (summarize)Performs a sharpening operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer ID |
Specifies the identifier of a float or signed image buffer, indicating the second derivative in X. (summarize)Specifies the identifier of a float or signed image buffer, indicating the second derivative in X. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of a float or signed image buffer, indicating the second derivative in Y. (summarize)Specifies the identifier of a float or signed image buffer, indicating the second derivative in Y. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv3ImageBufId |
Specifies the identifier of an image buffer (of any type) that stores the image to sharpen. (summarize)Specifies the identifier of an image buffer (of any type) that stores the image to sharpen. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of an image buffer (of any type) in which to write the results of the sharpening operation; that is: Is- alpha*(Ixx*Iyy). If you use an unsigned image buffer, the sharpening operation performs a saturation. (summarize)Specifies the identifier of an image buffer (of any type) in which to write the results of the sharpening operation; that is: Is- alpha*(Ixx*Iyy). (more details...) |
||||||||||||||||||||||||||||||||||||||
Param |
Specifies the amount of sharpening. (summarize)Specifies the amount of sharpening. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 0.0 |
Specifies the sharpening value. |
||||||||||||||||||||||||||||||||||||||
Linear IIR filter context ID |
Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (summarize)Specifies the identifier of a linear IIR filter context (M_LINEAR_FILTER_IIR_CONTEXT). (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcOrDrv2ImageBufId |
Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (summarize)Specifies the identifier of an image buffer (of any type) from which to extract the derivatives. (more details...) |
||||||||||||||||||||||||||||||||||||||
Dst1ImageBufId |
Specifies the identifier of an image buffer (of any type) in which to write the results of the sharpening operation; that is: Is-alpha*(Ixx*Iyy). If you use an unsigned image buffer, the sharpening operation performs a saturation. (summarize)Specifies the identifier of an image buffer (of any type) in which to write the results of the sharpening operation; that is: Is-alpha*(Ixx*Iyy). (more details...) |
||||||||||||||||||||||||||||||||||||||
Param |
Specifies the amount of sharpening. (summarize)Specifies the amount of sharpening. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that MIL will establish an appropriate sharpening value. |
||||||||||||||||||||||||||||||||||||||
Value > 0.0 |
Specifies the sharpening value. |
||||||||||||||||||||||||||||||||||||||
ControlFlag |
Specifies whether to perform the sharpening operation, or to explicitly preprocess the linear IIR filter context. (summarize)Specifies whether to perform the sharpening operation, or to explicitly preprocess the linear IIR filter context. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies to perform the sharpening operation. |
||||||||||||||||||||||||||||||||||||||
M_PREPROCESS |
Specifies to preprocesses the linear IIR filter context explicitly. Note, if not called explicitly, MIL performs this operation automatically upon the first call to MimDifferential(). (summarize)Specifies to preprocesses the linear IIR filter context explicitly. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |