samples: use findFile() in "cpp"
This commit is contained in:
committed by
Alexander Alekhin
parent
2fa9bd221d
commit
c4c31f5bba
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user