Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Camera ChArUco calibration errors

0 votes

I am trying to calibrate the jevois camera with a 120 degree fisheye lens using this guide: http://jevois.org/tutorials/UserArUcoCalib.html

I have printed out the charuco board on a piece of A4 paper, measuring the ml=17mm, sl=30mm, and running the command:

./calibrate_camera_charuco -d=0 -h=5 -w=8 --ml=17 --sl=30 --rs --sc calibration.yaml

The problem is that after hitting esc to to do the calibration on the pictures I've taken, I usually get this error message:

OpenCV Error: Assertion failed (nCorners > 0 && nCorners == _charucoCorners.getMat(i).total()) in calibrateCameraCharuco, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/contrib/modules/aruco/src/charuco.cpp, line 703
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/opencv-L2vuMj/opencv-3.2.0+dfsg/contrib/modules/aruco/src/charuco.cpp:703: error: (-215) nCorners > 0 && nCorners == _charucoCorners.getMat(i).total() in function calibrateCameraCharuco

and sometimes this error:

OpenCV Error: One of arguments' values is out of range (The number of points in the view #2 is < 4) in cvCalibrateCamera2Internal, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/calibration.cpp, line 1396
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/calibration.cpp:1396: error: (-211) The number of points in the view #2 is < 4 in function cvCalibrateCamera2Internal

But if I take several pictures of the board mostly flat in front of the lens it completes the calibration without error.

I am running it on Ubuntu 18.04 virtualbox from a Windows 10 host. Using the video mapping YUYV 640 500 20.0 YUYV 640 480 20.0 JeVois DemoArUco   

Does anyone have any idea why this happens? I'm grateful for any tips.

asked Jul 25, 2019 in User questions by stian (160 points)

1 Answer

+1 vote
 
Best answer

It looks like either you are not getting enough detected corners, or they are not good. Maybe the problem is that you are running the ArUco detector in the camera? You should be configuring your camera as a dumb pass-through camera, as follows:

YUYV 1280 720 10.0 YUYV 1280 720 10.0 JeVois PassThrough

or use 640x480 if that is the calibration you want to create. Just to be sure, delete all other video mappings in your videomappings.cfg on the camera, so that this one is the one that will be picked.

Please see section on "Preparing your JeVois Camera" at http://jevois.org/tutorials/UserArUcoCalib.html
You do not want the camera itself to detect the markers and then draw their outlines and then send that video with the outlines to your PC. You want the camera to just send a plain image to the PC. The PC will then detect the markers and draw the green lines and small red squares you see in the screenshot of that tutorial.
answered Jul 31, 2019 by JeVois (46,580 points)
selected Jul 31, 2019 by stian
...