I thought that if you read in an image and then passed it into this method as a float matrix that it would work... but it gives an error.
import cv2
import numpy as np
img = cv2.imread('image.jpg')
hom_img = cv2.convertPointsToHomogeneous(img.astype(np.float32))
Error:
hom_img = cv2.convertPointsToHomogeneous(img.astype(np.float32)) cv2.error: OpenCV(4.5.5)
D:\a\opencv-python\opencv-python\opencv\modules\calib3d \src\fundam.cpp:1125: error: (-215:Assertion failed)
npoints >= 0 in function 'cv::convertPointsToHomogeneous'
source https://stackoverflow.com/questions/72369236/how-to-use-opencv-convertpointstohomogeneous-method
Comments
Post a Comment