Ask Your Question
0

How to warpPerspective a large image based on transform inferred from small region

asked 2020-11-13 08:24:39 -0600

updated 2020-11-13 14:09:18 -0600

I am using cv2.getPerspectiveTransform() and cv2.warpPerspective() to warp an image according to Adrian Rosenbrock blog : https://www.pyimagesearch.com/2014/08...

However in my case I have an image where I can only select the region B to be warped but need to warp (top-down view) the whole larger image A.

Can the parameters of the perspective transform inferred from the smaller region B be applied to the full image A? Is that possible?

image description

edit retag flag offensive close merge delete

Comments

  • Can the parameters of the perspective transform inferred from the smaller region B be applied to the full image A? Is that possible?

Yes. U can.

supra56 gravatar imagesupra56 ( 2020-11-16 08:15:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-11-15 08:45:47 -0600

crackwitz gravatar image

updated 2020-11-15 08:47:49 -0600

basically yes.

for a proper description of how, you'd need to demonstrate your problem more precisely. I'd suggest illustrations/pictures or very precise textual description.

at the very least, you can construct 3x3 matrices for translation and scaling and matrix-multiply them (from the left) onto the homography you calculated. that has the effect of moving the data in "screen space", i.e. in the result. to construct one such operation, you start with an identity matrix. for translation you change the top two values of the third column. for scaling you'd change the first two values on the diagonal. use separate matrices for each operation, then multiply them.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-13 08:24:39 -0600

Seen: 1,413 times

Last updated: Nov 15 '20