How to pass values to main function (vs2015,opencv,c++)
if i have downloaded the code from somewhere lets say its abc.cpp and its having main as :
int main(int argc, char* argv[])
{
Mat image;
if (argc>1)
image = imread(argv[1]);
else
{
cout << " Usage: " << argv[0] << " <input_image> [<gt_word1> ... <gt_wordN>]" << endl;
return(0);
}}
how should i run this code ?? normally from the vs platform??? how to pass the image to be read????
how can we give values to argc or argv??? i have gone thru all the other similar questions here but dint found any solution to my problem??
argv will contain any strings passed as command line arguments, and argc will contain the number of arguments. So either run your executable from the command line with the image path added afterwards, or set up the command line arguments in VS. I can't remember how, but Google can :D