BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.23k stars 4.61k forks source link

Hough Circle Transform #601

Open tdipiazza opened 11 years ago

tdipiazza commented 11 years ago

I'm currently using OpenCV's HoughCircle Transform to detect circles in an app I'm working on. I'd love to see this functionality added to the GPUImage framework. I saw that you recently added GPUImageHoughTransformationLineDetector and figured it was worth passing this feedback along.

Previously, I was using GPUImage's HarrisCornerDetector to locate the edges of the circles I need to identify, but for my particular needs an accurate count of the number of circles is required. Since multiple features along the perimeter of the circle could be counted as corners, I was not able to achieve the results I was hoping for and have had to switch to using OpenCV. Needless to say, it's slower than GPUImage.

Thanks for considering this!

BradLarson commented 11 years ago

The Hough transform for lines that I use is based on the parallel coordinates research of Dubská, Havel, and Herout:

http://medusa.fit.vutbr.cz/public/data/papers/2011-SCCG-Dubska-Real-Time-Line-Detection-Using-PC-and-OpenGL.pdf

This approach only works for lines, not any other geometric shape, but they hint at the possible extension of this to other shapes in their earlier paper:

http://medusa.fit.vutbr.cz/public/data/papers/2011-CVPR-Dubska-PClines.pdf

"A generalization of our PClines parameterization can be used for detecting higher-dimensional linear objects: lines in 3D, planes in 3D, hyperplanes in multidimensional spaces, etc. Also, we intend to explore the possibility of using parallel coordinates for detection of other than linear objects. Simple geometric shapes, such as circles and conic sections, have well-described images in the space of parallel coordinates based on boundary contours."

This is fairly new research, and my implementation is the first shipping application of their algorithm. If someone can solve out the math to apply parallel coordinates to circles, I'd be glad to give it a try, but that might be a ways off.