babysister.cv_logics module

CV logics

babysister.cv_logics.iou(bbox1, bbox2)

Calculates the intersection-over-union of two bounding boxes.

Parameters:
  • bbox1 (numpy.array, list of floats) – bounding box in format x1,y1,x2,y2.
  • bbox2 (numpy.array, list of floats) – bounding box in format x1,y1,x2,y2.
Returns:

intersection-over-onion of bbox1, bbox2.

Return type:

int

babysister.cv_logics.is_inside_roi(roi_value, box)

Is bouding box centroid inside ROI.

Parameters:
  • roi_value ([x, y, w, h] list) – x, y: top-left; w, h: width & heigh.
  • box ([x0, y0, x1, y1] list) – x0, y0: top-left; x1, y1: bottom-right.
Returns:

Whether box is inside ROI.

Return type:

bool