add input paramter checking that verifies the existance of the input files to stero_match example
This commit is contained in:
parent
e40567eaee
commit
f83a76cdeb
@ -14,6 +14,7 @@
|
|||||||
#include "opencv2/core/utility.hpp"
|
#include "opencv2/core/utility.hpp"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
@ -143,6 +144,19 @@ int main(int argc, char** argv)
|
|||||||
return -1;
|
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) )
|
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");
|
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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user