Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove particles from an image (beyond ParticleFilter)

ParticleFilter2 and ParticleFilter3 in Vision Development Module (ver. 8.5) allow filtering out particles based on the individual ParticleMeasurement parameters. In my application, I need to filter out particles based on the ratio of two parameters (ConvexHullArea and ConvexHullPerimeter). From reading other posts, I understand that ParticleFilter cannot do this, so I was wondering if I can remove the particles individually (e.g. by selecting them and filling them with background color)?
 
Vic
0 Kudos
Message 1 of 5
(4,732 Views)
Hi Vic

Just a quick idea
  1. IMAQ Particle analysis to get the desired particle measurements
  2. IMAQ Label to label the particles in the images. I think the particle order is the same as that returned by Particle analysis
  3. Create a lookup table replacing the particle indices that should be deleted with a zero value, others with 1.
  4. IMAQ User lookup
Actually I'm not sure that the assumption in point 2 is true.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 2 of 5
(4,728 Views)

Vladimir,

thank you for the suggestion but the palettes are limited to 256 colors, which is below my number of particles (~600).

I have considered another approach - to use the CenterOfMass coordinates of an unwanted particle to fill it with background color. Unfortunately, my particles may have holes in the central area so this method is unlikely to work either. I wish there was a way to select the particle or its outline (contour). Maybe I should start another thread to ask specifically about selecting the particle's outline.

Vic

0 Kudos
Message 3 of 5
(4,721 Views)
Hi Vic

If you convert the input image to 16-bit before labeling, you can handle as much as 65535 particles Smiley Tongue

Vladimir

View my profile on LinkedIn
0 Kudos
Message 4 of 5
(4,711 Views)
Label and Particle Analysis use the same ordering for particles (highest to lowest, ties broken by left to right), but Particle Analysis returns values in a LabVIEW array, which is zero indexed, while Label starts filling particles with value 1 (since 0 is the value for pixels with no particle).

Kevin C.
National Instruments
0 Kudos
Message 5 of 5
(4,686 Views)