I'm trying to read an image using OpenCV, where I did the following:
input_image = imread(argv[1], IMREAD_UNCHANGED);
if(input_image.empty())
{
cout<<"Image cannot be read";
return -1;
}
I'm using Xcode 6.4, and would like to pass two arguments, one for the input image and another for the output image.
So, I did the following in order to pass the argument:
Product --> Scheme --> Edit Scheme...
And, under Arguments, added two arguments: image1.png and image2.png.
I had only image1.png, which I added to the directory containing main.cpp. But, when I try to run the program, the input image seems not to be read, since the above if-statement evaluates to true, and I get the error message.
Why is that? What could I be doing wrong?
Thanks.