1 | initial version |
I had the same issue as you. The reason this is happening is because the lines TLTR and BLBR have an intersection (vanishing point/infinity) that falls within the image. When this happens, the corners of your original image fall "beyond infinity" and the transformation gives you wrong numbers.
I have described the issue here: https://github.com/opencv/opencv/issues/18698