Utility

utils.boxes_intersect(bbox1, bbox2)[source]

Return if two rect overlap

utils.boxes_intersect2(bbox1, bbox2)[source]

Return if two rect overlap

utils.draw_bounding_box(image, bbox)[source]

Draw all bounding box inside image as red rectangle

Parameters:
  • image – image where draw the bounding box
  • bbox – array of bounding boxes as (x,y,w,h) where x,y is the topleft corner of the rectangle
Returns:

image with bbox drawn

utils.get_center_area_from_rect(rect)[source]

coordinates rect center

utils.norm_correlate(a, v)[source]
utils.rect_similarity(rect1, rect2)[source]

Check whatever two rect are similar with a tolerance of 10px in center distance and 0.1 in area ratio

utils.rect_similarity2(r1, r2)[source]

Return if r1 and r2 satisfy overlapping criterion

utils.rgb2gray(rgb)[source]
utils.similarity_measure_rect(bbox_test, bbox_target)[source]

Return similarity measure between two bounding box

Parameters:
  • bbox_test
  • bbox_target
Returns:

utils.to_rgb(im)[source]