samples: use findFile() in "cpp"

This commit is contained in:
Alexander Alekhin
2018-10-31 15:48:56 +03:00
committed by Alexander Alekhin
parent 2fa9bd221d
commit c4c31f5bba
52 changed files with 359 additions and 286 deletions
+3 -3
View File
@@ -59,12 +59,12 @@ static void updateBrightnessContrast( int /*arg*/, void* )
static void help()
{
std::cout << "\nThis program demonstrates the use of calcHist() -- histogram creation.\n"
<< "Usage: \n" << "demhist [image_name -- Defaults to ../data/baboon.jpg]" << std::endl;
<< "Usage: \n" << "demhist [image_name -- Defaults to baboon.jpg]" << std::endl;
}
const char* keys =
{
"{help h||}{@image|../data/baboon.jpg|input image file}"
"{help h||}{@image|baboon.jpg|input image file}"
};
int main( int argc, const char** argv )
@@ -78,7 +78,7 @@ int main( int argc, const char** argv )
string inputImage = parser.get<string>(0);
// Load the source image. HighGUI use.
image = imread( inputImage, 0 );
image = imread(samples::findFile(inputImage), IMREAD_GRAYSCALE);
if(image.empty())
{
std::cerr << "Cannot read image file: " << inputImage << std::endl;