File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
samples/cpp/tutorial_code/calib3d/camera_calibration Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ class Settings
109
109
}
110
110
else
111
111
{
112
- if (readStringList (input, imageList))
112
+ if (isListOfImages (input) && readStringList (input, imageList))
113
113
{
114
114
inputType = IMAGE_LIST;
115
115
nrFrames = (nrFrames < (int )imageList.size ()) ? nrFrames : (int )imageList.size ();
@@ -190,6 +190,16 @@ class Settings
190
190
l.push_back ((string)*it);
191
191
return true ;
192
192
}
193
+
194
+ static bool isListOfImages ( const string& filename)
195
+ {
196
+ string s (filename);
197
+ // Look for file extension
198
+ if ( s.find (" .xml" ) == string::npos && s.find (" .yaml" ) == string::npos && s.find (" .yml" ) == string::npos )
199
+ return false ;
200
+ else
201
+ return true ;
202
+ }
193
203
public:
194
204
Size boardSize; // The size of the board -> Number of items by width and height
195
205
Pattern calibrationPattern; // One of the Chessboard, circles, or asymmetric circle pattern
You can’t perform that action at this time.
0 commit comments