Draw Detections
This function block overlays detection results on an image by drawing rectangles and a textual verdict (OK / Nok) for each detected object. It is intended as a final visualization or inspection step in a vision pipeline.
π₯ Inputs
Image Primary image to draw overlays on. (input socket)
Coordinate_List List of rectangle coordinates to draw. Each item should be a pair of points defining a rectangle. (input socket)
Object_Count List of counts/flags corresponding to each rectangle. Used to determine OK (green) or Nok (red) status. (input socket)
Trigger Boolean to enable drawing. When not active the block will output nothing. (input socket)
π€ Outputs
Result Image The image with drawn rectangles and status text. (output socket)
πΉοΈ Controls
This block has no internal UI controls. Behavior is controlled entirely via its input sockets.
π¨ Features
Visual status overlay that draws colored rectangles and text labels on the input image.
Color coding: green for OK, red for Nok β determined from the corresponding
Object_Countvalues.Handles multiple detections at once by iterating through the lists of coordinates and counts.
Emits warnings when list lengths mismatch or when coordinate data is invalid.
Requires an active
Triggerto produce an output; otherwise it produces no result.
βοΈ Running mechanism
When the block receives data and the
Triggerinput is True, it copies the providedImageand draws one rectangle for each entry inCoordinate_List.For each rectangle, the block checks the corresponding value in
Object_Count. If the value indicates presence (non-zero), the rectangle and the label are drawn in green with text "Ok". If the value is zero or missing, the rectangle and text are drawn in red with text "Nok".If the number of coordinates and counts differ, the block will warn and pair items using the shortest length. Invalid coordinate entries are skipped with a warning.
The final annotated image is sent through the
Result Imageoutput socket.
π Usage instructions
Feed a source image into
Image.Provide matching lists into
Coordinate_ListandObject_Count(same length recommended).Activate
Triggerto generate the annotated result image.Connect the
Result Imageto a viewer or saver block to inspect or store the annotated frames.
π‘ Tips and Tricks
Use
Object DetectionorObject Detection - Custom(orObject Detection (D-FINE)) to produce rectangle lists and counts, then connect their rectangle and count outputs intoCoordinate_ListandObject_Count.Combine with
Object_Detection_Trackerto draw tracked rectangles with consistent positions; feed tracked rectangle outputs into this block for per-object OK/Nok overlays.Use
Rectangles in RectangleorCheck Areato filter detections before drawing (exclude detections outside a region of interest).Preview results with
Show Imageand save withImage LoggerorImage Writefor record keeping.Control when annotations appear using
Logic Inputor edge detectors likeRising Edgeso you only draw on selected frames.If you need to draw single rectangles directly, consider
Draw Rectangle; use this block when you have multiple detections and want automated OK/Nok marking.
π οΈ Troubleshooting
No output: ensure
Triggeris True and valid image data is connected toImage.Mismatched lists: if
Coordinate_ListandObject_Countlengths differ you will see warnings and some items may be ignored β make sure your upstream block outputs aligned lists.Invalid coordinates: if coordinate entries are malformed the block will skip them and warn; verify the format coming from detection blocks.
To persist results or inspect them frame-by-frame, connect
Result ImagetoShow Imageor to saving blocks likeImage Logger.
Last updated
Was this helpful?