mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Solve issue #8264
Fix bug in camera_calibration.cpp that the program tries to parse input of type VIDEO_FILE as IMAGE_LIST which causes the program to crash.
This commit is contained in:
parent
220d1f0b3e
commit
17ece5861a
@ -109,7 +109,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (readStringList(input, imageList))
|
if (isListOfImages(input) && readStringList(input, imageList))
|
||||||
{
|
{
|
||||||
inputType = IMAGE_LIST;
|
inputType = IMAGE_LIST;
|
||||||
nrFrames = (nrFrames < (int)imageList.size()) ? nrFrames : (int)imageList.size();
|
nrFrames = (nrFrames < (int)imageList.size()) ? nrFrames : (int)imageList.size();
|
||||||
@ -190,6 +190,16 @@ public:
|
|||||||
l.push_back((string)*it);
|
l.push_back((string)*it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isListOfImages( const string& filename)
|
||||||
|
{
|
||||||
|
string s(filename);
|
||||||
|
// Look for file extension
|
||||||
|
if( s.find(".xml") == string::npos && s.find(".yaml") == string::npos && s.find(".yml") == string::npos )
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
Size boardSize; // The size of the board -> Number of items by width and height
|
Size boardSize; // The size of the board -> Number of items by width and height
|
||||||
Pattern calibrationPattern; // One of the Chessboard, circles, or asymmetric circle pattern
|
Pattern calibrationPattern; // One of the Chessboard, circles, or asymmetric circle pattern
|
||||||
|
Loading…
Reference in New Issue
Block a user