Reason
A bounding-box list tells you ["left", "top", "width", "height"]
, and each of them is in percent of the image original size.
Solution
Assumed that your image dimension is 800 x 600 (i.e., Image Width is 800, Image Height is 600). Therefore, what you need to do is to multiply the width and height to the corresponding values. Read the code below in Python:
imageWidth = 800
imageHeight = 600
bbx = {
"left": 0.053913698,
"top": 0.6198375,
"width": 0.09218301,
"height": 0.13308609
}
# top-left point position
(x, y) = (bbx["left"]*imageWidth, bbx["top"]*imageHeight)
# bounding box's width and height
bbxWidth = bbx["width"] * imageWidth
bbxHeight = bbx["height"] * imageHeight
You can use the above values (i.e., x
, y
, bbxWidth
, and bbxHeight
) to draw the bounding box on the original image.