Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

imread, command line arguments in VS13

I'm trying to run this code in VS13 that uses command line argument I'm following this method but its nt working.

Solution Explorer Properties Debugging Command Arguments "D:/Images/image1.jpeg" "D:/Images/image2.jpeg"

Code:

include <opencv2\core\core.hpp>

include <opencv2\highgui\highgui.hpp>

include <stdio.h>

include <iostream>

using namespace std; using namespace cv;

int main(int argc, char* argv[]) { Mat img; Mat img2;

img = imread(argv[1], CV_LOAD_IMAGE_COLOR);
img2 = imread(argv[2], CV_LOAD_IMAGE_COLOR);

if (img.empty() || img2.empty)
{
    cout << "Error: Image cannot be loaded!" << endl;
    system("pause");
    return -1;
}

namedWindow("Image", CV_WINDOW_AUTOSIZE);
imshow("Image", img);
namedWindow("Imag2", CV_WINDOW_AUTOSIZE);
imshow("Image2", img2);

waitKey(0);
return 0;

}

imread, command line arguments in VS13

I'm trying to run this code in VS13 that uses command line argument I'm following this method but its nt working.

Solution Explorer Properties Debugging Command Arguments "D:/Images/image1.jpeg" "D:/Images/image2.jpeg"

Code:

include <opencv2\core\core.hpp>

#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <stdio.h>
#include <iostream>
 

include <opencv2\highgui\highgui.hpp>

include <stdio.h>

include <iostream>

using namespace std; using namespace cv;

cv;

int main(int argc, char* argv[]) { Mat img; Mat img2;

img2;
img = imread(argv[1], CV_LOAD_IMAGE_COLOR);
img2 = imread(argv[2], CV_LOAD_IMAGE_COLOR);
if (img.empty() || img2.empty)
{
cout << "Error: Image cannot be loaded!" << endl;
system("pause");
return -1;
}
namedWindow("Image", CV_WINDOW_AUTOSIZE);
imshow("Image", img);
namedWindow("Imag2", CV_WINDOW_AUTOSIZE);
imshow("Image2", img2);
waitKey(0);
return 0;

}

imread, command line arguments in VS13

I'm trying to run this code in VS13 that uses command line argument I'm following this method but its nt working.

Solution Explorer Properties Debugging Command Arguments "D:/Images/image1.jpeg" "D:/Images/image2.jpeg"

Code:

#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <stdio.h>
#include <iostream>


using namespace std;
using namespace cv;

int main(int argc, char* argv[])
{

Mat img;
Mat img2;

img = imread(argv[1], CV_LOAD_IMAGE_COLOR);
img2 = imread(argv[2], CV_LOAD_IMAGE_COLOR);

if (img.empty() || img2.empty)
{
    cout << "Error: Image cannot be loaded!" << endl;
    system("pause");
    return -1;
}

namedWindow("Image", CV_WINDOW_AUTOSIZE);
imshow("Image", img);
namedWindow("Imag2", CV_WINDOW_AUTOSIZE);
imshow("Image2", img2);

waitKey(0);
return 0;

}