08-04-2014 05:59 AM
Hi Everyone,
I have an Image. In that, a circle object (plastic material) placed at centre with dark background. When the light is allowed to propagate through the plasic ring, It is getting disturbed by the cut made in that. When light allowed to pass through, we can see some lines (via camera) in the plastic ring. Now I need to count the number of lines in the plastic ring programatically using Vision. How to start this ??? I m new here, so please treat me like a baby...
Find the sample Image below.
I am using NI Vision assistant & Labview 8.2.1.
Thanks in Advance
08-05-2014 10:09 AM
If these are always the same shape, you could use an annulus to select the area with the lines. Use IMAQ Unwrap to straighten this out to a strip. Use IMAQ LinearAverages to get the average of the values in each column. Wiring this into Threshold Detector should give you a count of the peaks.
Bruce
08-06-2014 03:44 AM
Dear Bruce Ammons,
I have jus try to implement the idea you suggested me. But I get stuck when straightening the lines using IMAQ Unwrap. It always returing an error (Invalid ROI). Kindly find the code below and suggest me a solution.
08-06-2014 09:43 AM
After the image loads, use the mouse to create the annualus so that it's inner and outer circles surround your ring, then press the Enter key on your keyboard.
-AK2DM
08-06-2014 11:36 AM - edited 08-06-2014 11:38 AM
I followed the same procedure in Labview 8.2 and it doesnt work (Returns an error: Invalid ROI). Then I started the same programming in 2013 and its working good. I really dont know why ?????!!!!!!!!
Now the problem is different. After thresholding the image, it stays with some noise. I need to eliminate all and count the number of lines in the image. How to do that ???
Here I dont see any function like Threshold Detector like what BruceAmmons said.''
Refer the modified VI attached below.
08-06-2014 03:52 PM - edited 08-06-2014 03:55 PM
Hello,
I belive Mr. Ammons was refeering to the peak detector, for example: http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/peak_detector/
IMAQ also has such functions, under the "caliper" pallete I think.
Additionally, prior to peak detection I would apply a low-pass filter (box/smoothing or Gauss) on the unwrapped strip to atenuate the higher frequencies.
Best regards,
K
08-06-2014 05:26 PM
I assume you understand how to draw the annulus now.
I would not threshold the image. There is no reason to do that.
I agree with a smoothing filter being helpful.
If you use Quick Drop, you can type in the name of the vi and it will work. Threshold detector will count how many times the signal goes above a set level, so it will count your rings. You can do the same thing with peak detector, but it requires several steps.
Bruce
08-09-2014 03:18 AM
Hi BruceAmmons,
I found the Threshold detector and applied. It detects 76 lines in the Image. But there are totally 138 lines in the Image. Moreover, Everytime I need to select the annulus manually ( Because of this, No of lines found also keep on varying). But I want my code to automatically detect the Circle diameter, from that it should sketch the annulus. Is it possible ???
Consider the attached VI
08-09-2014 03:39 AM
This is the Idea, which I developed. I got my output. Please look into it. Notify me If there any Unwanted steps I used.
08-09-2014 10:46 AM
It could be many things. If you make the annulus too wide, or if it isn't centered on the circle, you will blur the lines too much to recognize the peaks. I also assume the Threshold Detector has a few parameters that could be adjusted.
Bruce