From The Living Headlights (our project in Chapter 5, Equipping Your Car with a Rearview Camera and Hazard Detection), we are already familiar with one technique for detecting circles. We treated the problem as a special case of blob detection, and we used an OpenCV class, SimpleBlobDetector, which allows us to specify many detection criteria, such as a blob's size, color, and circularity (or non-circularity, that is, linearity).
A blob is a shape filled with a solid (or nearly solid) color. This definition implies that many circular or linear objects are not detectable as blobs. In the following screenshot, we can see a sunlit desk with a china teapot, china bowl, and pewter bowl:
The bowls and the lid of the teapot have approximately circular outlines in this top-down view. However, they are unlikely to pass detection as blobs, because the interior...