Если бы преобразование было правильным, вертикальная зеленая линия в центре изображения также должна была бы находиться посередине оси X результирующего изображения, но это не так. Хорошо видно, что левая часть растянута, а правая сжата.
Исходное изображение с указанием конверсии ->

Выходное изображение ->

код такой
Код: Выделить всё
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
public class ImagePerspective {
static { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
/**
* Transforms an image using four points, adjusting the size of the output image to be
* as large as possible based on the points and the aspect ratio.
*
* @param fileIn Path to the input image.
* @param points Four points in the original image defined in the following order:
* - (x1, y1): top-left
* - (x2, y2): top-right
* - (x3, y3): bottom-right
* - (x4, y4): bottom-left
* @param fileOut Path where the transformed image will be saved.
* @param aspectRatio Width/height ratio of the output image.
Подробнее здесь: [url]https://stackoverflow.com/questions/79354968/opencv-perspective-correction-problem-nonlinear[/url]