专栏算法工具链F37正常运行solution_zoo 实例, opencv无法打开video8

F37正常运行solution_zoo 实例, opencv无法打开video8

已解决
xulanshuai01232021-11-20
97
2

# 按照b站视频的教程编写代码

#include <algorithm>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <queue>

#include <utility>

#include "dnn/hb_dnn.h"

#include "gflags/gflags.h"

#include "glog/logging.h"

#include "opencv2/core/mat.hpp"

#include "opencv2/highgui.hpp"

using namespace std;

using namespace cv;

int main(){

cout << "start================================"<< endl;

//create videocpature object

VideoCapture cap;

//open the camera

cap.open(8);

//judge whether open or not

if (!cap.isOpened()){

return -1;

}

Mat frame;

for(int i; i<100; i++){

String name = to_string(i) + ".jpg";

cap >> frame;

if(frame.empty()){

return -1;

}

imwrite(name,frame);

cout << "get a image and save!" << endl;

}

// release the camera

cap.release();

return 0;

}

# read_img.sh 也是跟视频一样的代码

bin=../aarch64/bin/read_img

lib=../aarch64/lib

export LD_LIBRARY_PATH=${lib}:${LD_LIBRARY_PATH}

export BMEM_CACHEABLE=true

${bin}

但是运行显示

root@x3sdbx3-samsung2G-3200:/userdata/test/xj3/script/04_read_img# sh read_img.sh

start================================

VIDEOIO ERROR: V4L2: Unable to capture video memory.VIDEOIO ERROR: V4L: can't open camera by index 8

/dev/video8 does not support memory mapping

求助是什么原因导致的呢,

root@x3sdbx3-samsung2G-3200:/userdata/test/xj3/script/04_read_img# ls -l /dev |grep video*

crw-rw---- 1 root video 29, 0 Jan 1 08:00 fb0

crw-rw---- 1 root video 491, 0 Jan 1 08:00 iar_cdev

crw-rw---- 1 root video 490, 0 Jan 1 08:00 iar_channel_0

crw-rw---- 1 root video 490, 1 Jan 1 08:00 iar_channel_1

crw-rw---- 1 root video 490, 2 Jan 1 08:00 iar_channel_2

crw-rw---- 1 root video 490, 3 Jan 1 08:00 iar_channel_3

crw-rw---- 1 root video 81, 0 Jan 1 08:00 v4l-subdev0

crw-rw---- 1 root video 81, 1 Jan 1 08:00 v4l-subdev1

crw-rw---- 1 root video 81, 2 Jan 1 08:00 v4l-subdev2

crw-rw---- 1 root video 81, 3 Jan 1 08:00 v4l-subdev3

crw-rw---- 1 root video 81, 4 Jan 1 08:00 v4l-subdev4

crw-rw---- 1 root video 81, 5 Jan 1 08:00 video0

crw-rw---- 1 root video 81, 6 Jan 1 08:00 video1

crw-rw---- 1 root video 81, 7 Jan 1 08:00 video2

crw-rw---- 1 root video 81, 8 Jan 1 08:00 video3

crw-rw---- 1 root video 81, 9 Jan 1 08:00 video4

crw-rw---- 1 root video 81, 10 Jan 1 08:00 video5

crw-rw---- 1 root video 81, 11 Jan 1 08:00 video6

crw-rw---- 1 root video 81, 12 Jan 1 08:00 video7

crw-rw---- 1 root video 81, 13 Jan 1 08:00 video8

算法工具链
评论1
0/1000
  • Horizon_guosheng
    Lv.1
    opencv 调用的是usb camera
    这里使用的是f37camera

    两个不一样哈

    2021-11-22
    2
    1
    • casiatao回复Horizon_guosheng:

      x请问opencv可以调用F37camera吗

      2022-08-19
      0