Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Affine Transformation on image

I want to apply a affine transformation on a image. I know some (at least 3) points on the current image and the same points on the "new image" (after the affine transformation).

 

I can not use the function from matlab or opencv to perform the geometric operation and only find basic operation like rotation or translation in the vision module

0 Kudos
Message 1 of 9
(4,032 Views)

You should look at the calibration functions. An affine transform is a subset of the perspective transform that the calibration functions provide.

 

Kevin

0 Kudos
Message 2 of 9
(4,015 Views)

Thanks for your answer.

 

I actually manage to implement in labview the transformation affine and the estimation of its matrix, once I really understand the bilinear interpolation

0 Kudos
Message 3 of 9
(3,983 Views)

Sometimes it is easier to work with image in the form of 2D array (especially if you are working with grayscale image).

In that case Functions>>Mathematics>>Geometry pallet should be exactly what you need.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 4 of 9
(3,954 Views)

Do you have a VI fo the affine tranformation? for 3 points?

0 Kudos
Message 5 of 9
(3,307 Views)

@ilanm wrote:

Do you have a VI fo the affine tranformation? for 3 points?


Maybe kl3m3n posted something you're looking forward: https://decibel.ni.com/content/blogs/kl3m3n/2015/04/24/homography-mapping-calculation-labview-code

0 Kudos
Message 6 of 9
(3,209 Views)

Hello,

 

write the equation for affine transformation and solve it. You need 3 point pairs for this. If you have more points, you could use a least-squares approach.

 

If you don't like coding, you can use OpenCV's functions getAffineTransform() and estimateRigidTransform(), respectively. Just perform a .dll call - there are a lot of examples online.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 7 of 9
(3,174 Views)

Hello,

 

to help you a bit further, here is an example of calculating the affine transformation (least square), provided you know the three corresponding point pairs.

 

Example_VI_BD.png

 

Hope this helps.

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 8 of 9
(3,157 Views)

Exactly what I was looking for.  Thank you!

0 Kudos
Message 9 of 9
(461 Views)