Draw Rectangles

Block Category: Draw

Input Image Format

Input Image Requirements: None

Description: The Draw Rectangles block works in conjunction with the Threshold, Find Contour, and Bounding Box blocks to draw a rectangle around an image based on the points specified.

Color: Specifies the color of the outline of the rectangles.

Line Smoothness: Specifies an anti-aliasing algorithm for drawing the rectangle. The algorithms are trade-offs between computation and smoothness of non-square lines. The choices are:

      4-connected: Uses Von Neumann algorithm.

      8-connected: Uses Moore Neighborhood algorithm.

      Anti-aliased: Uses Xiaolin Wu algorithm.

Random: When activated, it overrides the color selection and colors the outline of the rectangles in random colors.

Thickness: Specifies the rectangle’s border thickness as an integer greater than 0.


In this example, the Threshold and Find Contour blocks are used to isolate and determine the contour of the hexagon in the image. The Bounding Box block calculates the smallest rectangle to enclose the hexagon while the Rectangle block draws the rectangle.