Rectangle detection

Detects rectangles within grayscale images using the Hough transform.

Description

Detects rectangles within grayscale images using the Hough transform. Input images can be of binary or grayscale format, but the rectangular features must be brighter than their surrounding background and have dark centres (i.e. not be solid). For solid rectangles, a gradient filter or equivalent should be applied to the image first. Detected rectangles are output to the workspace as solid objects. Rectangles are detected within a user-defined width, length and orientation range and must exceed a user-defined threshold score (based on the intensity of the rectangles feartures in the input image).

Parameters

Parameter Description
Input image Input image from which objects will be detected.
Output objects Output objects to be added to the workspace. Irrespective of the form of the input features, output objects are always solid.
Output transform image When selected, the Hough-transform image will be output to the workspace with the name specified by "Output image".
Output image If "Output transform image" is selected, this will be the name assigned to the transform image added to the workspace. The transform image has XY dimensions equal to the input image, an equal number of channels to the number of widths tested, Z-slices to the number of lengths tested and frames to the number of orientations tests. Rectangular features in the input image appear as bright points, where the XYCZT location of the point corresponds to the XYWLO (i.e. X, Y, width, length and orientation) parameters for the rectangle.
Downsample factor To speed up the detection process, the image can be downsampled. For example, a downsample factor of 2 will downsize the image in X and Y by a factor of 2 prior to detection of circles.
Normalise scores When selected, scores for each parameter combination will be normalised based on the number of samples used to produce them. Normalisation will prevent reduction of scores towards the image edge; however, it can also lead to some overestimation in these regions.
Detection mode Controls which objects will be added to the output collection:
  • "All above score" All objects with scores above the threshold specified by "Detection threshold" will be exported. Objects will be detected starting with that with the highest score. Following export of each object all potential objects within "Exclusion radius (px)" will be suppressed to prevent the same object being detected multiple times.
  • "N highest scores" A specific number (controlled by "Number of objects") of detected objects with the highest scores will be exported. Following export of each object all potential objects within "Exclusion radius (px)" will be suppressed to prevent the same object being detected multiple times.
Detection threshold If "Detection mode" is set to "All above score", this is the minimum score a detected circle must have to be stored. Scores are the sum of all pixel intensities lying on the perimeter of the circle. As such, higher scores correspond to brighter circles, circles with high circularity (where all points lie on the perimeter of the detected circle) and circles with continuous intensity along their perimeter (no gaps).
Number of objects If "Detection mode" is set to "N highest scores", this is the number of objects with the highest scores that will be added to the output object collection.
Exclusion radius (px) The minimum distance between adjacent circles. For multiple candidate points within this range, the circle with the highest score will be retained. Specified in pixel units.
Enable multithreading Process multiple radii simultaneously. This can provide a speed improvement when working on a computer with a multi-core CPU.
Show transform image When selected, the transform image will be displayed (as long as the module is currently set to show its output).
Show detection image When selected, the detection image will be displayed (as long as the module is currently set to show its output).
Show detection score When selected, the detection image will also show the score associated with each detected object.
Label size Font size of the detection score text label.
X range (px) Range of X-position values to be tested. X-position can be specified as a comma-separated list, using a range (e.g. "4-7" specifies values 4,5,6 and 7). Unlike other parameter ranges, X-position can't be specified as a range extracting every nth slice (e.g. "4-10-2"), instead image downsampling ("Downsample factor" parameter) should be used. X-position values are specified in pixel units.
Y range (px) Range of Y-position values to be tested. Y-position can be specified as a comma-separated list, using a range (e.g. "4-7" specifies values 4,5,6 and 7). Unlike other parameter ranges, Y-position can't be specified as a range extracting every nth slice (e.g. "4-10-2"), instead image downsampling ("Downsample factor" parameter) should be used. Y-position values are specified in pixel units.
Width range (px) Range of width values to be tested. Widths can be specified as a comma-separated list, using a range (e.g. "4-7" specifies values 4,5,6 and 7) or as a range extracting every nth slice (e.g. "4-10-2" specifies values 4,6,8 and 10). Widths are specified in pixel units.
Length range (px) Range of length values to be tested. Lengths can be specified as a comma-separated list, using a range (e.g. "4-7" specifies values 4,5,6 and 7) or as a range extracting every nth slice (e.g. "4-10-2" specifies values 4,6,8 and 10). Lengths are specified in pixel units.
Orientation range (degs) Range of orientation values to be tested. Orientations can be specified as a comma-separated list, using a range (e.g. "4-7" specifies values 4,5,6 and 7) or as a range extracting every nth slice (e.g. "4-10-2" specifies values 4,6,8 and 10). Orientations are specified in degree units.