OpenCV perspective transform in python

前端 未结 3 1866
灰色年华
灰色年华 2021-01-14 10:47

I\'m trying to rectify an image in python. I have a Homography H (from a rotation matrix that rotates around the x, y and z axis) that looks like this for example: [

3条回答
  •  盖世英雄少女心
    2021-01-14 11:43

    The source and destination image must be floating point data.

    cv2.perspectiveTransform(src, m[, dst]) → dst

    Parameters:

    • src – input two-channel or three-channel floating-point array; each element is a 2D/3D vector to be transformed.
    • dst – output array of the same size and type as src.
    • m – 3x3 or 4x4 floating-point transformation matrix.

    Refer:http://docs.opencv.org/modules/core/doc/operations_on_arrays.html?highlight=perspectivetransform#cv2.perspectiveTransform

    So convert the 8U image to the appropriate datatype.

提交回复
热议问题