When using the calibrateCamera function I am seeing a very large number being returned for the reprojection error for example in my last test the returned value was 192.15
I have included the code I am using along with an example of one of the chessboard images I am using, if anyone has any ideas or if anyone needs more information please let me know.
int boardH = 8,
boardV = 5;
Size board_sz = new Size(boardH, boardV);
for (int j = 0; j < boardH*boardV; j++)
obj.push_back(new MatOfPoint3f(new Point3(j / boardV, j % boardH, 0.0f)));
File dirFiles = this.getFilesDir();
for (String strFile : dirFiles.list())
{
File file = this.getFileStreamPath(strFile);
String extension = file.getAbsolutePath().substring(file.getAbsolutePath().lastIndexOf("."));
if (extension.equals(".jpg")) {
Bitmap bmp = BitmapFactory.decodeFile(file.getAbsolutePath());
Mat imageMat = new Mat();
Mat grayMat = new Mat();
Utils.bitmapToMat(bmp, imageMat);
Imgproc.cvtColor(imageMat, grayMat, Imgproc.COLOR_RGB2GRAY);
imageSize = imageMat.size();
MatOfPoint2f corners = new MatOfPoint2f();
boolean found = Calib3d.findChessboardCorners(grayMat, board_sz, corners);
if (found) {
Imgproc.cornerSubPix(grayMat, corners, board_sz, new Size(-1, -1), new TermCriteria(TermCriteria.EPS, 30, 0.001));
img_points.add(corners);
obj_points.add(obj);
}
Log.i(LOGTAG, "Found " + corners.size() + " " + found);
}
}
double error = Calib3d.calibrateCamera(obj_points, img_points, imageSize, intrinsic, distCoeffs, rvecs, tvecs);
Log.i(LOGTAG, "error " + error);