How can I use matlab to do homographies knowing the rotation angles?

3 views (last 30 days)
I want to use matlab to do project/warp images using homographies. I've computed the homography matrix using the equation H = K * R1 * R0^-1 * K^-1, where H is the homography matrix, K is the camera intrinsic matrix, R1 is the final orientation matrix and R0 is the initial orientation matrix. The rotation matrix is computed based on where I want the camera to look at and where it was looking at when the photo was taken; I then use tform = maketform ('projective', H) and I_reg=imtransform(I, tform), where I is the image and I_reg is the registered image, but the results are not correct. What can I be doing wrong?
  9 Comments
he
he on 27 Apr 2014
I don't konow what do you mean.Do you mean that we must use x*H ?I just wonder am I right?x is the cordinate of a point,its size is 3X1,and the size of H is 3X3,so x*H is wrong.Another question,there are a lot of method to get H,can H = K * R1 * R0^-1 * K^-1 be used to project one image to another?Thank you for read!
Guilherme
Guilherme on 7 May 2014
You must transpose x and H before multiplying by H. If you have H (3*3) and x (3*1), you to transpose H and get H' (3*3) and transpose x and get x' (1*3) and multiply x'*H'
Yes, H can be used to get to project and image into another image. If R0 is the current orientation of the image, if must compute R1 (the desired orientation of the image) and use H = K* R1 * * R0^-1* K^1.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!