MIL_ID SrcImageBufId, | //in |
MIL_ID DstIntensityImageBufId, | //in |
MIL_ID DstAngleImageBufId, | //in |
MIL_ID KernelId, | //in |
MIL_INT64 ControlFlag, | //in |
MIL_INT Threshold | //in |
This function performs an edge detection operation on the specified source image, using the specified filter. It produces a gradient intensity image and/or a gradient angle image in the specified image buffer(s). If one of the destination images is not required, specify M_NULL as its image buffer identifier.
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.
This function can also be performed on a floating-point buffer. However, the results are not mapped and are returned in the range of 0° to 360°. The degree of precision is equal to the precision of the floating-point buffer for regular computation or to +/- 0.4° for fast computation. The value for undefined results is the maximum positive value of the floating-point buffer.
For a gradient value lower than the threshold value, the angle is not computed (not considered a significant edge) and the resulting angle pixel is undetermined.
You can perform the operation using a combination of fast and full gradient and angle computations.
Type of computation |
Description of computation |
Full gradient computation |
Gradient = sqrt(GradientX*GradientX + GradientY*GradientY) |
Fast gradient computation |
Gradient = ( abs(GradientX) + abs(GradientY))/2 |
Full angle computation |
Angle = arctan(GradientY/GradientX) |
The fast angle approximation is based on the same equation as the full angle computation, however the value is determined from a LUT mapping. Note that the fast angle approximation introduces a maximum error of +/- 0.4°.
Specifies the identifier of the 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.
The source image buffer must be unsigned monochrome 8- or 16-bit.
Specifies the identifier of the destination buffer for the resulting gradient intensity image. This parameter must be given an image buffer identifier or M_NULL. Saturation is performed on this 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 identifier of the destination buffer for the resulting gradient angle image. This parameter must be given an image buffer identifier or M_NULL.
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 this parameter cannot be set to M_NULL if DstIntensityImageBufId is also set to M_NULL, otherwise an error will occur.
Specifies the filter to use. This parameter must be set to the value below.
For specifying the filter to
use
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_SOBEL + |
Sets the parameter to the predefined 3x3 edge detection filter. (more details...) |
You can add the following value to the above-mentioned value to specify that overscan processing is disabled.
For M_SOBEL
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_OVERSCAN_DISABLE |
Disables overscan processing. |
Specifies how to perform the operations.
This parameter can be set to one of the following:
For specifying how to perform the
operation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_FAST_EDGE_DETECT. |
||||||||||||||||||||||||||||||||||||||
M_FAST_ANGLE + M_REGULAR_GRADIENT |
Specifies a full gradient computation and a fast angle approximation. |
||||||||||||||||||||||||||||||||||||||
M_FAST_EDGE_DETECT |
Specifies a fast gradient computation and a fast angle approximation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_REGULAR_ANGLE + M_FAST_GRADIENT |
Specifies a fast gradient computation and a full angle computation. |
||||||||||||||||||||||||||||||||||||||
M_REGULAR_EDGE_DETECT |
Specifies a full gradient computation and a full angle computation. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |