一、在windows系统看相机是否正常可略过报错和解决找不到设备RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUNDOAK相机启动报错X_LINK_DEVICE_NOT_FOUND_xlink相机-CSDN博客二、ubuntu22 运行相机depthai-pythonOAK-FFC系列产品上手指南 -安装功能包时遇到报错################|| Downloading stereo-dataset ||################ Network is unreachable运行 python3 install_requirements.py 命令时。解决① 在网站下载dataset.zip并放在文件夹 /OAK/depthai-python/examples/models 下。https://docs.google.com/uc?exportdownloadid1mPyghc_0odGtSU2cROS1uLD-qwRU8aug② 此时不能直接重新运行 python3 install_requirements.py 。原因此脚本在下载文件时不会检查目标路径是否已存在文件而是始终先尝试从缓存读取如果缓存中没有就会重新下载并覆盖。解决方法将文件放入下载器的缓存目录。# 1. 确认文件哈希值 sha256sum /home/YOURNAME/OAK/depthai-python/examples/models/dataset.zip # 输出应如下。如果哈希不匹配说明文件损坏或下载错误请重新下载。 # 19abe0e4126fc32ea45441abaaf5bed39603493530f616f416531c1c2fe05b86 # 2. 找到缓存目录并新建文件夹缓存文件按哈希的前两个字符分目录存放这里是19 cd /home/YOURNAME/OAK/depthai-python/examples/downloader mkdir -p 1/19 # 3. 将文件复制到缓存位置 cp /home/YOURNAME/OAK/depthai-python/examples/models/dataset.zip \ /home/YOURNAME/OAK/depthai-python/examples/downloader/1/19/abe0e4126fc32ea45441abaaf5bed39603493530f616f416531c1c2fe05b86 # 4. 重新运行安装脚本运行相机时遇到报错如下命令python3 utilities/cam_test.py -mres 400 -cams rgb,m left,m right,m camd,m错误1、权限不足RuntimeError: Failed to connect to device, error message: X_LINK_INSUFFICIENT_PERMISSIONS原因当前用户没有权限访问 DepthAI 设备OAK 相机需要设置 udev 规则来解决。解决# 1. 添加 udev 规则 并重新加载 udev 规则 echo SUBSYSTEMusb, ATTRS{idVendor}03e7, MODE0666 | sudo tee /etc/udev/rules.d/80-movidius.rules sudo udevadm control --reload-rules sudo udevadm trigger # 2. 将当前用户加入 dialout 组可选但推荐 sudo usermod -a -G dialout $USER # 3. 重启系统并重新插拔设备 # 4. 再次运行错误2、AttributeError: type object depthai.Device has no attribute getDeviceByMxId. Did you mean: getDeviceById找到cam_test.py的第 253 行getDeviceByMxId 改为 getDeviceById。错误3、设备或端口已被另一个进程或服务占用RuntimeError: Cannot connect to device with name 1.1, it is used by another process. Error: X_LINK_DEVICE_ALREADY_IN_USE暂未解决运行相机常用命令记录c是彩色m是黑白可设置fpscd /OAK/depthai-pythonpython3 utilities/cam_test.py -mres 400 -cams rgb,m left,m right,m camd,m -fps 15python3 utilities/cam_test.py -cres 720 -cams rgb,c left,c right,c camd,cpython3 utilities/cam_test.py -cres 720 -mres 800 -cams rgb,c left,m right,m camd,m二、校准depthai1、安装# 优先尝试 git clone --recursive https://github.com/luxonis/depthai.git # 不行就 git clone https://gitee.com/oakchina/depthai.git # 然后手动下载 https://github.com/luxonis/depthai-calibration 和 # https://github.com/luxonis/depthai-boards # 替换depthai中的 depthai_calibration 和 depthai-boards 文件夹 sudo curl -fL https://docs.luxonis.com/install_dependencies.sh | bash python3 install_requirements.py2、下载棋盘格图片charuco_11_8.pdf · OAKChina/depthai - Gitee.com将校准棋盘格打印在平坦的表面上或者将棋盘格显示在平坦的显示器上。如果在监视器上显示请以白色背景全屏显示图像。3、启动校准脚本python3 calibrate.py -s [SQUARE_SIZE_IN_CM] -brd [BOARD] -db -ih用有效的条目替换占位符参数值[SQUARE_SIZE_IN_CM]以厘米为单位测量棋盘格的黑色正方形边长(2.2)比如2.2cm[BOARD]depthai-boards中的面板类型比如 OAK-FFC-4P.json替换后用例python3 calibrate.py -s 2.2 -brd OAK-FFC-4P -ih