kl3m3n's blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Detect Hough circles in LabView using OpenCV

Klemen
Active Participant

Hello,

I am attaching a small program, which is usefull for detection of circularly shaped objects using the Hough transformation. The core of the code is taken from OpenCV and as usual built as a .dll that can be used in LabView.

The explanation of the parameters used for the detection can be found here:

http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html

A neat parameter is the "minimum distance", which specifies the minimum distance between the two detected circle centers. This makes it possible to "filter out" the circles that are too tightly together. You can additionally also specify the minimum and maximum radius for the valid circle detection.

Figure 1 for example uses such parameters, that all the  circles are detected.


all_circles.png

Figure 1. All circles on the images are detected.

Changing the minimum distance, three small circles that are closer to the three bigger circles are excluded from the detection.

filtered_circles.png

Figure 2. Parameter minDistance is one of the parameters that influences the number of the detected circles.

The code I am attaching is the source code (c++), built .dll (release version) and a LabView example that uses the .dll.

The code was built using OpenCV 2.4.6 and the LabView version is 2010.

Hope someone finds this useful as a starting point in their project!

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Comments