Ask Your Question

edd2609's profile - activity

2016-03-15 13:26:22 -0600 asked a question Typical "Exception at memory location"

Hello, I'm trying to make a simple program in VS2015, just reading and showing an image, and I don't know what could be the error. In the title I wrote "typical" because I read a lot about it and I'm certainly sure that can be a straightfoward solution.

This is my program:

#include <cstdio>
#include <opencv2\opencv.hpp>
//#include <iostream>
//#include "opencv2\imgproc\imgproc.hpp"
using namespace cv;
using namespace std;

int main() {
    //char NombreImagen[] = "imagen1.jpg";
    Mat imagen1;
    imagen1 = cv::imread("C:\\imagen1.jpg");
    if (!imagen1.data) {
        cout << "Error al mostrar la imagen: " << endl;
        exit(1);
    }
    namedWindow("Original", CV_WINDOW_AUTOSIZE);
    imshow("Original", imagen1);
    waitKey(0);
    return 0;
}

When I executed in debug (x64), it's done, but there's always the following message:

Exception thrown at 0x000007FEFD96965D in App1.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000000031EB10.

Any help will be useful. Thank you a lot for the attention.