05-10-2009 02:03 PM
Hello. I have a small issue. The situation is: I have an image [a cylindrical shaft]. I made a picture to it using a digital camera using backlight. The problem is that when I apply a Threshold the profile of the part becomes jagged.
Now what i need is a way to perform a linear fit or some other function in order to obtain a profile line which i could use further to measure the dimensions of the part.
Andrei
05-11-2009 01:06 PM
Hi Andrei:
Not really sure what the problem is. Can you post the images you are using so we can see what you're talking about? Also, are you doing the thresholding in LabVIEW?
05-11-2009 01:25 PM - edited 05-11-2009 01:29 PM
Hi mr. Person
Thank you for the reply.
I forgot to attach some images, my bad 😞 . I use threshold function in vision assistant. I am also attaching the script.
My problem is that when I apply the threshold the profile of the line is not straight, it has some pixels in certain areas which make the line profile a little bit jagged. I have to measure the dimensions of the part. I used a 6Mpx DSLR camera to achieve a verry good precision.
The images are basically the same. I have five parts but the difference between them is small.
Andrei
05-11-2009 04:07 PM
Hi Andrei:
I see what you're saying. The first thing I would start with is to make sure your screen is clean in the background. It looks like there are some spots there that are causing some unevenness on the edges.
The next thing you can do is an erode and then a dilate function found under Gray Morphology. You can then finish it off with an FFT Truncate filter. This will smooth it out quite a bit more but also rounds the corners which may or may not work for your application.
I guess my final question is how smooth does this need to be? I think it's pretty unlikely that you'll get the edges perfectly smooth and you probably don't need them to be. Try measuring it with a clamp function (or whatever) and see if it's accurate enough for your application.
05-12-2009 02:35 AM
Hello, mr Person
I need to measure the part within a +0.2 mm interval.
I tried the steps you indicated but when I try to use the algorithm on another image I get bad readings.
I was thinking to use a linear fit on the image by using the least squares [i hope i remembered correctly] to obtain the medium profile line. Is it possible to do so ? And if so do I need to separate each segment of the part profile and then reassemble it ?
Andrei
05-14-2009 05:48 PM