I found that I cant easely write bounding box using 4 points (x, y, w, h) using opencv. Where x, y is top left corner and w=width, h=height.
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),15)
But How is it possible to write bounding box using opencv having only xmax xmin ymax ymin points? I need to check that all is allright in my code and bounding boxes used by x, y, w, h is completely equal to bounding boxes that I have under xmax xmin ymax ymin.
I converted x, y, w, h to xmax xmin ymax ymin using these code
bbox_topleft_corner_x = int(prod_data[0])
bbox_topleft_corner_y = int(prod_data[1])
bbox_w = int(prod_data[2])
bbox_h = int(prod_data[3])
ymax = bbox_topleft_corner_y
ymin = bbox_topleft_corner_y - bbox_h
xmax = bbox_topleft_corner_x + bbox_w
xmin = ymin + bbox_w
But I'm not sure that I did all as I wanted. I wanted to convert x, y, w, h to VOOC2007 annotation xml format and their bounding box format
Thanks for any advice