Darknet: Error Making with open cv=1

Created on 8 Mar 2020  路  3Comments  路  Source: AlexeyAB/darknet

i have nvidia jetson nano developer kit, i'm trying to run the make file while opencv=1 i get the following error

chmod +x .sh
g++ -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV pkg-config --cflags opencv -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/image_opencv.cpp -o obj/image_opencv.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
./src/image_opencv.cpp:15:10: fatal error: opencv2/core/version.hpp: No such file or directory
#include
^~~~~~
compilation terminated.
Makefile:159: recipe for target 'obj/image_opencv.o' failed
make: *
* [obj/image_opencv.o] Error 1

Although i have opencv pre-installed when i run the command
import cv2
print(cv2.__version__)
i get
4.1.1

so what should i do?

Most helpful comment

You should install OpenCV by using:

All 3 comments

How did you install opencv? I think theres a version for python you can install with pip and a C++ version you probably install with apt-get?

You should install OpenCV by using:

You should install OpenCV by using:

i tried theses solutions and unfortunately it didn't work
i made some modifications on my make file

ifeq ($(OPENCV), 1)
COMMON+= -DOPENCV -I/usr/include/opencv2
CFLAGS+= -DOPENCV -I/usr/include/opencv2
LDFLAGS+= pkg-config --libs opencv4
COMMON+= pkg-config --cflags opencv4
endif

it compiled and i did some detections on images but live demo using this command

./darknet detector demo data/yolo.data cfg/yolov3_custom_train.cfg yolov3_custom_train_3000.weights -c 0

CUDA-version: 10000 (10000), cuDNN: 7.6.3, GPU count: 1
OpenCV version: 4.3.0
Demo
net.optimized_memory = 0
Screenshot from 2020-03-09 16-18-26
Screenshot from 2020-03-09 16-18-26

i get the following warnings

[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (1759) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/jn/opencv_build/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

then the demo window pops up and i get a constant green screen

i use nvidia jetson nano with rpi camera note that i'm 100% sure that the camera is compatible and working perfectly.

is there any recommended solution?

Was this page helpful?
0 / 5 - 0 ratings