|
@@ -7,32 +7,12 @@ namespace GNode
|
|
|
{
|
|
|
|
|
|
|
|
|
-void AnalyzeNode::work()
|
|
|
+void AnalyzeNode::handle_data(std::shared_ptr<meta::MetaData>& meta_data)
|
|
|
{
|
|
|
- printf("AnalyzeNode %s\n", name_.c_str());
|
|
|
- while (running_)
|
|
|
- {
|
|
|
-
|
|
|
- for (auto& input_buffer : input_buffers_)
|
|
|
- {
|
|
|
- std::shared_ptr<meta::MetaData> metaData;
|
|
|
- if (!input_buffer.second->try_pop(metaData))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- // printf("Node %s get data from %s\n", name_.c_str(), input_buffer.first.c_str());
|
|
|
- int width = metaData->image.cols;
|
|
|
- int height = metaData->image.rows;
|
|
|
-
|
|
|
- auto res = person_cross_line(metaData->track_boxes, cv::Point(0, 0), cv::Point(width, height));
|
|
|
- metaData->result = res;
|
|
|
- for (auto& output_buffer : output_buffers_)
|
|
|
- {
|
|
|
- // printf("Node %s push data to %s\n", name_.c_str(), output_buffer.first.c_str());
|
|
|
- output_buffer.second->push(metaData);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ int width = meta_data->image.cols;
|
|
|
+ int height = meta_data->image.rows;
|
|
|
+ auto res = person_cross_line(meta_data->track_boxes, cv::Point(0, 0), cv::Point(width, height));
|
|
|
+ meta_data->result = res;
|
|
|
}
|
|
|
|
|
|
|