RoboCarts
Public Member Functions | Public Attributes | List of all members
ga_classes.Blob Class Reference

Public Member Functions

def __init__ (self, cnt, blob_id, finish_p1, finish_p2)
 
def get_car_instance (self, cars)
 
def update_contour (self, new_contour)
 
def find_biggest_contour_overlap (self, blobs_list, only_biggest=True)
 
def find_matching_hist (self, frame, templates)
 
def find_matching_template (self, frame, templates)
 
def get_similarity_score (self, frame, templates)
 
def intersect_list (self, l)
 
def union_list (self, l)
 
def get_union_intersection (self, rectangles)
 
def match_car_tuple (self, car_tuple, contour_img)
 
def try_match_more_templates (self, frame, cars, max_overlap=0.1)
 
def check_if_crossed_line (self, finish_p1, finish_p2, cars, finish_time)
 

Public Attributes

 blob_id
 
 current_contour
 
 rectangle
 
 car
 
 template_match_value
 
 similarity_max_score
 
 last_similarity_score
 
 already_finished
 
 not_seen
 
 centroid
 
 centroids
 
 appeared_from_left
 

Detailed Description

Class for representing moving object detections in the General algorithm

Member Function Documentation

◆ check_if_crossed_line()

def ga_classes.Blob.check_if_crossed_line (   self,
  finish_p1,
  finish_p2,
  cars,
  finish_time 
)
Checks if the Blob instance crossed the finish line and updates times accordingly
:param finish_p1: finish endpoint 1
:param finish_p2: finish endpoint 2
:param cars: list of Car instances
:param finish_time: finish time in secs
:return: check flag

◆ find_biggest_contour_overlap()

def ga_classes.Blob.find_biggest_contour_overlap (   self,
  blobs_list,
  only_biggest = True 
)
Finds another Blob instance which the current contour has the biggest overlap/iou with
:param blobs_list: detections of current frame
:param only_biggest: flag
:return: max iou, best matching detection (o_b = True) / ious with all detections (o_b = False)

◆ find_matching_hist()

def ga_classes.Blob.find_matching_hist (   self,
  frame,
  templates 
)
Finds the most similar reference car's histogram to the current contour
:param frame: source image
:param templates: templates
:return: similarity scores to all templates

◆ find_matching_template()

def ga_classes.Blob.find_matching_template (   self,
  frame,
  templates 
)
Finds the best matching reference car to the current contour with template matching
:param frame: current frame
:param templates: list of Car instances
:return: matching scores to all reference images

◆ get_car_instance()

def ga_classes.Blob.get_car_instance (   self,
  cars 
)
Return the associated Car instance
:param cars: list of cars
:return: Car instance

◆ get_similarity_score()

def ga_classes.Blob.get_similarity_score (   self,
  frame,
  templates 
)
Computes the similarity score of a detection
:param frame: current frame
:param templates: list of Car instances
:return: list of similarity scores for all reference images

◆ get_union_intersection()

def ga_classes.Blob.get_union_intersection (   self,
  rectangles 
)
Computes the areas of rectangles' union and maximal intersection
:param rectangles: list of rectangles
:return: union and intersected area

◆ intersect_list()

def ga_classes.Blob.intersect_list (   self,
  l 
)
Computes the intersection area of several rectangles
:param l: list of rectangles
:return: intersection rectangle

◆ match_car_tuple()

def ga_classes.Blob.match_car_tuple (   self,
  car_tuple,
  contour_img 
)
Auxiliary function for matching templates to a cluster
:param car_tuple: list of Car instances
:param contour_img: image of the cluster
:return: iou, average similarity score and matched rectangles

◆ try_match_more_templates()

def ga_classes.Blob.try_match_more_templates (   self,
  frame,
  cars,
  max_overlap = 0.1 
)
Evaluates what car combination is best matching to a cluster
:param max_overlap: condition for maximal allowed car overlap
:param frame: source frame
:param cars: list of Car instances
:return: check flag and matched rectangles in the cluster

◆ union_list()

def ga_classes.Blob.union_list (   self,
  l 
)
Computes the union area of several rectangles
:param l: list of rectangles
:return: union rectangle

◆ update_contour()

def ga_classes.Blob.update_contour (   self,
  new_contour 
)
Updates position of a new contour
:param new_contour: a new contour for update
:return: -

The documentation for this class was generated from the following file: