Merge remote-tracking branch 'upstream/master'
authorBrian Park <brianspark@hotmail.com>
Thu, 30 Oct 2014 06:15:22 +0000 (23:15 -0700)
committerBrian Park <brianspark@hotmail.com>
Thu, 30 Oct 2014 06:15:22 +0000 (23:15 -0700)
samples/cpp/stereo_match.cpp

index f5f77cf..ad4670f 100644 (file)
@@ -14,6 +14,7 @@
 #include "opencv2/core/utility.hpp"
 
 #include <stdio.h>
+#include <sys/stat.h>
 
 using namespace cv;
 
@@ -143,6 +144,19 @@ int main(int argc, char** argv)
         return -1;
     }
 
+    struct stat stat_buffer;
+    if (stat(img1_filename, &stat_buffer) != 0)
+    {
+        printf("Command-line parameter error: could not find the first input image file\n");
+        return -1;
+    }
+
+    if (stat(img2_filename, &stat_buffer) != 0)
+    {
+        printf("Command-line parameter error: could not find the second input image file\n");
+        return -1;
+    }
+
     if( (intrinsic_filename != 0) ^ (extrinsic_filename != 0) )
     {
         printf("Command-line parameter error: either both intrinsic and extrinsic parameters must be specified, or none of them (when the stereo pair is already rectified)\n");