UOS安装OPenCV4.6

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/work/opencv-4.6.0/bin/release   ..

报错1:
Couldn’t connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:

  • http_proxy/https_proxy
  • and/or HTTP_PROXY/HTTPS_PROXY

办法1:
opencv-4.6.0\3rdparty\ippicv\ippicv.cmake 42行更改为:

"https://ghproxy.com/https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"

办法2: 也可以修改 下载链接为本地文件,前提是把ippicv下载到本地;

"file:///home/haha/Downloads/"

报错2:
libavdevice/v4l2-common.c:23:49: error: ‘V4L2_PIX_FMT_YUV420’ undeclared here

修改:下载 ffmpeg4.2 libavdevice/v4l2-common.h
UOS安装OPenCV4.6_第1张图片
编译ffmpeg4.2

./configure  --enable-pic --enable-shared
make 
make install

然后再重新编译OPenCV

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/work/opencv-4.6.0/bin/release   ..
make 
make install

问题参考:
https://blog.csdn.net/weixin_45617478/article/details/103335455
https://blog.csdn.net/qq_36559293/article/details/109166162
ffmpeg问题

你可能感兴趣的:(opencv)