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 @@ -101,7 +101,7 @@ class Settings
101
101
}
102
102
else
103
103
{
104
- if (readStringList (input, imageList))
104
+ if (isListOfImages (input) && readStringList (input, imageList))
105
105
{
106
106
inputType = IMAGE_LIST;
107
107
nrFrames = (nrFrames < (int )imageList.size ()) ? nrFrames : (int )imageList.size ();
@@ -169,6 +169,16 @@ class Settings
169
169
l.push_back ((string)*it);
170
170
return true ;
171
171
}
172
+
173
+ static bool isListOfImages ( const string& filename)
174
+ {
175
+ string s (filename);
176
+ // Look for file extension
177
+ if ( s.find (" .xml" ) == string::npos && s.find (" .yaml" ) == string::npos && s.find (" .yml" ) == string::npos )
178
+ return false ;
179
+ else
180
+ return true ;
181
+ }
172
182
public:
173
183
Size boardSize; // The size of the board -> Number of items by width and height
174
184
Pattern calibrationPattern;// One of the Chessboard, circles, or asymmetric circle pattern
You can’t perform that action at this time.
0 commit comments