08-21-2013 08:51 PM
Hi everyone!
This attached image below shown the image taken from live video and I want to measure the distance between two white dots (from the center) without drawing a line to measure it. How can it be done?
Thanks in advance.
08-21-2013 09:08 PM
Do you know the location of the dots? If so, just use trigonometry.
08-25-2013
10:28 PM
- last edited on
01-29-2025
06:25 PM
by
Content Cleaner
Hi Enriquez,
For this kind of task you need NI Vision Development Module for LabVIEW. If you have it, then you can use the included Vision Assistant to design the algorithm and preview the results immedately. Here is one possible way (may not be the optimum one):
- Convert your RGB image to binary by using Color Threshold operation such that value '1' is assigned to the white dots and the rest is '0' (not of interest).
- Dilate the dots using Morphology operation to make the dots bigger (as long as they do not overlap).
- Use Circle Detection operation to locate the dots' center.
- Use Caliper operation to calculate the distance between two dots.
Screenshot:
The result I got was 93 pixels distance between a pair of horizontal dots, which you can then scale to real-world value. Above operations can be converted to LabVIEW VI for your use (Tools >> Create LabVIEW VI). In LabVIEW you can further customize the code to fit your requirements. For example, you can define a Region of Interest (ROI) that only includes two horizontal dots.
For more information, consult the Help files of NI Vision. You can try posting to the Machine Vision board as well to get better response. Hope this helps.
Regards,
Yodha
NI Singapore