09-17-2013 10:45 AM
Hi
i was wondering how to use two patterns to calculate if one is out of position or not.
Take an Object like a dish with a pattern in the top right corner of the dish. This pattern is always fixed in position. Then another pattern is printed on the dish, sometimes this pattern is printed out of position and it need to be rejected if done so.
would you calculate the distance between the patterns for a know good dish or use the X Y offsets or how would this be done? Thanks
09-17-2013 09:40 PM
You 'd better use both X and Y offset as a limit.
09-18-2013 01:51 AM - edited 09-18-2013 01:54 AM
Hello,
I agree to use the offset in U and V direction.
Is the reference pattern circular or does it have a more distinct shape? Is your background uniform (the area where the reference pattern is positioned)? Is the camera position constant?
You should find the reference pattern first and apply a reference coordinate system. In the next step, you can measure the offset from this reference coordinate system. If your position of the reference pattern is repeatable (so that every sample with its reference pattern is in the same position every time), then you even don't need the coordinate system to be able to calculate the offset.
You should also calibrate the camera to correct the lens distortion. The tangential component should not be a problem with most cameras as this error is mostly the result of the lens misalignment, but the radial error usually enlarges when moving away from the optical center of the camera. I do not know what kind of setup you have.
Best regards,
K
09-18-2013 02:09 PM
thanks both patterns have a distinct feature.
if the first pattern returned x,y,angle and the second pattern returned x,y,angle is it simply a case of calculating the x y offsets. What about determining if the second pattern is rotated?
09-20-2013 12:31 AM
Hello,
i have attached a simple example created in NI assistant in LV2013 (I am saying this, because the pattern matching algorithms were upgraded since LV2012. It is saved for LV2010, so i hope you can make it work).
In the attachment there are two images and two templates. The algorithm calculates the offset difference and the angular difference. Keep in mind that the origin of the image coordinate system is in the top-left corner.
Tell me if you have any problems with it.
Hope this helps,
K