python - Python中如何将YOLO格式注解转换为x1,y1,x2,y2坐标?
问题描述
我想知道如何将 YOLO 格式的注释(例如 center_X、center_y、width、height = 0.069824、0.123535、0.104492、0.120117)转换为 x1、y1、x2、y2 坐标?
解决方案
如果我没记错的话:
x1 = (center_X-width/2)*image_width
x2 = (center_X+width/2)*image_width
y1 = (center_y-height/2)*image_height
y2 = (center_y+height/2)*image_height
推荐阅读
- php - 在 PHP POST 上发送复杂的 json 数据
- eclipse - Eclipse 将 std 命名空间标记为“无法解析”
- javascript - 如何让ajax在不刷新jQuery的情况下获取数据?
- google-cloud-platform - 网络接口未在 GCP 上启动
- javascript - 禁用提交 btn
- outlook-addin - 交换联系人寻呼机号码属性丢失?
- r - 函数R中未使用的奇怪行为参数
- c# - C# 字符串不应仅包含空格或任何特殊字符,除了 ,.';:"
- javascript - 我无法从文本文件中传递变量以在 casper.js 中评估如何解决这个问题
- microservices - 基于事件溯源的微服务中的响应聚合机制