Table: | For specifying the edge(s) to draw |
+ combination: | For an index or a label value |
MIL_ID ContextGraId, | //in |
MIL_ID ResultEdgeId, | //in |
MIL_ID DstImageBufOrListGraId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT IndexOrLabel, | //in |
MIL_INT64 ControlFlag | //in |
This function draws specific edge results in the destination image buffer or 2D graphics list.
To draw edge results, the required information must be available for the specified edge or group of edges, in the Edge Finder result buffer. To verify availability, call MedgeGetResult() with the required edge result combined with M_AVAILABLE.
You can draw results and settings, obtained relative to an offset, at the top-left corner of the destination image, using MgraControl() with M_DRAW_OFFSET_X and M_DRAW_OFFSET_Y and zoom them using MgraControl() with M_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For example, you can draw a zoomed section of the edge map found in the target image at the top-left corner of the destination image. For more information, see the Drawing graphics with offset and zoom subsection of the Drawing graphics section of Chapter 24: Generating graphics.
Note that if the edges are calculated using a calibrated source image, Edge Finder takes the camera calibration into account; that is, drawings might be distorted, according to the camera calibration. For example, a straight line (in the world) might be drawn as a curve.
Specifies the identifier of the 2D graphics context to use when drawing. This parameter must be set to one of the following values:
For specifying the 2D graphics context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the default 2D graphics context of the current MIL application is used. Note that there is a different default 2D graphics context for each thread. (summarize)Specifies that the default 2D graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL 2D graphics context identifier |
Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the identifier of the Edge Finder result buffer from which to extract the results to draw. The Edge Finder result buffer must have been previously allocated on the required system using MedgeAllocResult().
The Edge Finder result buffer (ResultEdgeId) must be allocated on the same system as the 2D graphics context buffer (ContextGraId). If it is not, an error will occur.
Specifies the identifier of the destination image buffer or 2D graphics list in which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The 2D graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the 2D graphics list with the display, you can also annotate an image non-destructively.
If specifying an image buffer, it must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
When using MedgeDraw() to draw results extracted from a calibrated source image, the destination drawing buffer need not be calibrated to the same world. MedgeDraw() draws all the requested results according to the calibrated source image.
Specifies the type of operation to perform. The possible Operation parameter values in the table below can be added together to draw multiple feature results at once.
The following operations can draw in a destination image buffer or 2D graphics list.
For specifying the type of operation to
perform
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DRAW_BOX + |
Draws a bounding box around each edge. Note that to perform this operation, the M_BOX feature in MedgeControl() must be calculated. (summarize)Draws a bounding box around each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_CENTER_OF_GRAVITY + |
Draws a cross at the center of gravity of each edge. You can modify the cross size by setting MedgeControl() with M_DRAW_CROSS_SIZE to an appropriate value. Note that to perform this operation, the M_CENTER_OF_GRAVITY feature in MedgeControl() must be calculated. (summarize)Draws a cross at the center of gravity of each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_CIRCLE_FIT + |
Draws the circle fit of each edge. Note that to perform this operation, the M_CIRCLE_FIT feature in MedgeControl() must be calculated. (summarize)Draws the circle fit of each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGE + |
Draws each edge. |
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGELS + |
Draws a cross at each edgel. You can modify the cross size by setting MedgeControl() with M_DRAW_CROSS_SIZE to an appropriate value. (summarize)Draws a cross at each edgel. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_ELLIPSE_FIT + |
Draws the ellipse fit of each edge. Note that to perform this operation, the M_ELLIPSE_FIT feature in MedgeControl() must be calculated. (summarize)Draws the ellipse fit of each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FERET_GENERAL + |
Draws the edges' general Feret, using an H-type line (|-|). This line is drawn on contact with the edge's two extrema edgels, at the general Feret diameter's angle. Note that to perform this operation, the M_FERET_GENERAL feature in MedgeControl() must be calculated. (summarize)Draws the edges' general Feret, using an H-type line (|-|). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FERET_MAX + |
Draws the edges' maximum Feret, using an H-type line (|-|). This line is drawn on contact with the edge's two extrema edgels, at the maximum Feret diameter's angle. Note that to perform this operation, the M_FERET_MAX_DIAMETER and M_FERET_MAX_ANGLE features in MedgeControl() must be calculated. (summarize)Draws the edges' maximum Feret, using an H-type line (|-|). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FERET_MIN + |
Draws the edges' minimum Feret, using an H-type line (|-|). This line is drawn on contact with the edge's two extrema edgels, at the minimum Feret diameter's angle. Note that to perform this operation, the M_FERET_MIN_DIAMETER and M_FERET_MIN_ANGLE features in MedgeControl() must be calculated. (summarize)Draws the edges' minimum Feret, using an H-type line (|-|). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_INDEX + |
Draws each edge's index value. |
||||||||||||||||||||||||||||||||||||||
M_DRAW_LABEL + |
Draws each edge's label value. Note that to perform this operation, the M_LABEL_VALUE feature in MedgeControl() must be calculated. (summarize)Draws each edge's label value. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_LINE_FIT + |
Draws the line fit of each edge. Note that to perform this operation, the M_LINE_FIT feature in MedgeControl() must be calculated. (summarize)Draws the line fit of each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_POSITION + |
Draws a cross at the center of each edge. You can modify the cross size by setting MedgeControl() with M_DRAW_CROSS_SIZE to an appropriate value. Note that to perform this operation, the M_POSITION feature in MedgeControl() must be calculated. (summarize)Draws a cross at the center of each edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SEGMENTS + |
Draws the segments of the edge approximation. Note that to perform this operation, edge approximations must have been previously calculated by setting MedgeControl() with M_CHAIN_APPROXIMATION to M_LINE. (summarize)Draws the segments of the edge approximation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_VERTICES + |
Draws the segment intersections (or vertices) of the edge approximation. Note that to perform this operation, edge approximations must have been previously calculated by setting MedgeControl() with M_CHAIN_APPROXIMATION to M_LINE. (summarize)Draws the segment intersections (or vertices) of the edge approximation. (more details...) |
You can add the following value to the above-mentioned values to specify that the operation's numeric value is drawn.
For M_DRAW_CENTER_OF_GRAVITY, M_DRAW_POSITION,
M_DRAW_FERET_MIN, M_DRAW_FERET_MAX, and
M_DRAW_FERET_GENERAL
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description | ||||||||||||||||||||||||||||||||||||||
M_DRAW_VALUE + |
Specifies that the operation's numerical value is drawn. For example, if you add M_DRAW_VALUE to M_DRAW_CENTER_OF_GRAVITY, the center of gravity's coordinates are drawn within parenthesis, and centered above the drawing cross. (summarize)Specifies that the operation's numerical value is drawn. (more details...) |
You can use one of the following values on its own, or add it to the above-mentioned values, to specify an operation that cannot use a 2D graphics list as a destination.
The following operations can only draw in an image buffer.
For specifying operations that cannot use a 2D
graphics list as a destination
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DRAW_ANGLE |
Draws the internal angle buffer. Note that to perform this operation, the angle buffer must have been previously saved in the result buffer by enabling M_SAVE_ANGLE in MedgeControl(). (summarize)Draws the internal angle buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_CROSS_DERIVATIVE |
Draws the internal cross-derivative buffer of the source image. M_DRAW_CROSS_DERIVATIVE is only relevant for M_CREST Edge Finder contexts. Note that to perform this operation, the derivatives must have been previously saved in the result buffer by enabling M_SAVE_DERIVATIVES in MedgeControl(). (summarize)Draws the internal cross-derivative buffer of the source image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FIRST_DERIVATIVE_X |
Draws the internal first derivative buffer of the source image, in the X-direction. M_DRAW_FIRST_DERIVATIVE_X is only relevant for M_CONTOUR Edge Finder contexts. Note that to perform this operation, the derivatives must have been previously saved in the result buffer by enabling M_SAVE_DERIVATIVES in MedgeControl(). (summarize)Draws the internal first derivative buffer of the source image, in the X-direction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_FIRST_DERIVATIVE_Y |
Draws the internal first derivative buffer of the source image, in the Y-direction. M_DRAW_FIRST_DERIVATIVE_Y is only relevant for M_CONTOUR Edge Finder contexts. Note that to perform this operation, the derivatives must have been previously saved in the result buffer by enabling M_SAVE_DERIVATIVES in MedgeControl(). (summarize)Draws the internal first derivative buffer of the source image, in the Y-direction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_IMAGE |
Draws the source image. Note that to perform this operation, the source image must have been previously saved in the result buffer by enabling M_SAVE_IMAGE in MedgeControl(). (summarize)Draws the source image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_MAGNITUDE |
Draws the internal magnitude buffer. Note that to perform this operation, the magnitude buffer must have been previously saved in the result buffer by enabling M_SAVE_MAGNITUDE in MedgeControl(). (summarize)Draws the internal magnitude buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_MASK |
Draws the mask buffer. Note that to perform this operation, the mask buffer must have been previously saved in the result buffer by enabling M_SAVE_MASK in MedgeControl(). (summarize)Draws the mask buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SECOND_DERIVATIVE_X |
Draws the internal second derivative buffer of the source image, in the X-direction. M_DRAW_SECOND_DERIVATIVE_X can only be used with M_CREST Edge Finder contexts. Note that to perform this operation, the derivatives must have been previously saved in the result buffer by enabling M_SAVE_DERIVATIVES in MedgeControl(). (summarize)Draws the internal second derivative buffer of the source image, in the X-direction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SECOND_DERIVATIVE_Y |
Draws the internal second derivative buffer of the source image, in the Y-direction. M_DRAW_SECOND_DERIVATIVE_Y can only be used with M_CREST Edge Finder contexts. Note that to perform this operation, the derivatives must have been previously saved in the result buffer by enabling M_SAVE_DERIVATIVES in MedgeControl(). (summarize)Draws the internal second derivative buffer of the source image, in the Y-direction. (more details...) |
Specifies the edge(s) to draw. This parameter must be set to one of the values below.
For specifying the edge(s) to draw
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_INCLUDED_EDGES. |
||||||||||||||||||||||||||||||||||||||
M_ALL_EDGES + |
Specifies all edges. |
||||||||||||||||||||||||||||||||||||||
M_EXCLUDED_EDGES + |
Specifies all currently excluded edges. |
||||||||||||||||||||||||||||||||||||||
M_INCLUDED_EDGES + |
Specifies all currently included edges. |
||||||||||||||||||||||||||||||||||||||
Value + |
Specifies either the edge's index or label. For more information, see combination values below. Valid index values must fall within the following range: 0 to the number of included edges in the Edge Finder result buffer - 1. You can retrieve valid label values using MedgeGetResult() with M_LABEL_VALUE. (summarize)Specifies either the edge's index or label. (more details...) |
You can add one of the following values to the above-mentioned values to specify whether you are providing an index or a label value.
For an index or a label value
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description | ||||||||||||||||||||||||||||||||||||||
M_TYPE_INDEX |
Specifies an edge using its index value. Note that only included edges (M_INCLUDED_EDGES) can be drawn. This is the default value. (summarize)Specifies an edge using its index value. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TYPE_LABEL |
Specifies an edge using its label value. |
Header | Include mil.h. |
Library | Use mil.lib; miledge.lib. |
DLL | Requires mil.dll; miledge.dll. |