Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using Heywood Circularity Factor to find round blobs.

I am trying to use a particle filter to eliminate all blobs except round blobs with an area of about 3000 pixels. The problem I am having is that the heywood circularity factor finds some shapes within my area range that are not very round (almost square) and gives them a heywood score closer to 1 than some of the round blobs. I am using Visual Basic 6.0 with the IMAQ vision for measurement studio version 6.0.

I ran the sample VB program in the measurement studio directory called circledistance.vbp and found that that program also did not work very well on the small round blob in the sample image. IN the sample program there are three larger round blobs that are found when the heywood minimum value is set to about 1.01 or above then at 1.13 the square blobs are found and then at 1.22 the last small round blob is found. I am not sure why the square blobs are found before the last round blob?

Does anyone have any recomendations for finding round objects that work better than the heywood circularity factor?
0 Kudos
Message 1 of 4
(5,188 Views)
Two issues come to mind:

1. How small do you mean when you say small? It's possible that you simply don't have enough resolution to make accurate measurements.

2. You're using version 6.0 of IMAQ Vision. All newer versions of Vision have an improved calculation of perimeter, which will improve the accuracy Heywood Circularity Factor.

If you post some images, I can look into these issues further.

Thanks,
Kevin
National Instruments
Vision Algorithms
Message 2 of 4
(5,180 Views)
My field of view is about 1/3" in the horizontal direction and the size of the blobs i am looking for are about .060" in diameter. They usually have an area of about 2000 to 3000 pixels.

There is a sample program that loads when Measurement Studio for Visual Basic is installed that has an image with a round blob about the same size as the ones I am looking for. The program is located in the following location after installation (c:/MeasurementStudio/VB/Samples/IMAQ/3.Applications/CircleDistance.VBP). The round blob in the lower right corner of the image that this sample program uses, is about the same size as the blobs I am looking for. Can you try running the sample program and see if you get the same results i did, where the square blobs would be found before the small round blob in the bottom right hand corner.

If I upgrade my software what is the latest software and version that I need to program with Visual Basic?

Thanks for the help.
0 Kudos
Message 3 of 4
(5,161 Views)
After examining the example a bit more, I found that it was not using the mest AutoThreshold for the job, which was causing a misformed particle. If you edit the code to look like this:

'Perform the operation only if an image has been loaded
If CWIMAQViewer1.Image.Width > 0 Then
'Automatic threshold of the image
CWIMAQVision1.AutoThreshold CWIMAQViewer1.Image, CWIMAQViewer1.Image, 2, cwimaqATMethodMetric
CWIMAQViewer1.Palette.Type = cwimaqPaletteBinary

'Extraction of shape descriptors
CWIMAQVision1.ParticleMeasurement CWIMAQViewer1.Image, cwimaqMeasurementHeywoodCircularityFactor, HeywoodArray
CWIMAQVision1.ParticleMeasurement CWIMAQViewer1.Image, cwimaqMeasurementCenterMassX, CenterXArray
CWIMAQVision1.ParticleMeasurement CWIMAQViewer1.Image, cwimaqMeasurementCenterMassY, CenterYArray

I believe you will be more pleased with the results.

Regarding your application, you should try visually inspecting the binary image to make sure that all of your particles are well formed. If they aren't, you could try different methods of AutoThresholding, or various binary morphology operations like convex hull of filling holes. See the IMAQ Vision Concepts Manual for more information.

If you upgrade to the new version of IMAQ Vision, it will work with your current copy of VB.

Hope that helps,
Kevin
National Instruments
Vision Algorithms
0 Kudos
Message 4 of 4
(5,153 Views)