Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a repeatable angle result in object(a black square) rotation measurement

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!

0 Kudos
Message 1 of 4
(4,791 Views)

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!

0 Kudos
Message 2 of 4
(4,779 Views)

Why don't you use pattern match?

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 3 of 4
(4,775 Views)

Thanks MoviJOHN!

 

I  used pattern match first to get the angle,the result is un-repeatable. But I use pattern match to get the position of the black square,for angle,I used find edge,from four different direction and calculate the mean of four angle,this is much better than pattern match.

 

 

0 Kudos
Message 4 of 4
(4,740 Views)