You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
853 B
31 lines
853 B
import configSer
|
|
import tcp_Ser
|
|
import upload.DataReporter
|
|
import 标靶识别video
|
|
import cv2
|
|
|
|
if __name__ == '__main__':
|
|
config_path = "./config.json"
|
|
# 读取配置文件
|
|
config_obj= configSer.ConfigOperate(config_path)
|
|
json_str = config_obj.config_info.to_json(indent=4)
|
|
print(f"当前配置:{json_str}")
|
|
|
|
tcp_service = tcp_Ser.TcpSer("127.0.0.1", config_obj.config_info.server.port)
|
|
tcp_service.start()
|
|
reporter = upload.DataReporter.DataReporter()
|
|
reporter.register_handler(tcp_service.broadcast_message)
|
|
reporter.start()
|
|
# 启动video
|
|
标靶识别video.configObj=config_obj
|
|
processor = 标靶识别video.VideoProcessor(reporter)
|
|
# 添加订阅者processor
|
|
tcp_service.add_subscribe(processor)
|
|
# 启动
|
|
processor.video_mode(0)
|
|
|
|
|
|
|
|
|
|
cv2.waitKey(0)
|
|
cv2.destroyAllWindows()
|