Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating the Distance between particles

I'm building a VI to analysis CCD's for defects.
One of the defects I'm looking for is clusters of contiguous point defects.
I've found the image processing particle detection routines which can be used to find these clusters, however to pass there must no cluster within 3 pixels of any other cluster.
Can anyone think of a way of measuring the ditance between clusters, since the particle detection vi gives the total bounds which could, due to irregular clusters, give the impression of closeness but actual pass my specification.
0 Kudos
Message 1 of 3
(3,114 Views)
Robert,

The simplest way I can come up with is to use Binary Morphology. If you use Dilate, it will make all your particles grow. By selecting the proper parameters, you should be able to get all your particles to increase their size by half the minimum spacing. If the spacing between two particles was less than the minimum, they should run together and become a single particle. Use particle detection and see if the total number of particles has decreased, and that will tell you if two particles ran together.

If necessary, you could design more elaborate detection algorithms at the end. You could subtract the original image from the dilated image, which would leave holes where the original particles were. Using particle detection, you could count
the number of holes in each particle. I think the result would be the same, though.

You would have to make sure you remove any particles that aren't clusters before doing the processing. Two tiny specs could run together and change your count, when they are just noise.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 3
(3,114 Views)
Thanks a lot.
This was exactly what I needed to know and with a little investigation and distortion of the basic particle eample I was able to show this method will work.

Now only to get it to work with images of unsigned 16 bits...
0 Kudos
Message 3 of 3
(3,114 Views)