diff --git a/Makefile b/Makefile index 63e15e657fa..fcb1bf50d96 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GPU=0 CUDNN=0 -OPENCV=0 +OPENCV=1 OPENMP=0 DEBUG=0 @@ -42,8 +42,8 @@ CFLAGS+=$(OPTS) ifeq ($(OPENCV), 1) COMMON+= -DOPENCV CFLAGS+= -DOPENCV -LDFLAGS+= `pkg-config --libs opencv` -lstdc++ -COMMON+= `pkg-config --cflags opencv` +LDFLAGS+= `pkg-config --libs opencv4` -lstdc++ +COMMON+= `pkg-config --cflags opencv4` endif ifeq ($(GPU), 1) diff --git a/src/image_opencv.cpp b/src/image_opencv.cpp index 7511280be07..9b75f509307 100644 --- a/src/image_opencv.cpp +++ b/src/image_opencv.cpp @@ -1,3 +1,7 @@ +#include "opencv2/core/core_c.h" +#include "opencv2/videoio/legacy/constants_c.h" +#include "opencv2/highgui/highgui_c.h" + #ifdef OPENCV #include "stdio.h" @@ -60,7 +64,7 @@ Mat image_to_mat(image im) image mat_to_image(Mat m) { - IplImage ipl = m; + IplImage ipl = cvIplImage(m); image im = ipl_to_image(&ipl); rgbgr_image(im); return im;