Calibration Problem

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);

blame your images, and your board
(which has to be ABSOLUTELY FLAT)

an error of 192 is really quite a lot. I don’t think that can be entirely explained by the pattern being a little warped and the corners being a little off. the warped pattern needs to be fixed but there must be more going on here that you haven’t shown to us.

present the entire MRE including data. make sure it’s small. you’re asking other people to spend time on your problem. make it easy.