From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-09-2013 02:12 AM
HI,
I'm working on a project in which I need to detect the number of edges in each of the particle present in the image.
Can anyone please help me out with it.
My progress till now is that I've been able to detect all the edges of the particles in the image successfully using Canny edge. However I'm not able to count the number of edges in individual particle.
Thanks
Regards
Aveo
Solved! Go to Solution.
07-09-2013 04:24 AM
Hello aveo,
could you please clarify the problem a bit because I think I don't understand what do you mean by number of edges.
The number of edges could be 1, 2 10 or 1000, etc... Depends on how many pixels you segment the edges. What is an "edge" in your case? A closed contour?
This statement is not clear to me "However I'm not able to count the number of edges in individual particle". One particle has one edge.
Best regards,
K
07-09-2013 05:47 AM
Hi K,
I'm attaching an image titled "particle.png". In the image you can see that there are two particles. Now when i apply Canny edge on the image, i get several edges for each particle.
I want to count how many edges are there in each of the TWO particle present in the image.
Regards
Aveo
07-09-2013 05:56 AM
I've extracted the 1st particle(the bigger particle) from the image "particle.png" and applied Canny Edge to it and the output that i got is 'particle 1.png'.
now you can see that there are so many edges coming up.
What i want is to find out is the number of white lines(which in this case are the edges) that are present in the image "particle 1.png".
Hope i clarified the problem.
Regards
Aveo
07-10-2013 04:49 AM
Hello aveo,
how about performing particle measurements after Canny (please see the attached code). Use connectivity 8, which searches for all adjecent pixels if they are a part of the same line segment (see the image below):
Ni Vision Concepts manual:
"With connectivity-4, two pixels are considered part of the same particle if they are horizontally or vertically adjacent. With connectivity-8, two pixels are considered part of the same particle if they are horizontally, vertically, or diagonally adjacent. The following figure illustrates the two types of connectivity."
Best regards,
K
07-11-2013 04:43 AM
Hi Klemen,
Thanks for the wonderful and simple solution to the problem. You made my task a lot easier now.
Thanks a lot.
Regards
Aveo
07-11-2013 04:47 AM
No problem.
Glad it helped you out!
Good luck with your project.
Best regards,
K