How to compile opencv application on imx8mm

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to compile opencv application on imx8mm

1,488 次查看
mahanad
Contributor I

I have download and installed LF_v5.15.5-1.0.0_images_IMX8MMEVK from nxp official site. I can see opencv has been included in the image. But there are no opencv header files. So how do I compile a c++ program having  #include <opencv2/opencv.hpp> ? 

0 项奖励
回复
3 回复数

1,195 次查看
Udhay_
Contributor III

@mahanad 

hi i want to use cv2.Videocapture(0) so i am getting issue with  with opencv gstremer

"global /usr/src/debug/opencv/4.5.2.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (2056) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2sr[ 1345.304570] unknown pixelformat:'BGR3'
[ 1345.310560] mx6s-csi 32e20000.csi1_bridge: Fourcc format (0x33524742) invalid.
[ 1345.317822] unknown pixelformat:'RGB3'
[ 1345.321586] mx6s-csi 32e20000.csi1_bridge: Fourcc format (0x33424752) invalid.
[ 1345.328829] unknown pixelformat:'YV12'
"

can you please tell me how to do cross compilation opencv in yocto using imx8mm?

if i use c++ gstreamer in opencv

im getting this issue

"/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x34): undefined reference to `cv::VideoCapture::getBackendName[abi:cxx11]() const'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x74): undefined reference to `cv::VideoCapture::set(int, double)'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x88): undefined reference to `cv::VideoCapture::set(int, double)'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x9c): undefined reference to `cv::VideoCapture::set(int, double)'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0xa4): undefined reference to `cv::Mat::Mat()'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0xc4): undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x13c): undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x22c): undefined reference to `cv::Mat::~Mat()'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x234): undefined reference to `cv::VideoCapture::~VideoCapture()'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x288): undefined reference to `cv::Mat::~Mat()'
/usr/lib/gcc/aarch64-poky-linux/11.3.0/../../../../aarch64-poky-linux/bin/ld: ud.cpp:(.text+0x29c): undefined reference to `cv::VideoCapture::~VideoCapture()'
collect2: error: ld returned 1 exit status"

 

 

0 项奖励
回复

1,473 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The opencv4 folder should contains the opencv2/opencv.hpp, you can try to use "pkg-config --cflags opencv" to see it .

标记 (1)
0 项奖励
回复

1,470 次查看
mahanad
Contributor I

mahanad_0-1652680772583.png

 

0 项奖励
回复