Skip to content

无人车交通灯识别 - #4284

Closed
yuboyyy wants to merge 31 commits into
OpenHUTB:mainfrom
yuboyyy:main
Closed

yuboyyy wants to merge 31 commits into
OpenHUTB:mainfrom
yuboyyy:main

Conversation

@yuboyyy

@yuboyyy yuboyyy commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

修改概述:

修改的详细描述

  1. 替换静态图像读取为摄像头实时流采集,通过cv2.VideoCapture调用摄像头,无需提前准备图像文件。
  2. 删除静态图像路径校验相关函数,简化代码结构,解决路径配置错误导致的运行失败问题。
  3. 保留红、黄、绿三色信号灯识别核心逻辑,优化参数适配实时检测场景,保证流畅性与准确性。

经过了什么样的测试?

运行效果

动图、视频、截图等
屏幕截图 2025-12-21 150756
屏幕截图 2025-12-21 150834
屏幕截图 2025-12-21 150808

Comment thread src/Smart_car/traffic.py
return "摄像头初始化失败"

# 设置摄像头分辨率(提升识别效率,可根据摄像头性能调整)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要用实际图片或者carla模拟器中的交通灯图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants