The RectangleFinder step allows you to search for, and locate, rectangular shapes.
Searches are performed using edge-based geometric features. This allows you to locate occurrences in an image despite occlusion, specular reflection, and variations in rotation, scale, and contrast. Simply ensure that at least one part of each side of your rectangular shape is visible.
The RectangleFinder step uses a specialized algorithm to locate instances of rectangular shapes. It has a tolerance for the deformation of rectangles, such that rectangles that are not perfectly straight, or rectangles that are broken up, are still identified as potential occurrences.
To fine-tune the search, you can adjust the RectangleFinder step settings. For example, you can limit the number of occurrences to obtain only the best ones, adjust the smoothness level to reduce image noise, or alter the detail level to find or exclude occurrences with very faint edges.
You can view all of an image's extracted target edges and resulting model edges, using the RectangleFinder step annotation settings. These annotation settings are the same as those available for the ModelFinder step. See the Edge extraction settings subsection of the Search settings available for all Finder steps section in Chapter 13: ModelFinder step for more information.
The RectangleFinder step provides complete support for calibration. Searches can be performed in calibrated real-world coordinates such that, without physically correcting your images, occurrences can be found even in the presence of complex distortions, and results are calculated in real-world units when a calibration is used.
Additionally, the RectangleFinder step allows you to redefine your rectangular shape at runtime using the Reconfigure step. See the Reconfiguring the shape definition at runtime section in Chapter 14: CircleFinder step for more information.