Ask Your Question
0

Re-sizing a perspective transformation

asked 2015-08-21 03:14:35 -0600

Nbb gravatar image

Hello forum,

I have a Homography Matrix that was computed from 2 static videos ( Video A and Top View ) both with a resolution of 1920 x 1080.

I would like to increase the speed so I have resized Video A to 960 x 540 before applying the Homography Matrix. Then I resize the image by x2 and use the addWeighted function with Top View. The problem is, I am not getting any output from Video A ie. the final result is just the Top View.

I hope I can get some help on this.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-21 10:37:54 -0600

LBerger gravatar image

If m1, m2 are your original images and you reduce size :

 resize(m1, m1r, Size(),0.5,0.5);
 resize(m2, m2r, Size(),0.5,0.5);

src are points in m1r and dst in m2r then you have to change last column of h

Mat h=findHomography(src,dst);
h.at<double>(0,2) *=2;
h.at<double>(1,2) *=2;

you can check that it's OK with

warpPerspective(m1, m3, h, Size(m1.cols,m1.rows));

m3 must be like m2

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-21 03:14:35 -0600

Seen: 102 times

Last updated: Aug 21 '15