Detects the lane the vehicle is in and other lane-related metrics.
More...
#include "LaneDetector.hpp"
|
class | RollingAverage |
| Calculates a rolling average to provide a smoothed view of state trends over time. This class is in the private scope as the implementation is LaneDetector-specific. More...
|
|
void | AnalyseHoughLines (const std::vector< cv::Vec4i > &p_houghLines, const ObjectDetectionInformation &p_objectDetectionInformation, const bool &p_debugMode) |
| Determines whether the detected hough lines are left, middle or right lane lines. The majority of the noise removal occurs here.
|
void | UpdateLineTypes () |
| Determines whether the left, middle, and right lane lines detected are solid, dashed or empty.
|
void | UpdateDrivingState () |
| Determines the current driving state depending upon the absence/presence of left, right and middle lane lines.
|
void | ExecuteDrivingState () |
| Execute logic based on the current driving state.
|
void | CalculateLanePosition () |
| Determines the lane overlay for the current lane.
|
void | CalculateChangingLanesTurningDirection () |
| Determines the direction (left, right or neither) that the vehicle is turning while changing lanes.
|
Detects the lane the vehicle is in and other lane-related metrics.
Definition at line 23 of file LaneDetector.hpp.
◆ LaneDetector()
LaneAndObjectDetection::LaneDetector::LaneDetector |
( |
| ) |
|
|
explicit |
◆ RunLaneDetector()
void LaneAndObjectDetection::LaneDetector::RunLaneDetector |
( |
const cv::Mat & | p_frame, |
|
|
const ObjectDetectionInformation & | p_objectDetectionInformation, |
|
|
const bool & | p_debugMode ) |
Runs the lane detector against p_frame.
- Parameters
-
p_frame | The frame to run the lane detector against. |
p_objectDetectionInformation | The ObjectDetectionInformation struct containing all object detection-related information. |
p_debugMode | Whether in debug mode. |
Definition at line 34 of file LaneDetector.cpp.
◆ GetInformation()
◆ AnalyseHoughLines()
void LaneAndObjectDetection::LaneDetector::AnalyseHoughLines |
( |
const std::vector< cv::Vec4i > & | p_houghLines, |
|
|
const ObjectDetectionInformation & | p_objectDetectionInformation, |
|
|
const bool & | p_debugMode ) |
|
private |
Determines whether the detected hough lines are left, middle or right lane lines. The majority of the noise removal occurs here.
- Parameters
-
p_houghLines | The hough lines that have been detected. |
p_objectDetectionInformation | The ObjectDetectionInformation struct containing the object bounding boxes. |
p_debugMode | Whether in debug mode. |
Definition at line 108 of file LaneDetector.cpp.
◆ IsLineWithinObjectBoundingBoxes()
bool LaneAndObjectDetection::LaneDetector::IsLineWithinObjectBoundingBoxes |
( |
const cv::Vec4i & | p_houghLine, |
|
|
const ObjectDetectionInformation & | p_objectDetectionInformation ) |
|
staticprivate |
Determines whether p_houghLine is within any one of the p_objectDetectionInformation object bounding boxes.
- Parameters
-
p_houghLine | The line to check. |
p_objectDetectionInformation | The ObjectDetectionInformation struct containing the object bounding boxes. |
- Returns
- true If p_houghLine is within the object bounding boxes found within p_objectDetectionInformation.
-
false If p_houghLine is NOT within the object bounding boxes found within p_objectDetectionInformation.
Definition at line 256 of file LaneDetector.cpp.
◆ UpdateLineTypes()
void LaneAndObjectDetection::LaneDetector::UpdateLineTypes |
( |
| ) |
|
|
private |
Determines whether the left, middle, and right lane lines detected are solid, dashed or empty.
Definition at line 279 of file LaneDetector.cpp.
◆ UpdateDrivingState()
void LaneAndObjectDetection::LaneDetector::UpdateDrivingState |
( |
| ) |
|
|
private |
Determines the current driving state depending upon the absence/presence of left, right and middle lane lines.
Definition at line 306 of file LaneDetector.cpp.
◆ ExecuteDrivingState()
void LaneAndObjectDetection::LaneDetector::ExecuteDrivingState |
( |
| ) |
|
|
private |
Execute logic based on the current driving state.
Definition at line 368 of file LaneDetector.cpp.
◆ CalculateLanePosition()
void LaneAndObjectDetection::LaneDetector::CalculateLanePosition |
( |
| ) |
|
|
private |
Determines the lane overlay for the current lane.
Definition at line 400 of file LaneDetector.cpp.
◆ CalculateChangingLanesTurningDirection()
void LaneAndObjectDetection::LaneDetector::CalculateChangingLanesTurningDirection |
( |
| ) |
|
|
private |
Determines the direction (left, right or neither) that the vehicle is turning while changing lanes.
Definition at line 492 of file LaneDetector.cpp.
◆ m_laneDetectionInformation
◆ m_drivingStateRollingAverage
The rolling average to determine the driving state.
Definition at line 133 of file LaneDetector.hpp.
◆ m_currentDrivingState
◆ m_leftLaneLines
std::vector<cv::Vec4i> LaneAndObjectDetection::LaneDetector::m_leftLaneLines |
|
private |
The left, middle and right lane lines that have been detected for the current frame.
Definition at line 144 of file LaneDetector.hpp.
◆ m_middleLaneLines
std::vector<cv::Vec4i> LaneAndObjectDetection::LaneDetector::m_middleLaneLines |
|
private |
The left, middle and right lane lines that have been detected for the current frame.
Definition at line 145 of file LaneDetector.hpp.
◆ m_rightLaneLines
std::vector<cv::Vec4i> LaneAndObjectDetection::LaneDetector::m_rightLaneLines |
|
private |
The left, middle and right lane lines that have been detected for the current frame.
Definition at line 146 of file LaneDetector.hpp.
◆ m_changingLanesPreviousDistanceDifference
double LaneAndObjectDetection::LaneDetector::m_changingLanesPreviousDistanceDifference |
|
private |
The distance difference that will be compared to in order to determine the direction the vehicle is moving while changing lanes.
Definition at line 153 of file LaneDetector.hpp.
◆ m_leftLineAverageLength
double LaneAndObjectDetection::LaneDetector::m_leftLineAverageLength |
|
private |
The average left, middle and right lane line lengths for the current frame.
Definition at line 159 of file LaneDetector.hpp.
◆ m_middleLineAverageLength
double LaneAndObjectDetection::LaneDetector::m_middleLineAverageLength |
|
private |
The average left, middle and right lane line lengths for the current frame.
Definition at line 160 of file LaneDetector.hpp.
◆ m_rightLineAverageLength
double LaneAndObjectDetection::LaneDetector::m_rightLineAverageLength |
|
private |
The average left, middle and right lane line lengths for the current frame.
Definition at line 161 of file LaneDetector.hpp.
◆ m_changingLanesFrameCount
uint32_t LaneAndObjectDetection::LaneDetector::m_changingLanesFrameCount |
|
private |
The number of frames passed since a distance difference was calculated while the vehicle is changing lanes.
Definition at line 167 of file LaneDetector.hpp.
◆ m_changingLanesFirstFrame
bool LaneAndObjectDetection::LaneDetector::m_changingLanesFirstFrame |
|
private |
Whether the current frame is the frame in which the driving state changed to CHANGING_LANES.
Definition at line 172 of file LaneDetector.hpp.
The documentation for this class was generated from the following files: