|
@@ -41,6 +41,8 @@ void DrawNode::work()
|
|
|
printf("Node %s get data from %s\n", name_.c_str(), input_buffer.first.c_str());
|
|
|
// do something
|
|
|
cv::Mat image = metaData->image.clone();
|
|
|
+ int image_width = image.cols;
|
|
|
+ int image_height = image.rows;
|
|
|
PositionManager<float> pm(getFontSize);
|
|
|
for (auto& box : metaData->boxes)
|
|
|
{
|
|
@@ -48,7 +50,7 @@ void DrawNode::work()
|
|
|
|
|
|
std::tuple<int, int, int, int> pbox = std::make_tuple(box.left, box.top, box.right, box.bottom);
|
|
|
int x, y;
|
|
|
- std::tie(x, y) = pm.selectOptimalPosition(pbox, 1920, 1080, box.label);
|
|
|
+ std::tie(x, y) = pm.selectOptimalPosition(pbox, image_width, image_height, box.label);
|
|
|
cv::putText(image, box.label, cv::Point(x, y), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(0, 255, 0), 2);
|
|
|
}
|
|
|
metaData->draw_image = image;
|