Ask Your Question

Revision history [back]

[Newbie] Can OpenCV find a straight boundary?

I have images that consist of a light area and a dark area. The boundary between the two areas is either curved, straight, or a combination (curved then straight). I need to determine if the image contains a straight segment in the boundary, and if so, its angle relative to the bottom of the image. I don't need any other output, such as the image that the Canny edge detector generates.

If OpenCV can do this, which functions should I look at?

What's really happening: a round integrated circuit wafer has a flat edge on one side. The wafer is being rotated on a spindle under a camera, and the rotation needs to stop when the flat edge reaches the top of the frame. A couple of sample images are shown below. Note in the first image the transition from straight to curved edge in the upper right corner. The second image shows where rotation should stop. (The text below the flat edge will then be OCR'ed.) Since the flat edge will always rotate into the frame in more-or-less the same spot on the right edge of the frame, it seems it would be sufficient to analyze just that small area looking for the flat edge, but would that be enough data for OpenCV to work with?

Thanks for your help!

Wafer 1

Wafer 2

Wafer sizes