|
RoboCarts
|
Classes | |
| class | Blob |
| class | Car |
Functions | |
| def | delete_unused_blobs (existing_blobs, limit=10) |
| def | get_centroid (contour) |
| def | find_car (cars, name) |
| def | union (rect1, rect2) |
| def | intersection (rect1, rect2) |
| def | rect_intersection (rect1, rect2) |
| def | rect_union (rect1, rect2) |
| def | contours_iou (cnt1, cnt2) |
| def | tl_br_to_xywh (rectangle) |
| def | find_best_match (results) |
| def | adjust_contour_img_to_template (contour_img, template) |
| def | eval_template (template, contour_img) |
| def | softmax (x) |
| def | normalize_score (results) |
@file ga_classes.py @brief This file contains classes for the General algorithm
| def ga_classes.adjust_contour_img_to_template | ( | contour_img, | |
| template | |||
| ) |
Function for resizing the source image and template for template matching :param contour_img: source image :param template: template :return: resized source image
| def ga_classes.contours_iou | ( | cnt1, | |
| cnt2 | |||
| ) |
Computes IoU of two contours :param cnt1: contour 1 :param cnt2: contour 2 :return: contours IoU
| def ga_classes.delete_unused_blobs | ( | existing_blobs, | |
limit = 10 |
|||
| ) |
Auxiliary function for deleting unused blobs from the programs memory :param existing_blobs: list of existing blobs :param limit: limit of consecutive frames that the blobs can be absent from :return: new list of blobs
| def ga_classes.eval_template | ( | template, | |
| contour_img | |||
| ) |
Computes the template matching's similarity score and location :param template: reference image :param contour_img: contour image :return: score, rectangle(tl-br)
| def ga_classes.find_best_match | ( | results | ) |
Finds the best matching combination of cars to a cluster :param results: results of the 'match_car_tuple' function :return: best matching combination of cars
| def ga_classes.find_car | ( | cars, | |
| name | |||
| ) |
Auxiliary function that finds a Car instance based on its name/id :param cars: Car instance :param name: name :return: Car instance with the name
| def ga_classes.get_centroid | ( | contour | ) |
Computes the centroid position of a contour :param contour: contour :return: centroid's coordinates
| def ga_classes.intersection | ( | rect1, | |
| rect2 | |||
| ) |
Finds the intersection of two rectangles :param rect1: rectangle 1 :param rect2: rectangle 2 :return: intersection rectangle
| def ga_classes.normalize_score | ( | results | ) |
Normalizes similarity scores with the softmax :param results: dictionary of similarity scores (car_name : score) :return: dictionary of normalized similarity scores
| def ga_classes.rect_intersection | ( | rect1, | |
| rect2 | |||
| ) |
Computes the size of intersection area of two rectangles :param rect1: rectangle 1 :param rect2: rectangle 2 :return: intersection area
| def ga_classes.rect_union | ( | rect1, | |
| rect2 | |||
| ) |
Computes the size of union area of two rectangles :param rect1: rectangle 1 :param rect2: rectangle 2 :return: union area
| def ga_classes.softmax | ( | x | ) |
Computes the softmax value of a vector :param x: vector :return: softmax(x)
| def ga_classes.tl_br_to_xywh | ( | rectangle | ) |
Transfers a rectangle from top-left, bottom-right format to x,y,width,height format :param rectangle: rectangle in tl-br format :return: rectangle in x,y,w,h format
| def ga_classes.union | ( | rect1, | |
| rect2 | |||
| ) |
Finds the union of two rectangles :param rect1: rectangle 1 :param rect2: rectangle 2 :return: union rectangle
1.8.13