怎么在mediapipe中只保留框体信息

本文探讨了如何在Mediapipe框架中定制人脸检测框体的显示,去除额外信息如Face、相似度及小圆圈,专注于框体本身。通过修改annotation_renderer.cc文件中的渲染数据,实现框体样式个性化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

继 上一篇关于mediapipe 文章
更改框体颜色
发现 mediapipe 框架 显示人脸框体这块, 会出现 Face, 相似度 ,还有5个小圆圈 等信息,
于是想着 去掉这些显示, 只留下框体…
恩,是其他不显示
那么位置 又在哪里呢?
对于 人脸检测 demo 而言…
文件
mediapipe-master/mediapipe/util/annotation_renderer.cc

  for (const auto& annotation : render_data.render_annotations()) {
    if (annotation.data_case() == RenderAnnotation::kRectangle) {
      DrawRectangle(annotation);//矩形
    } else if (annotation.data_case() == RenderAnnotation::kRoundedRectangle) {
      //DrawRoundedRectangle(annotation);//圆角矩形
    } else if (annotation.data_case() == RenderAnnotation::kFilledRectangle) {
      //DrawFilledRectangle(annotation);//实心矩形
    } else if (annotation.data_case() ==
               RenderAnnotation::kFilledRoundedRectangle) {
      //DrawFilledRoundedRectangle(annotation);//实心圆角矩形
    } else if (annotation.data_case() == RenderAnnotation::kOval) {
    //  DrawOval(annotation);//椭圆
    } else if (annotation.data_case() == RenderAnnotation::kFilledOval) {
     // DrawFilledOval(annotation);//实心椭圆
    } else if (annotation.data_case() == RenderAnnotation::kText) {
      //DrawText(annotation);//文本
    } else if (annotation.data_case() == RenderAnnotation::kPoint) {
      //DrawPoint(annotation);//点
    } else if (annotation.data_case() == RenderAnnotation::kLine) {
      //DrawLine(annotation);//线
    } else if (annotation.data_case() == RenderAnnotation::kGradientLine) {
      //DrawGradientLine(annotation);//梯度线
    } else if (annotation.data_case() == RenderAnnotation::kArrow) {
      //DrawArrow(annotation);//箭头
    } else {
      LOG(FATAL) << "Unknown annotation type: " << annotation.data_case();
    }
  }
}
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Teleger

你的支持是我前进的方向

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值