0

I've recently configurated OpenCV in my machine as described in here.

I'm trying to run this simple code:

    #include "opencv2/core/core.hpp"
    #include <iostream>

    using namespace std;
    using namespace cv;
    int main(int,char**)
    {
        Mat i = Mat::eye(4, 4, CV_64F);
        i.at<double>(1,1) = CV_PI;
        // First problem
        cout << "i = " << i << ";" << endl;

        Mat r = Mat(10, 3, CV_8UC3);
        randu(r, Scalar::all(0), Scalar::all(255));
        cout << "r (default) = " << r << ";" << endl << endl;
        // Problematic Line:
        cout << "r (python) = " << format(r,"python") << ";" << endl << endl;

        return 0;
    }

Which is part of one of the samples included in OpenCV 2.4.5. I should also note that I'm using Visual Studio 2008.

While debugging I get two problems. The first one is that the matrix i isn't displayed at all in the console application (The following screenshot was taken right after the 11th line was executed).

problem1

The second problem is a run-time error, wich takes place while trying to execute line 17:

Any thoughts?

Community
  • 1
  • 1
JLagana
  • 1,224
  • 4
  • 14
  • 33
  • 2
    Something is trying to read memory it doesn't have access rights for. Can you reduce the code to the smallest possible example? Also, I personally would have preferred just the exception text in the popup instead of an embedded image that is so small that the text is not readable. – Ulrich Eckhardt May 17 '13 at 14:21
  • Sorry about the image size, here you go: http://i.stack.imgur.com/qdpPS.jpg – JLagana May 17 '13 at 18:53
  • I just edited the question, reducing the problem like you suggested. – JLagana May 17 '13 at 19:01

0 Answers0