eVision C++ API 26.10.0
Loading...
Searching...
No Matches
eVision::ELineDetector Class Reference

Detects straight lines in a BW8 image using Hough transform. More...

#include <eVision/EasyImage/ELineDetector.h>

Collaboration diagram for eVision::ELineDetector:

Public Member Functions

 ELineDetector (const eVision::ELineDetector &other)
 Copy operator.
 ELineDetector ()
 Constructs an ELineDetector::ELineDetector with all parameters explicitly specified.
 ELineDetector (float rho, float theta, int32_t threshold, float minLineLength, float maxLineGap, float angleThresholdDegrees)
 Copy operator.
virtual ~ELineDetector () throw ()
eVision::ELineDetector & operator= (const eVision::ELineDetector &other)
 Copy operator.
float GetRadialBinSize () const
 Distance resolution of the accumulator in pixels. Default is 1.
void SetRadialBinSize (float rho)
 Distance resolution of the accumulator in pixels. Default is 1.
float GetAngularBinSize () const
 Angle resolution of the accumulator in degrees. Default is 1.
void SetAngularBinSize (float theta)
 Angle resolution of the accumulator in degrees. Default is 1.
int32_t GetMinNumVotes () const
 Minimum number of votes to qualify as a line. Default is 150.
void SetMinNumVotes (int32_t threshold)
 Minimum number of votes to qualify as a line. Default is 150.
float GetMinLineLength () const
 Minimum length of a detected line segment in pixels. Shorter segments are discarded. Default is 164.
void SetMinLineLength (float minLineLength)
 Minimum length of a detected line segment in pixels. Shorter segments are discarded. Default is 164.
float GetMaxLineGap () const
 Maximum gap between two collinear segments to still merge them into one line. Default is 64.
void SetMaxLineGap (float maxLineGap)
 Maximum gap between two collinear segments to still merge them into one line. Default is 64.
float GetAngleThreshold () const
 Maximum angular difference in degrees between two segments to consider them part of the same line. Default is 35°.
void SetAngleThreshold (float angleThresholdDegrees)
 Maximum angular difference in degrees between two segments to consider them part of the same line. Default is 35°.
void Save (const std::string &path) const
 Saves the detector configuration to a file.
void Load (const std::string &path)
 Loads a detector configuration from a file.
void Save (eVision::ESerializer *serializer) const
 Saves the detector configuration to a serializer.
void Load (eVision::ESerializer *serializer)
 Loads a detector configuration from a serializer.
std::vector< eVision::ELine > Detect (const eVision::EROIBW8 &image) const
 Detects straight lines in the given BW8 image.
std::vector< eVision::ELine > Detect (const eVision::EROIBW8 &image, const eVision::ERegion &region, const eVision::EFrame &frame) const
 Detects lines in the area of the image covered by region (transformed to sensor coordinates via frame), then maps results back to local frame coordinates.
std::vector< eVision::ELine > Detect (const eVision::EROIBW8 &image, const eVision::ERegion &region) const
 Detects lines in the area of the image covered by region.
std::vector< eVision::ELine > Detect (const eVision::EROIBW8 &image, const eVision::EFrame &frame) const
 Detects lines in the image and maps results to local frame coordinates via frame.
std::vector< eVision::ELine > Detect (const eVision::ERegion &region, const eVision::EFrame &frame) const
 Transforms region to sensor coordinates via frame, converts it to a binary image, detects lines, then maps results back to local frame coordinates.
std::vector< eVision::ELine > Detect (const eVision::ERegion &region) const
 Converts region to a binary image and detects lines in it.
void StopProcess () const
 Thread-safe. Requests the Detect call running on another thread to stop as soon as possible; it then returns no lines. The request is discarded when the next Detect call starts.
std::vector< eVision::ELine > GetSegmentsBeforeMerging () const
 Returns the raw line segments that were merged to build the lines, as returned by the last call to ELineDetector::Detect.
 ELineDetector (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Detects straight lines in a BW8 image using Hough transform.

License(s): EasyImage

Constructor & Destructor Documentation

◆ ELineDetector() [1/4]

eVision::ELineDetector::ELineDetector ( const eVision::ELineDetector & other)

Copy operator.

Parameters
otherAnother ELineDetector.

◆ ELineDetector() [2/4]

eVision::ELineDetector::ELineDetector ( )

Constructs an ELineDetector::ELineDetector with all parameters explicitly specified.

◆ ELineDetector() [3/4]

eVision::ELineDetector::ELineDetector ( float rho,
float theta,
int32_t threshold,
float minLineLength,
float maxLineGap,
float angleThresholdDegrees )

Copy operator.

◆ ~ELineDetector()

eVision::ELineDetector::~ELineDetector ( )
throw ( )
virtual

◆ ELineDetector() [4/4]

eVision::ELineDetector::ELineDetector ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ Detect() [1/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::ERegion & region) const

Converts region to a binary image and detects lines in it.

Parameters
regionRegion to convert and detect lines in.

◆ Detect() [2/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::ERegion & region,
const eVision::EFrame & frame ) const

Transforms region to sensor coordinates via frame, converts it to a binary image, detects lines, then maps results back to local frame coordinates.

Parameters
regionRegion in local frame coordinates.
frameFrame used to transform region and results.

◆ Detect() [3/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::EROIBW8 & image) const

Detects straight lines in the given BW8 image.

Parameters
imageInput BW8 image.

◆ Detect() [4/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::EROIBW8 & image,
const eVision::EFrame & frame ) const

Detects lines in the image and maps results to local frame coordinates via frame.

Parameters
imageInput BW8 image.
frameFrame used to transform results to local coordinates.

◆ Detect() [5/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::EROIBW8 & image,
const eVision::ERegion & region ) const

Detects lines in the area of the image covered by region.

Parameters
imageInput BW8 image.
regionRegion of interest in image coordinates.

◆ Detect() [6/6]

std::vector< eVision::ELine > eVision::ELineDetector::Detect ( const eVision::EROIBW8 & image,
const eVision::ERegion & region,
const eVision::EFrame & frame ) const

Detects lines in the area of the image covered by region (transformed to sensor coordinates via frame), then maps results back to local frame coordinates.

Parameters
imageInput BW8 image.
regionRegion of interest in local frame coordinates.
frameFrame used to transform region and results.

◆ GetAngleThreshold()

float eVision::ELineDetector::GetAngleThreshold ( ) const

Maximum angular difference in degrees between two segments to consider them part of the same line. Default is 35°.

◆ GetAngularBinSize()

float eVision::ELineDetector::GetAngularBinSize ( ) const

Angle resolution of the accumulator in degrees. Default is 1.

◆ GetMaxLineGap()

float eVision::ELineDetector::GetMaxLineGap ( ) const

Maximum gap between two collinear segments to still merge them into one line. Default is 64.

◆ GetMinLineLength()

float eVision::ELineDetector::GetMinLineLength ( ) const

Minimum length of a detected line segment in pixels. Shorter segments are discarded. Default is 164.

◆ GetMinNumVotes()

int32_t eVision::ELineDetector::GetMinNumVotes ( ) const

Minimum number of votes to qualify as a line. Default is 150.

◆ GetRadialBinSize()

float eVision::ELineDetector::GetRadialBinSize ( ) const

Distance resolution of the accumulator in pixels. Default is 1.

◆ GetSegmentsBeforeMerging()

std::vector< eVision::ELine > eVision::ELineDetector::GetSegmentsBeforeMerging ( ) const

Returns the raw line segments that were merged to build the lines, as returned by the last call to ELineDetector::Detect.

◆ Load() [1/2]

void eVision::ELineDetector::Load ( const std::string & path)

Loads a detector configuration from a file.

Parameters
pathPath to the input file.

◆ Load() [2/2]

void eVision::ELineDetector::Load ( eVision::ESerializer * serializer)

Loads a detector configuration from a serializer.

Parameters
serializerSource serializer in read mode.

◆ operator=()

eVision::ELineDetector & eVision::ELineDetector::operator= ( const eVision::ELineDetector & other)

Copy operator.

Parameters
otherAnother ELineDetector.

◆ Save() [1/2]

void eVision::ELineDetector::Save ( const std::string & path) const

Saves the detector configuration to a file.

Parameters
pathPath to the output file.

◆ Save() [2/2]

void eVision::ELineDetector::Save ( eVision::ESerializer * serializer) const

Saves the detector configuration to a serializer.

Parameters
serializerTarget serializer in write mode.

◆ SetAngleThreshold()

void eVision::ELineDetector::SetAngleThreshold ( float angleThresholdDegrees)

Maximum angular difference in degrees between two segments to consider them part of the same line. Default is 35°.

Parameters
angleThresholdDegreesAngle threshold in degrees.

◆ SetAngularBinSize()

void eVision::ELineDetector::SetAngularBinSize ( float theta)

Angle resolution of the accumulator in degrees. Default is 1.

Parameters
thetaAngle resolution in degrees. Must be in the range (0, 180).

◆ SetMaxLineGap()

void eVision::ELineDetector::SetMaxLineGap ( float maxLineGap)

Maximum gap between two collinear segments to still merge them into one line. Default is 64.

Parameters
maxLineGapMaximum gap in pixels.

◆ SetMinLineLength()

void eVision::ELineDetector::SetMinLineLength ( float minLineLength)

Minimum length of a detected line segment in pixels. Shorter segments are discarded. Default is 164.

Parameters
minLineLengthMinimum length in pixels.

◆ SetMinNumVotes()

void eVision::ELineDetector::SetMinNumVotes ( int32_t threshold)

Minimum number of votes to qualify as a line. Default is 150.

Parameters
thresholdVote threshold.

◆ SetRadialBinSize()

void eVision::ELineDetector::SetRadialBinSize ( float rho)

Distance resolution of the accumulator in pixels. Default is 1.

Parameters
rhoDistance resolution in pixels.

◆ StopProcess()

void eVision::ELineDetector::StopProcess ( ) const

Thread-safe. Requests the Detect call running on another thread to stop as soon as possible; it then returns no lines. The request is discarded when the next Detect call starts.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::ELineDetector::wrappedClass_