Coordinate Conventions - ZhiangChen/target_mapping GitHub Wiki
Conventions
1. image coordinate systems
2. bounding box coordinate system
Bounding box uses the drawing coordinate system. The following is an example
bbox = np.array([[291,187],[405,187],[291,267],[405,267](/ZhiangChen/target_mapping/wiki/[291,187],[405,187],[291,267],[405,267)])
If we want to crop an image with a bounding box,
(xmin, ymin, boxw, boxh) = cv2.boundingRect(bbox[0,:,:].astype(int))
roi = img[ymin:ymin+boxh,xmin:xmin+boxw]