Ask Your Question
1

The relationship between Homography matrix and scaling images

asked 2014-01-06 21:37:41 -0600

我干过豪哥 gravatar image

I have compute the Homography matrix H1 between two images,after that I just use function "resize(orign_image,img,Size(),workscale,worscale)".finally I want to get a H'to apply to the img which has been resized,but the H1 or H'(H1 *workscale)cann't work.So I hope someone can help me get correct H' that can be applied to resized imgs.^_^

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
4

answered 2014-01-06 22:02:55 -0600

Nghia gravatar image

updated 2014-01-06 22:03:30 -0600

You probably want

Mat H2 = S * H1 * inv(S);

Where S is

Mat S = Mat::eye(3,3,CV_64F);

S.at<double>(0,0) = scale_x;
S.at<double>(1,1) = scale_y;
edit flag offensive delete link more

Comments

Thanks Bro!! your answer is correct,I have solved it^_^

我干过豪哥 gravatar image我干过豪哥 ( 2014-01-07 22:25:55 -0600 )edit
1

answered 2014-01-06 23:56:53 -0600

updated 2014-01-07 00:03:40 -0600

After computing the homography matrix you must use the perspectiveTransform function instead of the resize function.For more information please see this link.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-01-06 21:37:41 -0600

Seen: 5,379 times

Last updated: Jan 07 '14