Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILLineDetector Interface Reference

This interface provide functionalities of line detection. More...

Inheritance diagram for ILLineDetector:
ILObject LLineDetector

Public Member Functions

LPVErrorCode Detect (ILImage *img, ILRotRectRegion *region, ILLineResults **results)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

int AcceptScore [get, set]
 The accept score used in detection. It defines the minimum score for identifying the edge as a good line. You may pick a proper score with help of line score chart. More...
 
int EdgeWidth [get, set]
 The edge width of the line used in detection, in 1 ~ 10. Edge width defines the count of pixels along the whole edge transition. Blurred edge indicates larger edge width value to find a stable result. Usually, it's fine to just use default setting (3).
 
LPVFindBy FindBy [get, set]
 The detection searching strategy. It defines how to select the result lines if there's more than expected line candidates.
 
int MaxCount [get, set]
 The maximum of lines to find.
 
BOOL NormScore [get, set]
 Whether we should normalize the score based on maximum gradient in region.
 
LPVPolarity Polarity [get, set]
 The detection edge polarity.
Polarity defines the edge transition according to region's direction, black pixels are dark, white pixels are light. More...
 

Detailed Description

This interface provide functionalities of line detection.

Line detector is designed to locate a single or multiple line edges in given image and along the region's direction.
The algorithm is real-time and of sub-pixel accuracy, while the limitation is it could only detect parallel lines with small angle range (-10, +10) relative to the region's direction. So, to use this detector, you should have a basic idea of the target lines' direction.

To use this interface, you should create a LLineDetector object.

Example Code

Member Function Documentation

◆ Detect()

LPVErrorCode Detect ( ILImage img,
ILRotRectRegion region,
ILLineResults **  results 
)

Detect lines using the line detector.

Parameters
[in]img The input image.
[in]regionThe input region, it should be a rotated rectangle region with its direction well-defined.
[out]resultsReturn the line results.
Return values
errorReturn error code if anything is wrong.

Property Documentation

◆ AcceptScore

int AcceptScore
getset

The accept score used in detection. It defines the minimum score for identifying the edge as a good line. You may pick a proper score with help of line score chart.

See also
ILLineResults::DrawScoreChart().

◆ Polarity

LPVPolarity Polarity
getset

The detection edge polarity.
Polarity defines the edge transition according to region's direction, black pixels are dark, white pixels are light.

See also
FindBy, EdgeWidth