2

I want to Perspective Transform an image zone around a marker. This zone is of course located inside a larger image. For this, I:

1) findHomography the transformation matrix Homo based only on the marker corners,

then:

2) I apply perspectiveTransform with Homo to the corners of the larger zone around the marker to find the corners of a crop area in the perspective transformed larger image.

Then I:

3) warp the entire image with Homo and:

4) crop the area (defined above at step 2) inside the transformed image.

The idea is to perspective transform an image by blocks and then assemble the different blocks together. (the images were taken without calibrating the camera, hence appear distorted differently from an area to another)

The problem arises at step 2) : the coordinates of the transformed corners are negative, how must I compute a correct offset to these in order to find the proper area in the transformed image?

I have already researched this. For example here:

cv::warpPerspective only shows part of warped image

but I don't understand which value I have to give to w and h in the link above to comply with my case?...

The explanation in the link above is a bit confusing to me, so if anyone could clarify this point in more detail and/or with an example, this will help for sure!

Any help would be greatly appreciated!

Thanks in advance, John

Community
  • 1
  • 1

0 Answers0