简体   繁体   English

以 x,y,w,h 格式调整图像大小及其边界框

[英]Resize image and it's bounding box in x,y,w,h format

我有一个宽度为 1980 和高度为 1080 的图像,其中 x =759,y = 786,w = 369,h = 100。我想将此图像转换为宽度 = 640 和高度 = 480。如何根据新的图像格式?

As you know the actual (W,H) and new image format (newW,newH) then如您所知,实际的 (W,H) 和新的图像格式 (newW,newH) 然后

newX = (newW/W) * x

and do the same for other value...并为其他价值做同样的事情......

Edit:编辑:

newY = (newH/H) * y

And the same for other value.其他值也一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将cv2.rectangle边界框转换为YoloV4标注格式(相对x,y,w,h)? - How to convert cv2.rectangle bounding box to YoloV4 annotation format (relative x,y,w,h)? 如何将 2D 边界框像素坐标 (x, y, w, h) 转换为相对坐标(Yolo 格式)? - How to convert 2D bounding box pixel coordinates (x, y, w, h) into relative coordinates (Yolo format)? 如何将 yolo 边界样式从 (x,y,w,h) 更改为 (x,y,w,h,a)? - How to change yolo bounding style from (x,y,w,h) to (x,y,w,h,a)? 根据图像调整边界框的大小 - Resize bounding box according to image 如何在此裁剪图像中获取 x,y,w,h 的每个值? - How to get each value of x,y,w,h in this crop image? 将边界框坐标转换为 x,y 对 - convert bounding box coordinates to x,y pairs 如何有效地将形状为(w,h,3)的numpy图像转换为在第三轴上具有r,g,b,x,y的(w,h,5)? - How to I efficiently transform a numpy image of shape (w, h, 3) to (w,h,5) which has r,g,b,x,y in third axis? PyQt5:我无法理解 QGraphicsScene 的 setSceneRect(x, y, w, h) - PyQt5: I can't understand QGraphicsScene's setSceneRect(x, y, w, h) 转换边界框格式 - Convert bounding box format 调整图像大小时以yolo格式调整边界框 - Adjust bounding box in yolo format when resizing image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM