diff --git a/samples/cpp/stereo_calib.cpp b/samples/cpp/stereo_calib.cpp index ad7c49c7d8..0dc429f411 100644 --- a/samples/cpp/stereo_calib.cpp +++ b/samples/cpp/stereo_calib.cpp @@ -286,14 +286,14 @@ StereoCalib(const vector& imagelist, Size boardSize, bool useCalibrated= int w, h; if( !isVerticalStereo ) { - sf = 1;//600./MAX(imageSize.width, imageSize.height); + sf = 600./MAX(imageSize.width, imageSize.height); w = cvRound(imageSize.width*sf); h = cvRound(imageSize.height*sf); canvas.create(h, w*2, CV_8UC3); } else { - sf = 1;//300./MAX(imageSize.width, imageSize.height); + sf = 300./MAX(imageSize.width, imageSize.height); w = cvRound(imageSize.width*sf); h = cvRound(imageSize.height*sf); canvas.create(h*2, w, CV_8UC3); @@ -387,6 +387,11 @@ int main(int argc, char** argv) imagelistfn = "stereo_calib.xml"; boardSize = Size(9, 6); } + else if( boardSize.width <= 0 || boardSize.height <= 0 ) + { + cout << "if you specified XML file with chessboards, you should also specify the board width and height (-w and -h options)" << endl; + return 0; + } vector imagelist; bool ok = readStringList(imagelistfn, imagelist);