首页 > 解决方案 > 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 坐标?

标签: pythoncomputer-visionyolo

解决方案


如果我没记错的话:

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

推荐阅读