8#ifndef META_OCEAN_CV_DETECTOR_LINE_DETECTOR_HOUGH_H
9#define META_OCEAN_CV_DETECTOR_LINE_DETECTOR_HOUGH_H
28namespace Test {
namespace TestCV {
namespace TestDetector {
class TestLineDetectorHough; } } }
78 inline Line2 cornerAlignedLine(
const unsigned int width,
const unsigned int height)
const;
84 inline const Vector2& normal()
const;
90 inline Scalar angle()
const;
97 inline Scalar distance()
const;
103 inline Scalar strength()
const;
128 inline bool operator<(
const InfiniteLine& second)
const;
140 static inline Lines2 cornerAlignedLines(
const InfiniteLine* lines,
const size_t size,
const unsigned int width,
const unsigned int height,
Scalar* strengths =
nullptr);
195 inline AngleLookupData(
const unsigned int angleBin,
const unsigned int weight);
200 unsigned int angleBin_ = (
unsigned int)(-1);
203 unsigned int weight_ = 0u;
247 typedef std::pair<unsigned int, bool>
MapPair;
252 typedef std::tuple<unsigned int, unsigned int, bool>
MapTriple;
328 Accumulator(
const unsigned int width,
const unsigned int height,
const unsigned int distanceBins,
const unsigned int angleBins,
const unsigned int mirroredAngleBins,
const bool halfOrientationPrecision);
337 void accumulate(
const unsigned int x,
const unsigned int y,
const int8_t* responses,
const unsigned int angleNeigbors = 3u);
346 void accumulateDiagonal(
const unsigned int x,
const unsigned int y,
const int8_t* responsesDiagonal,
const unsigned int angleNeigbors = 3u);
357 inline unsigned int width()
const;
363 inline unsigned int height()
const;
369 inline unsigned int distanceBins()
const;
375 inline unsigned int angleBins()
const;
381 inline unsigned int angleBinsCore()
const;
387 inline unsigned int mirroredAngleBins()
const;
393 inline const uint32_t* votes()
const;
410 void detectPeaks(
InfiniteLines& lines,
const unsigned int voteThreshold,
const bool determineExactPeakMaximum,
Worker* worker =
nullptr,
const bool smoothAccumulator =
false);
453 explicit inline operator bool()
const;
467 void detectPeaksSubset(
const unsigned int voteThreshold,
const bool determineExactPeakMaximum,
Lock* lock,
InfiniteLines* lines,
const unsigned int firstAngleBin,
const unsigned int numberAngleBins);
481 void detectAdaptivePeaksSubset(
const uint32_t* borderedIntegralAccumulator,
const Scalar adaptiveVoteThresholdFactor,
const unsigned int windowHalf,
const bool determineExactPeakMaximum,
Lock* lock,
InfiniteLines* lines,
const unsigned int firstAngleBin,
const unsigned int numberAngleBins);
490 static void joinTwo(
Accumulator* accumulators,
const unsigned int firstAngleBin,
const unsigned int numberAngleBins);
499 static void joinFour(
Accumulator* accumulators,
const unsigned int firstAngleBin,
const unsigned int numberAngleBins);
509 static void join(
Accumulator* accumulators,
const unsigned int number,
const unsigned int firstAngleBin,
const unsigned int numberAngleBins);
517 int accumulatorMaximalDistance_ = 0;
520 int accumulatorDistanceBinsHalf_ = 0;
523 unsigned int accumulatorMirroredAngleBins_ = 0u;
526 const unsigned int accumulatorImageWidth_ = 0u;
529 const unsigned int accumulatorImageHeight_ = 0u;
532 const unsigned int accumulatorImageWidthHalf_ = 0u;
535 const unsigned int accumulatorImageHeightHalf_ = 0u;
538 bool accumulatorHalfOrientationPrecision_ =
false;
551 bool debugMirroredAngleBinsCreated_ =
false;
583 FR_HORIZONTAL_VERTICAL = 1u,
587 FR_HORIZONTAL_VERTICAL_DIAGONAL = FR_HORIZONTAL_VERTICAL | FR_DIAGONAL
614 static inline bool detectLines(
const Frame& frame,
const FilterType filterType,
const FilterResponse filterResponse, InfiniteLines& infiniteLines,
FiniteLines2* finiteLines =
nullptr,
const bool optimizeLines =
true,
const unsigned int accumulatorThreshold = 100u,
const unsigned int voteThreshold = 16u,
const unsigned int angleNeigbors = 2u,
const bool determineExactPeakMaximum =
true,
Worker* worker =
nullptr,
const unsigned int anglePrecision = 360u,
const unsigned int distancePrecision = (
unsigned int)(-1),
const bool halfOrientationPrecision =
true,
const Scalar similarDistance =
Scalar(10),
const Scalar similarAngle = Numeric::deg2rad(5));
639 static inline bool detectLinesWithAdaptiveThreshold(
const Frame& frame,
const FilterType filterType,
const FilterResponse filterResponse, InfiniteLines& infiniteLines,
FiniteLines2* finiteLines =
nullptr,
const bool optimizeLines =
true,
const Scalar adaptiveVoteThresholdFactor =
Scalar(8),
const unsigned int thresholdWindow = 61u,
const unsigned int voteThreshold = 16,
const unsigned int angleNeigbors = 2u,
const bool determineExactPeakMaximum =
true,
Worker* worker =
nullptr,
const unsigned int anglePrecision = 360u,
const unsigned int distancePrecision = (
unsigned int)(-1),
const bool halfOrientationPrecision =
true,
const Scalar similarDistance =
Scalar(10),
const Scalar similarAngle = Numeric::deg2rad(5));
675 static inline void sortLinesAccordingDistance(
InfiniteLines& lines);
682 template <
typename T>
683 static inline void sortGroupsDescendingAccordingElements(std::vector<std::vector<T>>& groups);
709 static bool internalDetectLines(
const Frame& frame,
const FilterType filterType,
const FilterResponse filterResponse,
InfiniteLines& infiniteLines,
FiniteLines2* finiteLines,
const bool optimizeLines,
const Scalar thresholdParameter,
const unsigned int adaptiveThresholdWindowHalf,
const unsigned int voteThreshold,
const unsigned int angleNeigbors,
const bool determineExactPeakMaximum,
Worker* worker,
const unsigned int anglePrecision,
const unsigned int distancePrecision,
const bool halfOrientationPrecision,
const Scalar similarDistance,
const Scalar similarAngle);
731 static void createVotesDiagonalSubset(
const int8_t* response,
Accumulator* accumulator,
const unsigned int angleNeigbors,
const unsigned int voteThreshold,
const unsigned int firstRow,
const unsigned int numberRows);
760 static void detectFiniteLinesSubset(
const InfiniteLines* infiniteLines,
const int8_t* response,
const unsigned int width,
const unsigned int height,
const FilterResponse filterResponse,
const unsigned int angleBins,
const Accumulator::AngleLookupData* horizontalAngleLookup,
const Accumulator::AngleLookupData* diagonalAngleLookup,
const bool halfOrientationPrecision,
Lock* lock,
FiniteLines2* finiteLines,
const unsigned int firstLine,
const unsigned int numberLines);
792 static void optimizeInfiniteLinesSubset(
const InfiniteLine* infiniteLines,
const size_t number,
const int8_t* response,
const unsigned int width,
const unsigned int height,
const FilterResponse filterResponse,
const unsigned int radius,
const Accumulator* accumulator,
const bool halfOrientationPrecision,
InfiniteLine* optimizedLines,
const unsigned int firstLine,
const unsigned int numberLines);
817 template <
typename T>
818 static inline bool compareElements(
const std::vector<T>& first,
const std::vector<T>& second);
822 Line2(normal * distance, normal.perpendicular()),
835 ocean_assert(width >= 3u && height >= 3u);
839 return Line2(frameCenter + point(), direction());
844 ocean_assert(width >= 3u && height >= 3u);
854 result.reserve(size);
860 for (
size_t n = 0; n < size; ++n)
862 result.push_back(
Line2(frameCenter + lines[n].point(), lines[n].direction()));
868 for (
size_t n = 0; n < size; ++n)
870 result.push_back(
Line2(frameCenter + lines[n].point(), lines[n].direction()));
951inline LineDetectorHough::Accumulator::operator bool()
const
964 std::sort(groups.begin(), groups.end(), compareElements<T>);
969 return first.size() > second.size();
980 return first.size() > second.size();
983inline bool LineDetectorHough::detectLines(
const Frame& frame,
const FilterType filterType,
const FilterResponse filterResponse,
InfiniteLines& infiniteLines,
FiniteLines2* finiteLines,
const bool optimizeLines,
const unsigned int accumulatorThreshold,
const unsigned int voteThreshold,
const unsigned int angleNeigbors,
const bool determineExactPeakMaximum,
Worker* worker,
const unsigned int anglePrecision,
const unsigned int distancePrecision,
const bool halfOrientationPrecision,
const Scalar similarDistance,
const Scalar similarAngle)
985 ocean_assert(accumulatorThreshold > 0);
986 ocean_assert(similarDistance >= 0);
987 ocean_assert(similarAngle >= 0);
989 return internalDetectLines(frame, filterType, filterResponse, infiniteLines, finiteLines, optimizeLines,
Scalar(accumulatorThreshold), 0u, voteThreshold, angleNeigbors, determineExactPeakMaximum, worker, anglePrecision, distancePrecision, halfOrientationPrecision, similarDistance, similarAngle);
992inline bool LineDetectorHough::detectLinesWithAdaptiveThreshold(
const Frame& frame,
const FilterType filterType,
const FilterResponse filterResponse,
InfiniteLines& infiniteLines,
FiniteLines2* finiteLines,
const bool optimizeLines,
const Scalar thresholdRatio,
const unsigned int thresholdWindow,
const unsigned int voteThreshold,
const unsigned int angleNeigbors,
const bool determineExactPeakMaximum,
Worker* worker,
const unsigned int anglePrecision,
const unsigned int distancePrecision,
const bool halfOrientationPrecision,
const Scalar similarDistance,
const Scalar similarAngle)
994 ocean_assert(thresholdRatio > 0 && thresholdWindow > 0u);
995 ocean_assert(similarDistance >= 0);
996 ocean_assert(similarAngle >= 0);
998 ocean_assert(thresholdWindow >= 5u && (thresholdWindow % 2u) == 1u);
1000 const unsigned int adaptiveThresholdWindowHalf = thresholdWindow / 2u;
1002 return internalDetectLines(frame, filterType, filterResponse, infiniteLines, finiteLines, optimizeLines, thresholdRatio, adaptiveThresholdWindowHalf, voteThreshold, angleNeigbors, determineExactPeakMaximum, worker, anglePrecision, distancePrecision, halfOrientationPrecision, similarDistance, similarAngle);
This class holds angle lookup data.
Definition LineDetectorHough.h:182
AngleLookupData()=default
Creates an empty lookup object.
This class holds distance lookup data.
Definition LineDetectorHough.h:210
DirectionLookupData()=default
Creates an empty lookup object.
This class defines a data lookup manager defined as singleton.
Definition LineDetectorHough.h:238
const AngleLookupData * angleLookupData8BitResponse16BitRequest(const unsigned int angleBins, const bool halfOrientationPrecision)
Returns the angle lookup data for 8 bit horizontal and vertical response values.
const AngleLookupData * angleLookupDataDiagonal8BitResponse16BitRequest(const unsigned int angleBins, const bool halfOrientationPrecision)
Returns the angle lookup data for 8 bit diagonal (45 and 135 degree) response values.
Lock lock_
The manager's look.
Definition LineDetectorHough.h:313
std::pair< unsigned int, bool > MapPair
Definition of a pair combining an unsigned integer with a boolean state.
Definition LineDetectorHough.h:247
const DirectionLookupData * directionLookupData(const unsigned int angleBins, const unsigned int distanceBins, const bool halfOrientationPrecision)
Returns the direction lookup data for an angle request.
DirectionLookupMap directionLookupMap_
Lookup map for directions.
Definition LineDetectorHough.h:310
std::map< MapTriple, DirectionLookupData * > DirectionLookupMap
Definition of a map mapping precision values to direction lookup data.
Definition LineDetectorHough.h:262
std::tuple< unsigned int, unsigned int, bool > MapTriple
Definition of a tuple combining angleBins, distanceBins and halfOrientationPrecision.
Definition LineDetectorHough.h:252
AngleLookupMap angleLookupMapDiagonal_
Lookup map for angles, diagonal.
Definition LineDetectorHough.h:307
~LookupManager()
Destructs a manager.
AngleLookupMap angleLookupMap_
Lookup map for angles, horizontal and vertical.
Definition LineDetectorHough.h:304
std::map< MapPair, AngleLookupData * > AngleLookupMap
Definition of a map mapping precision values to angle lookup data.
Definition LineDetectorHough.h:257
Vote accumulator array.
Definition LineDetectorHough.h:173
unsigned int distanceBins() const
Returns the distance precision of this accumulator.
Definition LineDetectorHough.h:926
static void joinFour(Accumulator *accumulators, const unsigned int firstAngleBin, const unsigned int numberAngleBins)
Joins a subset of four accumulator objects.
unsigned int angleBins() const
Returns the number of bins this accumulator stores for angle votes (including the additional bins for...
Definition LineDetectorHough.h:931
void detectAdaptivePeaks(InfiniteLines &lines, const Scalar adaptiveVoteThresholdFactor, const unsigned int windowHalf, const bool determineExactPeakMaximum, Worker *worker=nullptr, const bool smoothAccumulator=false)
Detects peaks inside a subset of the accumulator votes using a surrounding window to determine the th...
static void joinTwo(Accumulator *accumulators, const unsigned int firstAngleBin, const unsigned int numberAngleBins)
Joins a subset of two accumulator objects.
const unsigned int accumulatorImageHeight_
Height of the original image in pixel.
Definition LineDetectorHough.h:529
void detectAdaptivePeaksSubset(const uint32_t *borderedIntegralAccumulator, const Scalar adaptiveVoteThresholdFactor, const unsigned int windowHalf, const bool determineExactPeakMaximum, Lock *lock, InfiniteLines *lines, const unsigned int firstAngleBin, const unsigned int numberAngleBins)
Detects peaks inside a subset of the accumulator votes using a surrounding window to determine the th...
static void joinTwo(Accumulator *accumulators, Worker *worker=nullptr)
Joins two accumulator objects.
unsigned int angleBinsCore() const
Returns the angle precision of this accumulator.
Definition LineDetectorHough.h:936
void createMirroredAngleBins()
Creates the additional mirrored angle bins at the top and bottom of the accumulator frame.
void detectPeaksSubset(const unsigned int voteThreshold, const bool determineExactPeakMaximum, Lock *lock, InfiniteLines *lines, const unsigned int firstAngleBin, const unsigned int numberAngleBins)
Detects peaks inside a subset of the accumulator votes.
void detectPeaks(InfiniteLines &lines, const unsigned int voteThreshold, const bool determineExactPeakMaximum, Worker *worker=nullptr, const bool smoothAccumulator=false)
Detects peaks inside the accumulator votes.
void accumulateDiagonal(const unsigned int x, const unsigned int y, const int8_t *responsesDiagonal, const unsigned int angleNeigbors=3u)
Adds a new diagonal (45 degree and 135 degree) filter edge filter response to accumulate the correspo...
unsigned int mirroredAngleBins() const
Returns the additional angle bins of this accumulator.
Definition LineDetectorHough.h:941
void clear()
Clears the accumulation buffer.
unsigned int width() const
Returns the width of the original image in pixel.
Definition LineDetectorHough.h:916
Frame accumulatorFrame_
Array holding the individual votes.
Definition LineDetectorHough.h:514
void accumulate(const unsigned int x, const unsigned int y, const int8_t *responses, const unsigned int angleNeigbors=3u)
Adds a new horizontal and vertical edge filter response to accumulate the corresponding vote.
unsigned int accumulatorMirroredAngleBins_
Additional angle bins simplifying border operations.
Definition LineDetectorHough.h:523
const uint32_t * votes() const
Returns the vote buffer stored for this accumulator.
Definition LineDetectorHough.h:946
const unsigned int accumulatorImageWidth_
Width of the original image in pixel.
Definition LineDetectorHough.h:526
Accumulator(const unsigned int width, const unsigned int height, const unsigned int distanceBins, const unsigned int angleBins, const unsigned int mirroredAngleBins, const bool halfOrientationPrecision)
Creates a new vote element by the given precisions for distance and angle.
static void joinFour(Accumulator *accumulators, Worker *worker=nullptr)
Joins four accumulator objects.
static void join(Accumulator *accumulators, const unsigned int number, Worker *worker=nullptr)
Joins an arbitrary number of accumulator objects.
unsigned int height() const
Returns the height of the original image in pixel.
Definition LineDetectorHough.h:921
static void join(Accumulator *accumulators, const unsigned int number, const unsigned int firstAngleBin, const unsigned int numberAngleBins)
Joins a subset of an arbitrary number of accumulator objects.
This class defines an infinite 2D line.
Definition LineDetectorHough.h:54
Scalar strength() const
Returns the strength of this line.
Definition LineDetectorHough.h:892
Vector2 normal_
Line normal.
Definition LineDetectorHough.h:145
bool isParallel(const InfiniteLine &line, const Scalar cosAngle) const
Returns whether two lines are parallel up to a given angle precision.
Scalar strength_
Line strength.
Definition LineDetectorHough.h:154
InfiniteLine()=default
Creates an empty line object.
Scalar angle() const
Returns the angle of this line.
Definition LineDetectorHough.h:882
Line2 cornerAlignedLine(const unsigned int width, const unsigned int height) const
Converts this line (with origin defined in the center of the frame) to a line with origin defined in ...
Definition LineDetectorHough.h:833
const Vector2 & normal() const
Returns the normal of this line.
Definition LineDetectorHough.h:877
bool isSimilar(const InfiniteLine &line, const Scalar distance, const Scalar cosAngle, const bool halfOrientationPrecision) const
Returns whether two lines are similar up to a given distance and angle precision.
static Lines2 cornerAlignedLines(const InfiniteLine *lines, const size_t size, const unsigned int width, const unsigned int height, Scalar *strengths=nullptr)
Converts lines (with origin defined in the center of the frame) to a lines with origin defined in the...
Definition LineDetectorHough.h:842
bool operator<(const InfiniteLine &second) const
Returns whether this line object has a lower strength value than the second one.
Definition LineDetectorHough.h:897
Scalar distance() const
Returns the distance of this line.
Definition LineDetectorHough.h:887
This class implements a line detector mainly based on the Hough transformation.
Definition LineDetectorHough.h:43
std::vector< InfiniteLine > InfiniteLines
Definition of a vector holding infinite lines.
Definition LineDetectorHough.h:160
static void detectFiniteLinesSubset(const InfiniteLines *infiniteLines, const int8_t *response, const unsigned int width, const unsigned int height, const FilterResponse filterResponse, const unsigned int angleBins, const Accumulator::AngleLookupData *horizontalAngleLookup, const Accumulator::AngleLookupData *diagonalAngleLookup, const bool halfOrientationPrecision, Lock *lock, FiniteLines2 *finiteLines, const unsigned int firstLine, const unsigned int numberLines)
Detects finite lines from a subset of already detected infinite lines additionally using the frame fi...
static void optimizeInfiniteLinesSubset(const InfiniteLine *infiniteLines, const size_t number, const int8_t *response, const unsigned int width, const unsigned int height, const FilterResponse filterResponse, const unsigned int radius, const Accumulator *accumulator, const bool halfOrientationPrecision, InfiniteLine *optimizedLines, const unsigned int firstLine, const unsigned int numberLines)
Refines lines by adjusting the line with the filter responses.
FilterResponse
Definition of usage of different filter responses.
Definition LineDetectorHough.h:579
static void detectFiniteLines(const InfiniteLine &infiniteLine, const int8_t *response, const unsigned int width, const unsigned int height, const FilterResponse filterResponse, const unsigned int angleBins, const Accumulator::AngleLookupData *horizontalAngleLookup, const Accumulator::AngleLookupData *diagonalAngleLookup, const bool halfOrientationPrecision, FiniteLines2 &finiteLines)
Detects finite lines from one infinite line additionally using the frame filter responses.
static void createVotesHorizontalVerticalDiagonalSubset(const int8_t *response, Accumulator *accumulator, const unsigned int angleNeigbors, const unsigned int voteThreshold, const unsigned int firstRow, const unsigned int numberRows)
Creates line votes for horizontal, vertical and diagonal (0, 90 and 45, 135 degree) filter responses ...
static bool detectLinesWithAdaptiveThreshold(const Frame &frame, const FilterType filterType, const FilterResponse filterResponse, InfiniteLines &infiniteLines, FiniteLines2 *finiteLines=nullptr, const bool optimizeLines=true, const Scalar adaptiveVoteThresholdFactor=Scalar(8), const unsigned int thresholdWindow=61u, const unsigned int voteThreshold=16, const unsigned int angleNeigbors=2u, const bool determineExactPeakMaximum=true, Worker *worker=nullptr, const unsigned int anglePrecision=360u, const unsigned int distancePrecision=(unsigned int)(-1), const bool halfOrientationPrecision=true, const Scalar similarDistance=Scalar(10), const Scalar similarAngle=Numeric::deg2rad(5))
Detects lines inside a given frame using an adaptive threshold in combination with a surrounding wind...
Definition LineDetectorHough.h:992
static void filterLines(const InfiniteLines &lines, const Scalar minDistance, const Scalar minAngle, InfiniteLines &filteredLines, const bool halfOrientationPrecision)
Filters a set of similar detected lines so that the strongest and unique lines are returned only.
static bool parallelLines(const InfiniteLines &lines, const Scalar minAngle, InfiniteLines ¶llels)
Filters the biggest set of parallel lines from a given set of lines.
static void sortLinesAccordingDistance(InfiniteLines &lines)
Sorts lines according to their distance values.
Definition LineDetectorHough.h:956
static bool compare(const IndexSet32 &first, const IndexSet32 &second)
Compares two index sets.
Definition LineDetectorHough.h:967
static void createVotesDiagonalSubset(const int8_t *response, Accumulator *accumulator, const unsigned int angleNeigbors, const unsigned int voteThreshold, const unsigned int firstRow, const unsigned int numberRows)
Creates line votes for diagonal (45 and 135 degree) filter responses inside a given accumulator objec...
static bool internalDetectLines(const Frame &frame, const FilterType filterType, const FilterResponse filterResponse, InfiniteLines &infiniteLines, FiniteLines2 *finiteLines, const bool optimizeLines, const Scalar thresholdParameter, const unsigned int adaptiveThresholdWindowHalf, const unsigned int voteThreshold, const unsigned int angleNeigbors, const bool determineExactPeakMaximum, Worker *worker, const unsigned int anglePrecision, const unsigned int distancePrecision, const bool halfOrientationPrecision, const Scalar similarDistance, const Scalar similarAngle)
Internal line detection function to detects lines inside an 8 bit gray scale image.
static bool detectLines(const Frame &frame, const FilterType filterType, const FilterResponse filterResponse, InfiniteLines &infiniteLines, FiniteLines2 *finiteLines=nullptr, const bool optimizeLines=true, const unsigned int accumulatorThreshold=100u, const unsigned int voteThreshold=16u, const unsigned int angleNeigbors=2u, const bool determineExactPeakMaximum=true, Worker *worker=nullptr, const unsigned int anglePrecision=360u, const unsigned int distancePrecision=(unsigned int)(-1), const bool halfOrientationPrecision=true, const Scalar similarDistance=Scalar(10), const Scalar similarAngle=Numeric::deg2rad(5))
Detects lines inside a given frame using a threshold ensuring that detected lines have a specific str...
Definition LineDetectorHough.h:983
static bool compareElements(const std::vector< T > &first, const std::vector< T > &second)
Compares to groups of elements according to their size.
Definition LineDetectorHough.h:978
static void sortGroupsDescendingAccordingElements(std::vector< std::vector< T > > &groups)
Sorts groups of elements (of e.g., infinite lines) according to their number of elements in descendin...
Definition LineDetectorHough.h:962
std::vector< IndexSet32 > IndexSetVector
Definition of a vector holding index sets.
Definition LineDetectorHough.h:558
FilterType
Definition of different edge detector filters.
Definition LineDetectorHough.h:566
@ FT_SCHARR
Definition LineDetectorHough.h:570
std::vector< InfiniteLines > InfiniteLineGroups
Definition of a vector holding infinite lines.
Definition LineDetectorHough.h:165
static bool compareDistance(const InfiniteLine &first, const InfiniteLine &second)
Compares to lines according to their distance.
Definition LineDetectorHough.h:972
static void createVotesHorizontalVerticalSubset(const int8_t *response, Accumulator *accumulator, const unsigned int angleNeigbors, const unsigned int voteThreshold, const unsigned int firstRow, const unsigned int numberRows)
Creates line votes for horizontal and vertical (0 and 90 degree) filter responses inside a given accu...
static void parallelLines(const InfiniteLines &lines, const Scalar maxAngle, InfiniteLineGroups ¶llelGroups, const unsigned int minimalSetSize=0u, const bool noDuplicates=true)
Separates given lines in sets of almost parallel lines.
This class implements Ocean's image class.
Definition Frame.h:1808
const T * constdata(const unsigned int planeIndex=0u) const
Returns a pointer to the read-only pixel data of a specific plane.
Definition Frame.h:4248
unsigned int width() const
Returns the width of the frame format in pixel.
Definition Frame.h:3170
unsigned int height() const
Returns the height of the frame in pixel.
Definition Frame.h:3175
This class implements an infinite line in 2D space.
Definition Line2.h:83
This class implements a recursive lock object.
Definition Lock.h:31
static constexpr bool isInsideRange(const T lower, const T value, const T upper, const T epsilon=NumericT< T >::eps())
Returns whether a value lies between a given range up to a provided epsilon border.
Definition Numeric.h:2872
static constexpr T pi()
Returns PI which is equivalent to 180 degree.
Definition Numeric.h:926
static constexpr T eps()
Returns a small epsilon.
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2386
This template class is the base class for all singleton objects.
Definition Singleton.h:71
This class implements houg-transformation-based line detector tests.
Definition TestLineDetectorHough.h:32
T length() const
Returns the length of the vector.
Definition Vector2.h:627
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
std::set< Index32 > IndexSet32
Definition of a set holding 32 bit indices.
Definition Base.h:114
float Scalar
Definition of a scalar type.
Definition Math.h:129
std::vector< Line2 > Lines2
Definition of a vector holding Line2 objects.
Definition Line2.h:57
LineT2< Scalar > Line2
Definition of the Line2 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Line2.h:28
std::vector< FiniteLine2 > FiniteLines2
Definition of a vector holding FiniteLine2 objects.
Definition FiniteLine2.h:57
The namespace covering the entire Ocean framework.
Definition Accessor.h:15