Ask Your Question

Icoria's profile - activity

2019-08-06 14:15:40 -0600 received badge  Notable Question (source)
2019-05-12 02:01:26 -0600 received badge  Popular Question (source)
2015-10-21 13:39:39 -0600 commented answer OpenCV cannot load images

I did that:

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"

using namespace cv;
using namespace std;

int main()
{

    Mat img = imread("index.jpeg",CV_LOAD_IMAGE_COLOR);

    if(img.empty())
    {
        cout << "Path incorrectly or filename wrong, image not read!" << endl;
        return -1;
    }
    imshow("opencvtest",img);
    waitKey(0);

    return 0;
}

but now it's saying:


    g++ -Wall -c "opencvtest.cpp" (in directory: /home/courtneym)
    opencvtest.cpp: In function ‘int main()’:
    opencvtest.cpp:15:3: error: ‘cout’ was not declared in this scope
       cout<< "Path incorrectly or filename wrong, image not read!" << endl;
       ^
    Compilation failed.

2015-10-21 12:17:37 -0600 commented answer OpenCV cannot load images

also I've been checking other threads but I've not yet found one that works for my issue

2015-10-21 12:16:14 -0600 commented answer OpenCV cannot load images

I did add using namespace std; but it didn't change anything

2015-10-21 12:02:08 -0600 commented answer OpenCV cannot load images

One more thing, I used the correct path, and the correct filename.

2015-10-21 11:56:24 -0600 commented answer OpenCV cannot load images

For your information, this was someone /else's/ code, and I am borrowing it. I tried using various openCV codes for my program and none of them work, no matter what imports or whatever are in there. Don't lecture me about needing basic C++ courses, I'm fully aware of "using namespsace std" and that did not fix the problem. None of the solutions that you guys have offered so far are working, so don't act so high and mighty.

2015-10-20 12:48:02 -0600 commented answer OpenCV cannot load images

These are the errors I got:

link text

2015-10-20 04:58:56 -0600 received badge  Student (source)
2015-10-19 12:42:02 -0600 asked a question OpenCV cannot load images

Hi, I'm using the code from "https://help.ubuntu.com/community/OpenCV" in the C++ section, and I'm having trouble with the following code:

#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/ml/ml.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
using namespace cv;

int main()
{

    Mat img = imread("/home/courtneym/Pictures/index.jpeg",CV_LOAD_IMAGE_COLOR);
    imshow("opencvtest",img);
    waitKey(0);

    return 0;
}

I keep getting this error when I try to run it:

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/courtneym/opencv/modules/highgui/src/window.cpp, line 276 terminate called after throwing an instance of 'cv::Exception' what(): /home/courtneym/opencv/modules/highgui/src/window.cpp:276: error: (-215) size.width>0 && size.height>0 in function imshow

Aborted (core dumped)