I am trying to use the homography transform function but am getting this error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-21-9d9128efcecc> in <module>()
---> 33 im_dst = cv2.warpPerspective(im, h, (im.shape[1],im.shape[0]))
TypeError: M data type = 19 is not supported
Below is my code
import numpy as np
import cv2
import matplotlib.pyplot as plt
# read homography matrix
h = []
with open('/home/ast/datasets/ewap/seq_eth/H.txt', 'r') as f:
for line in f:
print(line.strip().split())
h.append(line.strip().split())
h = np.array(h)
# read image
im = cv2.imread('/home/haziq/datasets/ewap/seq_eth/seq_eth_1.jpg')
# transform
im_dst = cv2.warpPerspective(frame, h, (im.shape[1],im.shape[0]))
Here is the doc for the warpperspective()
function https://docs.opencv.org/3.0-beta/modules/imgproc/doc/geometric_transformations.html?highlight=warpperspective#void%20warpPerspective(InputArray%20src,%20OutputArray%20dst,%20InputArray%20M,%20Size%20dsize,%20int%20flags,%20int%20borderMode,%20const%20Scalar&%20borderValue)