dakotabenjamin / CameraCalibration

GNU General Public License v3.0
33 stars 19 forks source link

OpenCV error #4

Closed dakotabenjamin closed 7 years ago

dakotabenjamin commented 7 years ago

@theincorrect please paste your command call and error below

theincorrect commented 7 years ago

I had this error.

root@test-08:/home/kg.ru/kornev/calibration# python opencv_calibrate.py /home/kg.ru/kornev/chessboard/*.jpg DEBUG:/home/kg.ru/kornev/chessboard/*.jpg img: [] OpenCV Error: Assertion failed (nimages > 0) in calibrateCamera, file /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/modules/calib3d/src/calibration.cpp, line 3415 Traceback (most recent call last): File "opencv_calibrate.py", line 98, in <module> rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h), None, None) cv2.error: /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/modules/calib3d/src/calibration.cpp:3415: error: (-215) nimages > 0 in function calibrateCamera

After checking that directory and files do exist I've noticed that file names are in upper case. So now I have another error.

root@test-08:/home/kg.ru/kornev/calibration# python opencv_calibrate.py /home/kg.ru/kornev/chessboard/*.JPG DEBUG:/home/kg.ru/kornev/chessboard/DJI_0017.JPG Traceback (most recent call last): File "opencv_calibrate.py", line 53, in <module> os.mkdir(debug_dir) OSError: [Errno 17] File exists: '/home/kg.ru/kornev/chessboard/DJI_0017.JPG'

dakotabenjamin commented 7 years ago

Yeah i am running into that error too.

dakotabenjamin commented 7 years ago

Currently overhauling the argument parser. I think as a workaround you can specify --debug /home/kg.ru/kornev/chessboard/

theincorrect commented 7 years ago

Worked like a charm! Thank you, you made me smile again. )

dakotabenjamin commented 7 years ago

With recent push you don't need to specify anymore.

dakotabenjamin commented 7 years ago

Let me know if you this fixes for you.

Also look at the readme for usage instructions

theincorrect commented 7 years ago

Yep, it works now. Though I'm getting processing DJI_0023.JPG... chessboard not found with @pierotofy's set of photos.

Launching parameters are: python opencv_calibrate.py /home/kg.ru/kornev/chessboard/ 10 7

theincorrect commented 7 years ago

Oh, it's the problem with calibration chessboard size parameters. We have to use 9 and 6 instead of actual 10 and 7.

theincorrect commented 7 years ago

@dakotabenjamin You can close this issue now. The problem was solved.