Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

extract largest particle from unknown number of particles

Solved!
Go to solution

Hello,

I'm performing image processing and after some processing steps i get a black and white image with either 1 or none particles. However i like to set a default case if more than one particle arise . As the other particles are due to noise their size will  be reduced but still unknown .Hence I thought of extracting the areas of these particles using particle analysis vi of labview through a for loop but i have no idea how to select the particle with the largest area and determine it's center. Can anyone provide a solution for this?

0 Kudos
Message 1 of 12
(6,323 Views)

Hi Prathiksha,

you may not need for loop. By default particle analysis gives you all particles data.

-What you should do is use particle filter first and then use your filter criteria which can give single particle according to your requirement.

-is it possible to add image?

-There is readily available example which demonstrates this in labview. got to Help>>find examples>>particle filter.

Thanks
uday
0 Kudos
Message 2 of 12
(6,319 Views)

The main problem is that size of particle of interest can vary rapidly as the images are taken and processed in real-time and occlusions can also be present . It is also not possible to accurately set the minimum or average size of the particle as noises cannot be determined before-hand.

0 Kudos
Message 3 of 12
(6,295 Views)

I would like the labview program to just compare and extract particle with largest area and find it's center. Is it possible

0 Kudos
Message 4 of 12
(6,288 Views)
Solution
Accepted by topic author Prathiksha

Hello,

 

how about doing something like this:

 

sort_BD.png

 

I have used "count objects", but you can use any other function that reports the area and object center of the particles.

 

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."
Message 5 of 12
(6,287 Views)

Hello,

I understood that we bundled the 2 measures that we need...but i did not understand why the input cluster is outside the for loop? I seem to be getting issues during bundling the 2 measures. What have you given as the input cluster?

0 Kudos
Message 6 of 12
(6,279 Views)

Because the cluster is bundled by name (please see "Bundle by Name" function, see "cluster pallete) and the input cluster is constant in each iteration, but gets overwritten with new values also in every iteration. You need to create a constant of each bundled element and make a new bundle that is the input of the "input cluster". Check some examples online.

 

You can avoid this by using the basic "Bundle" function, but I kept the name to make it more readable.

 

The "bundle by name" accesses the elements by name, whereas the "bundle" by their position. If you have a large bundle, you can get in trouble quickly.

 

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."
Message 7 of 12
(6,274 Views)

Thank you.....i think i figured it out. Area is used as first element for sorting in ascending and then final array was reversed. I was able to extract the center by clustering and unbundling the 1st array and element. 

I do have a doubt. Is there any difference between the center calculated in blob detection technique and the one used for particle analysis

0 Kudos
Message 8 of 12
(6,270 Views)

Hello,

 

if you have a doubt:

 

a.) read the documentation and

b.) test both examples on the same input sample(s). Compare the results.

 

For me, this is always the best way to test stuff for specific application needs (sometimes its b.) before a.), but that is only due to my impatient nature).


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."
0 Kudos
Message 9 of 12
(6,268 Views)

Hello, 

 

           I have to accept nut having diameter 1cm and reject other nuts , if I place them in front of my camera  using particle analysis.

I have Labview 2012 version and Camera used is Basler aca 2000-50gc .

         

I tried to make a VI by using concepts of " Particle analysis .vi " example, but it is not showing proper results. 

 

I am attaching my VI and  Image of nuts .

 

Please suggest me modifications as soon as possible.

 

 

Thanks.

Download All
0 Kudos
Message 10 of 12
(5,374 Views)