RDK X5 视频、扫描,建模,为什么显示满屏距离标识,没有物体识别呢?正常建模应该是怎么样的

问题升级分析

你已经尝试了所有 MIPI 通道组合但仍报错,说明问题不在通道配置。从日志分析,这是一个硬件识别/标定文件匹配问题。


关键发现

你的日志显示:

[mipi_cap]: i2c bus: 6, EEPROM FLAG: SZYGSJKJ

相机 EEPROM 能读取,但左右图像仍然识别错误。这说明:

  1. :white_check_mark: 两个相机都被识别(左右 AWB 数据都能读取)
  2. :white_check_mark: 标定文件内参加载成功(fx/fy 不为 0)
  3. :cross_mark: 但立体节点认为"上图"不是左图

深层原因

top is not left image 错误的本质是:立体匹配算法通过图像内容判断左右,发现当前"左通道"的图像特征与标定文件中的左相机不匹配。

可能原因:

  1. 标定文件是另一套相机的(基线/内参不匹配)
  2. 物理接线与标定文件假设相反
  3. 相机模组本身左右定义与软件相反

解决方案(按优先级)

方案 1:使用 calib_method:=internal 让系统自动读取 EEPROM 参数

source /opt/tros/humble/setup.bash
ros2 launch hobot_stereonet stereonet_model_web_visual_v2.5_int16_544_448_96.launch.py \
  mipi_image_width:=1280 \
  mipi_image_height:=1088 \
  mipi_image_framerate:=10.0 \
  mipi_gdc_enable:=True \
  mipi_rotation:=0.0 \
  mipi_cal_rotation:=0.0 \
  mipi_channel:=2 \
  mipi_channel2:=0 \
  calib_method:=internal \
  mipi_gdc_enable:=True

关键修改calib_method:=internal(不使用外部标定文件,直接读相机 EEPROM)


方案 2:先单独测试相机输出,确认左右图像

# 1. 先运行相机测试,查看左右图像
source /opt/tros/humble/setup.bash
ros2 launch hobot_mipi_cam mipi_cam.launch.py \
  mipi_image_width:=1280 \
  mipi_image_height:=1088 \
  mipi_channel:=2 \
  mipi_channel2:=0 \
  mipi_gdc_enable:=True

# 2. 在另一个终端查看图像话题
ros2 topic list | grep image
ros2 topic echo /image_combine_raw --field width,height

用浏览器访问板子 IP 查看实时图像,确认:

  • 左摄像头画面是否正确
  • 右摄像头画面是否正确
  • 交换通道后图像是否对应交换

方案 3:重新标定相机(最彻底)

如果标定文件确实不匹配,需要重新标定:

# 1. 进入标定目录
cd /opt/tros/humble/share/hobot_stereonet/config/

# 2. 运行极线标定
bash run_stereo.sh --epipolar_mode True \
  --chessboard_per_rows 11 \
  --chessboard_per_cols 8 \
  --chessboard_square_size 0.06 \
  --save_calib True \
  --calib_save_path /home/sunrise/sc132gs_new_calibration.yaml

# 3. 使用新标定文件启动
ros2 launch hobot_stereonet stereonet_model_web_visual_v2.5_int16_544_448_96.launch.py \
  mipi_camera_calibration_file_path:=/home/sunrise/sc132gs_new_calibration.yaml \
  mipi_image_width:=1280 \
  mipi_image_height:=1088 \
  mipi_channel:=2 \
  mipi_channel2:=0 \
  calib_method:=none

方案 4:检查相机物理连接

# 查看 MIPI 摄像头检测信息
dmesg | grep -i mipi
dmesg | grep -i sc132

# 查看设备树配置
cat /proc/device-tree/soc/cam/vcon@0/compatible
cat /proc/device-tree/soc/cam/vcon@2/compatible

如果以上都无效,可能需要:

  1. 检查 MIPI 线缆是否松动
  2. 确认相机模组是否支持 SC132GS 官方固件
  3. 联系相机供应商确认左右定义

快速验证命令

# 测试方案 1(使用 internal 标定)
ros2 launch hobot_stereonet stereonet_model_web_visual_v2.5_int16_544_448_96.launch.py \
  mipi_image_width:=1280 \
  mipi_image_height:=1088 \
  mipi_channel:=2 \
  mipi_channel2:=0 \
  calib_method:=internal

启动后重点检查日志

  • :white_check_mark: 不再出现 top is not left image
  • :white_check_mark: 出现 sub rectified [fx, fy, cx, cy, baseline] 且值不为 0
  • :white_check_mark: 不再出现 Target FOV 0.00° out of valid range

参考帖子

建议先试方案 1(calib_method:=internal),如果不行再试方案 2 确认图像输出。有进展请更新!