RoboCarts
Functions
finish_location Namespace Reference

Functions

def check_if_vertical (pt1, pt2)
 
def get_vertical_lines (lines, img_height)
 
def find_line_on_the_right (vertical_lines)
 
def detect_finish (img, img_height)
 
def adjust_endpoints_to_frame (pt1, pt2, img_height)
 

Detailed Description

@file finish_location.py
@brief This file contains functions for the finish line location

Inspired by https://docs.opencv.org/3.4/d9/db0/tutorial_hough_lines.html

Function Documentation

◆ adjust_endpoints_to_frame()

def finish_location.adjust_endpoints_to_frame (   pt1,
  pt2,
  img_height 
)
Finds line's endpoints that are on the boarder of the frame
:param pt1: endpoint 1
:param pt2: endpoint 2
:param img_height: image height
:return: adjusted endpoints

◆ check_if_vertical()

def finish_location.check_if_vertical (   pt1,
  pt2 
)
Checks if a line is vertical - checks whether the difference of x coordinates of end points is less
then the difference of their y coordinates
:param pt1: endpoint 1
:param pt2: endpoint 2
:return: verticality check flag

◆ detect_finish()

def finish_location.detect_finish (   img,
  img_height 
)
Detects a finish line in the image
:param img_height: image height
:param img: source image
:return: finish line (represented as two endpoints)

◆ find_line_on_the_right()

def finish_location.find_line_on_the_right (   vertical_lines)
Finds the line with the rightmost endpoint
:param vertical_lines: vertical lines (each represented by its two endpoints)
:return: rightmost line

◆ get_vertical_lines()

def finish_location.get_vertical_lines (   lines,
  img_height 
)
Transforms Hough lines to end-point format lines and filters the vertical ones
:param img_height: height of an image
:param lines: lines from OpenCV HoughLines function
:return: vertical lines