11-02-2013 12:03 PM
Hi,
I am new to machine vision. I need to lacate the position and rotation angle of a black square,please see the attach.the square is about 5*5mm,and pixel resolution is 659*454.The square is print on paper,so the light source is annular.the black square can be 3 mm(Max) away from image centre and can be rotated less than 5 degrees according to the camera.
I used pattern match.vi to macth the black square, the position result is good enough,I get 100 images from camera continuously,the Max difference of position is no more than 1/2 pixel,but the rotation angle is much different,may 2 or 3 degree,sometime event more.
Then I tried to use "geometric matching.vi",the results event worse,then I used "Find Straight edge" or "Adv Straight edge",searching edge from four different direction and calculate the mean of four angle,the mean angle result is better,the Max. different is about 0.6 degree,but still not good enough.
Then I tried to use bigger size(say 50 ) of structuring element of Auto Median in Gray Morphology,I found that, the rotation of black square more closer to 0 degree,the result is much better,the pattern match.vi return the same angle from almost all the image,but when the rotation of black square is about 3 degree,the difference came out.
So,my question is,is there any way to make a repeatable rotation measurement? So far,I just try pattern match,geometric match,find straight edge.or just because the quality of my image is too poor to perform rotation measurement,like no enough contrast. Do I need to calibrate my system?
Appreciate for your time! Thank you.
Best Wishes!
11-03-2013 10:49 AM
I am keep working on this problem today.
I tried Particle Analysis, the result is un-repeatable either. But when I decide to find Straight edge direct from source image,without any process,the angle is more repeatable,Max deviation is 0.03-0.06 degree.It seems my process to the image make thing worse.Then I found the algorithm to find straight is something like linear fit : find all the edge points,linear fit and calculate the angle.
So I run my program for images those pixel resolution is 1280*960,the Max deviation is much lower: 0.008 degree.
If I am right,the best resolution to my problem is to change my camera to higher resolution.
Any advises is appreciate! Thank you!
11-03-2013 03:34 PM
Why don't you use pattern match?
11-06-2013 08:52 AM