diff --git a/main.py b/main.py index 94a19d1..c2bb530 100644 --- a/main.py +++ b/main.py @@ -202,7 +202,7 @@ def main(): # main method defined # if out is not None: # out.write(frame) - if tracking_data is not None and main_controller.send_tracking_data: + if len(tracking_data) != 0 and main_controller.send_tracking_data: # sort tracking data by closests object logger.info(tracking_data) tracking_data = sorted(tracking_data, key = lambda i: i['dist']) diff --git a/processing/port_tracker.py b/processing/port_tracker.py index a6d925a..08f43c6 100644 --- a/processing/port_tracker.py +++ b/processing/port_tracker.py @@ -72,7 +72,7 @@ def process(img, camera, frame_cnt, color_profile): # if shape_util.dimensions_match(contour, 6,1, WIDTH_TO_HEIGHT_RATIO): # print 'x:%s, y:%s angle:%s ' % ( center_mass_x, center_mass_y, angle ) - distance = shape_util.ge:(w) + distance = shape_util.distance_in_inches_long(w) angle = shape_util.get_angle(camera, center_mass_x, center_mass_y) font = cv2.FONT_HERSHEY_DUPLEX