Hi, basically I'm starting learning on how to writing c++ code using openCV to load an image in QT creator tool.
for your information, I create a project called TestingOpenCV, with several .cpp and .hfile :
- .h file:
--- mainwindow.h
--- testing.h
- .cpp file
--- main.cpp
--- mainwindow.cpp
--- testing.cpp (problem occur here...)
in TestingOpenCV.pro
#-------------------------------------------------
#
# Project created by QtCreator 2013-05-12T21:20:01
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = TestingOpenCV
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
testing.cpp
HEADERS += mainwindow.h \
testing.h
FORMS += mainwindow.ui
INCLUDEPATH += C:\\OpenCV-2.3.1\\opencv\\build\\include
LIBS += -LC:\\OpenCV-2.3.1\\mybuild\\lib\\Debug \
-lopencv_core231d\
-lopencv_highgui231d\
-lopencv_imgproc231d\
-lopencv_features2d231d\
-lopencv_calib3d231d
in testing.cpp (error here...)
#include "testing.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/calib3d/calib3d.hpp>
using namespace cv;
Testing::Testing()
{
}
void Testing::activateTextingFunction()
{
string address = ....
string imgFile = address + "image1.jpg";
Mat image;
image = imread(imgFile, CV_LOAD_IMAGE_COLOR);
if(! image.data)
{
cout << "Could not open or find the image" << endl;
}
namedWindow( "Display window", WINDOW_AUTOSIZE );
imshow( "Display window", image );
waitKey(0);
}
although I build this program with no error, However, when I run this program...
it state that:
Starting C:\Users\user\Desktop\Qt_Stuff\build-TestingOpenCV-Desktop_Qt_5_0_2_MSVC2010_32bit-Debug\debug\TestingOpenCV...
The program has unexpectedly finished.
C:\Users\user\Desktop\Qt_Stuff\build-TestingOpenCV-Desktop_Qt_5_0_2_MSVC2010_32bit-Debug\debug\TestingOpenCV exited with code -1073741515
Please... can anyone help me to solve this problem ?
I have try to search all the website base on such problem... however, I find no solution for that problem...
Can anyone help me on how to solve this problem ?
your kindness and helpfulness is very much appreciated...