Steps:
1. Create Qt 5 Console Application with QtCreator
2. Replace the content of main.cpp with
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{
Mat image = imread("G:\\Work\\OpenCVCookbook\\3241OS_images\\images\\tiger.jpg");
namedWindow("My Image");
imshow("My Image", image);
waitKey(5000);
return 1;
}
3.Append the following lines at the end of project file
INCLUDEPATH += C:/opencv/include/
INCLUDEPATH += C:/opencv/modules/core/include/
INCLUDEPATH += C:/opencv/modules/highgui/include/
INCLUDEPATH += C:/opencv/modules/imgproc/include/
INCLUDEPATH += C:/opencv/modules/features2d/include/
INCLUDEPATH += C:/opencv/modules/calib3d/include/
LIBS += -LC:\opencv\build\x86\vc11\lib \
-lopencv_core246d \
-lopencv_highgui246d \
-lopencv_imgproc246d \
-lopencv_features2d246d \
-lopencv_calib3d246d
4. Don't forget run qmake, otherwise compiler error C1083 will occur
5. Build and run