diff --git a/VideoProsessing/bin/video b/VideoProsessing/bin/video index e605686..0494fed 100755 Binary files a/VideoProsessing/bin/video and b/VideoProsessing/bin/video differ diff --git a/VideoProsessing/src/main.cpp b/VideoProsessing/src/main.cpp index 6b730da..c4e3cc4 100644 --- a/VideoProsessing/src/main.cpp +++ b/VideoProsessing/src/main.cpp @@ -98,17 +98,19 @@ void getMsgCallback(mqtt::const_message_ptr msg) try { // TODO 处理接收到到的位置数据 auto json = nlohmann::json::parse(payload); - //绘制标况 - for(auto & ii :json) - { - int x = static_cast(ii["x"]); - int y = static_cast(ii["y"]); - int w = static_cast(ii["w"]); - int h = static_cast(ii["h"]); - double distance = static_cast(ii["distance"]); - drawRect(x,y,w,h,distance); - } - + //绘制 接收到的坐标 的方框 + thread([json](){ + for(auto & ii :json) + { + int x = static_cast(ii["x"]); + int y = static_cast(ii["y"]); + int w = static_cast(ii["w"]); + int h = static_cast(ii["h"]); + double distance = static_cast(ii["distance"]); + drawRect(x,y,w,h,distance); + } + }).detach(); + } catch (const nlohmann::json::parse_error &e) { cerr << "JSON 解析错误: " << e.what() << "\n原始 payload: " << payload << "\n";