Commit 8347cb8c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added check for the board size

parent 84aed5d3
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment