I am trying to pass custom object points and image points into cv2.calibrateCamera()
. By custom points I mean points I have calculated without finding chessboard patterns. I'm trying to only warp the image horizontally (x direction) and I'm using the image points as a "map from" and object points as a "map to".
My object points look like this:
[[[ 254.1 0. 0. ]]
[[ 268.40825 0. 0. ]]
[[ 282.7165 0. 0. ]]
...
[[1541.8425 1080. 0. ]]
[[1556.15075 1080. 0. ]]
[[1570.459 1080. 0. ]]]
code:
object_points = np.empty((0, 1, 3))
for p in range(0, 1081, 5):
for q in range(0, 93):
t = 0.1075 * q
object_points = np.append(object_points, [[[get_undistorted_value(t), float(p), 0.0]]], axis=0)
But I get an error when passing them to calibrateCamera()
.
objectPoints should contain vector of vectors of points of type Point3f in function 'cv::collectCalibrationData'
Isn't this meant for c++? How do I format the image points and object points for python?
source https://stackoverflow.com/questions/72418937/how-to-format-object-points-for-cv2-calibratecamera-opencv
Comments
Post a Comment