parameters: (homog, boxes, prev_boxes, min_iou)
return_statement: return result
docstring: Return a list of indices into prev_boxes, where each index
      identifies the entry of prev_boxes that matches the
      corresponding box in boxes.  A returned value may be None in the
      case of no match.
  
      homog is a Homography transforming the coordinates of boxes
      to those of prev_boxes.
  
      min_iou is the minimum IOU required for a match.
docstring_summary: Return a list of indices into prev_boxes, where each index
      identifies the entry of prev_boxes that matches the
      corresponding box in boxes.  A returned value may be None in the
      case of no match.
docstring_tokens: Return a list of indices into prev_boxes where each index identifies the entry of prev_boxes that matches the corresponding box in boxes . A returned value may be None in the case of no match .
function: def match_boxes_homog(homog, boxes, prev_boxes, min_iou):
      """Return a list of indices into prev_boxes, where each index
      identifies the entry of prev_boxes that matches the
      corresponding box in boxes.  A returned value may be None in the
      case of no match.
  
      homog is a Homography transforming the coordinates of boxes
      to those of prev_boxes.
  
      min_iou is the minimum IOU required for a match."""
      if not boxes:
          return []
      if not prev_boxes:
          return [None] * len(boxes)
      # Because aligned bounding boxes are easy to work with, we transform to
      # approximate aligned bounding boxes instead of an arbitrary quadrilateral
      boxes = [transform_box(homog, b) for b in boxes]
      # Now boxes and prev_boxes are in the same coordinate system.
      # iou has shape (len(boxes), len(prev_boxes))
      iou = ious(
          np.array([[b.matrix] for b in boxes]),
          np.array([[pb.matrix for pb in prev_boxes]]),
      )
      # linear_sum_assignment finds a minimum assignment, so subtract
      # IOUs from 1 (the max)
      weights = np.where(iou < min_iou, 1, 1 - iou)
      box_ind, prev_box_ind = scipy.optimize.linear_sum_assignment(weights)
      result = [None] * len(boxes)
      for bi, pbi in zip(box_ind, prev_box_ind):
          if weights[bi, pbi] < 1:
              result[bi] = pbi
      return result
function_tokens: def match_boxes_homog ( homog , boxes , prev_boxes , min_iou ) : if not boxes : return [ ] if not prev_boxes : return [ None ] * len ( boxes ) # Because aligned bounding boxes are easy to work with, we transform to # approximate aligned bounding boxes instead of an arbitrary quadrilateral boxes = [ transform_box ( homog , b ) for b in boxes ] # Now boxes and prev_boxes are in the same coordinate system. # iou has shape (len(boxes), len(prev_boxes)) iou = ious ( np . array ( [ [ b . matrix ] for b in boxes ] ) , np . array ( [ [ pb . matrix for pb in prev_boxes ] ] ) , ) # linear_sum_assignment finds a minimum assignment, so subtract # IOUs from 1 (the max) weights = np . where ( iou < min_iou , 1 , 1 - iou ) box_ind , prev_box_ind = scipy . optimize . linear_sum_assignment ( weights ) result = [ None ] * len ( boxes ) for bi , pbi in zip ( box_ind , prev_box_ind ) : if weights [ bi , pbi ] < 1 : result [ bi ] = pbi return result