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.
 

33 lines
1019 B

from time import sleep
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("0.0.0.0", config_obj.config_info.server.port)
tcp_service.start()
reporter = upload.DataReporter.DataReporter(data_fps=config_obj.config_info.fps.data,video_fps=config_obj.config_info.fps.video)
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(config_obj.config_info.capture)
while True:
sleep(10)
cv2.waitKey(0)
cv2.destroyAllWindows()