New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python fisheye.stereoCalibrate: Assertion failed objectPoints.type() #11085
Comments
Meanwhile also tested with OpenCV 3.4.1 via Case 1
Case 2
|
I found a workaround (similar to #5534) K_left = np.zeros((3, 3))
D_left = np.zeros((4, 1))
K_right = np.zeros((3, 3))
D_right = np.zeros((4, 1))
R = np.zeros((1, 1, 3), dtype=np.float64)
T = np.zeros((1, 1, 3), dtype=np.float64)
N_OK = len(imgpoints_left)
objp = np.zeros( (CHECKERBOARD[0]*CHECKERBOARD[1], 1, 3) , np.float64)
objp[:,0, :2] = np.mgrid[0:CHECKERBOARD[0], 0:CHECKERBOARD[1]].T.reshape(-1, 2)
objpoints = np.array([objp]*len(imgpoints_left), dtype=np.float64)
imgpoints_left = np.asarray(imgpoints_left, dtype=np.float64)
imgpoints_right = np.asarray(imgpoints_right, dtype=np.float64)
objpoints = np.reshape(objpoints, (N_OK, 1, CHECKERBOARD[0]*CHECKERBOARD[1], 3))
imgpoints_left = np.reshape(imgpoints_left, (N_OK, 1, CHECKERBOARD[0]*CHECKERBOARD[1], 2))
imgpoints_right = np.reshape(imgpoints_right, (N_OK, 1, CHECKERBOARD[0]*CHECKERBOARD[1], 2))
(rms, K_left, D_left, K_right, D_right, R, T) = \
cv2.fisheye.stereoCalibrate(
objpoints,
imgpoints_left,
imgpoints_right,
K_left,
D_left,
K_right,
D_right,
img_size,
R,
T,
calibration_flags
) Now the arrays have the format
and |
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085 unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
* fix #503: set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085 unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate * removed commented line; trimmed whitespace at line endings
* fix ros-perception#503: set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085 unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate * removed commented line; trimmed whitespace at line endings
how to define imgpoints_left and right please tell?? |
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
@philipptrenz, as I understand it, a modified example is used from here. The images you are using are missing, as well as the complete code. |
reproducer.py.txt |
As I understand it, the problem is the extra dimension of the arrays
Also, I noticed that regardless of the input data type, stereoCalibrate works with |
checked cv.Mat wrapper #20558
Here is all the code: |
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
set_cammodel of StereoCalibrator need to override the method of parent class fix related to opencv/opencv#11085: unlike cv2.calibrate, the cv2.fisheye.calibrate method expects float64 points and in an array with an extra dimension. The same for cv2.stereoCalibrate vs cv2.fisheye.stereoCalibrate Trimmed whitespace at line endings
System information
Detailed description
While
cv2.fisheye.calibrate()
works with both versions of objp as intented,cv2.fisheye.stereoCalibrate()
throws errors. Curiously different ones,in function cv::internal::projectPoints
andin function cv::fisheye::stereoCalibrate
.This could be related to #5534
Steps to reproduce
Case 1
Case 2
The text was updated successfully, but these errors were encountered: