#include <BorderDetector.h>
nxpcup::BorderDetector::BorderDetector |
( |
Config |
config | ) |
|
|
inline |
int nxpcup::BorderDetector::error |
( |
const int |
percentCoefficient = 100 | ) |
const |
|
inline |
Calculate the error from the actual border (left and right) as distance from the center.
- Parameters
-
percentCoefficient | how many percent of error return (0 <-> 100) default value: 100 percent |
- Returns
- if the value is smaller than 0, the line of left side is closer to center then the line on right side if the value is bigger than 0, then the result is opposite
Find the maximal values from center and set position of this max value as left and right border.
- Parameters
-
void nxpcup::BorderDetector::initalize |
( |
const std::array< ImageType, Config::dataSize > & |
data, |
|
|
const uint8_t |
percentCoefficient = 100 |
|
) |
| |
|
inline |
Initialize the detector and set threshold value. Need to have correct data from a camera with well visible lanes.
- Parameters
-
data | image from camera |
percentCoefficient | how many percent of error return (0 <-> 100) |
int nxpcup::BorderDetector::leftBorder |
( |
| ) |
const |
|
inline |
int nxpcup::BorderDetector::leftDistanceFromCenter |
( |
| ) |
const |
|
inline |
Get distance just with information about left border. Take data from last callfindBorder}.
int nxpcup::BorderDetector::rightBorder |
( |
| ) |
const |
|
inline |
int nxpcup::BorderDetector::rightDistanceFromCenter |
( |
| ) |
const |
|
inline |
Get distance just with information about right border. Take data from last callfindBorder}.
The documentation for this class was generated from the following file: