added check for the board size

This commit is contained in:
Vadim Pisarevsky 2010-12-04 13:45:58 +00:00
parent 84aed5d360
commit 8347cb8cf7

View File

@ -286,14 +286,14 @@ StereoCalib(const vector<string>& 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<string> imagelist;
bool ok = readStringList(imagelistfn, imagelist);