OpenCV运行有误
-
使用的是ros一键安装自带的Opencv库,编写识别代码时使用
g++ `pkg-config opencv4 --cflags` 'test.cpp' -o opencv3 `pkg-config opencv4 --libs`
可以正常编译运行,效果正常。
但是使用cmake后运行报错[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (873) open OpenCV | GStreamer warning: Error opening bin: unexpected reference "test02" - ignoring [ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
以下是camke内容
cmake_minimum_required(VERSION 2.8) PROJECT(test) FIND_PACKAGE( OpenCV REQUIRED ) INCLUDE_DIRECTORIES( ${OpenCV_INCLUDE_DIRS} ) ADD_EXECUTABLE(test test.cpp) TARGET_LINK_LIBRARIES (test ${OpenCV_LIBS})