Ask Your Question
0

point outside image with getPerspectiveTransform

asked 2018-07-25 04:54:27 -0500

simon884 gravatar image

Hi all,

I try to make a perspective transform, all works fine if I use 4 points and if this 4 points are in the picture, but I have a question, is it possible to give one or two point outside image? for example with this image :

image description

I would like to do somthing like this when I take coordinates point:

image description

Like you can see on the above image P1 and P4 are outside image, if I want to have a good quadrilateral. Is there solution to solve this problem ? And I have another question, what is the maximum angle (between camera and plane, it's call FOV I'm not sure...) before opencv makes a bad image ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-25 08:43:01 -0500

you can try warpPerspective_demo.cpp and adding a border on the image maybe useful.

Mat original_image = imread( filename );
copyMakeBorder(original_image, original_image, 100, 100, 100, 100, BORDER_CONSTANT, Scalar(0, 0, 0));

image description

edit flag offensive delete link more

Comments

nice thanks for the advice !

simon884 gravatar imagesimon884 ( 2018-07-25 10:10:52 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-07-25 04:54:27 -0500

Seen: 110 times

Last updated: Jul 25 '18