Book Image

OpenCV 3.0 Computer Vision with Java

By : Daniel Lelis Baggio
Book Image

OpenCV 3.0 Computer Vision with Java

By: Daniel Lelis Baggio

Overview of this book

Table of Contents (15 chapters)
OpenCV 3.0 Computer Vision with Java
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

The line and circle Hough transforms


In case you need to find straight lines or circles in an image, you can use Hough transforms, as they are very useful. In this section, we will cover OpenCV methods to extract them from your image.

The idea behind the original Hough line transform is that any point in a binary image could be part of a set of lines. Suppose each straight line could be parameterized by the y = mx + b line equation, where m is the line slope and b is the y axis intercept of this line. Now, we could iterate the whole binary image, storing each of the m and b parameters and checking their accumulation. The local maximum points of the m and b parameters would yield equations of straight lines that mostly appeared in the image. Actually, instead of using the slope and y axis interception point, we use the polar straight line representation.

Since OpenCV not only supports the standard Hough transform, but also the progressive probabilistic Hough transform for which the two functions...