title: how to write rectangle (bounding box) by xmax xmin ymax ymin using opencv
body: <p>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.</p>
  
  <p><code>cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),15)</code></p>
  
  <p>But How is it possible to write bounding box using opencv having only <strong>xmax xmin ymax ymin</strong> points? I need to check that all is allright in my code and bounding boxes used by <strong>x, y, w, h</strong> is completely equal to bounding boxes that I have under <strong>xmax xmin ymax ymin</strong>. </p>
  
  <p>I converted <strong>x, y, w, h</strong> to <strong>xmax xmin ymax ymin</strong> using these code </p>
  
  <pre><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
  </code></pre>
  
  <p>But I'm not sure that I did all as I wanted. I wanted to convert <strong>x, y, w, h</strong> to <strong>VOOC2007</strong> annotation xml format and their bounding box format</p>
  
  <p>Thanks for any advice</p>