Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions
ILLineGauge Interface Reference

This interface provide functionalities of line inspection via the gauge. More...

Inheritance diagram for ILLineGauge:
ILShapeGauge ILGauge ILObject LLineGauge

Public Member Functions

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

Additional Inherited Members

- Properties inherited from ILShapeGauge
int FitCountThreshold [get, set]
 The minimum count of points contribute to a valid fitting result.
 
double FitDistThreshold [get, set]
 The distance threshold between the result line and a sample point, for filtering the out-lier points. Set to negative value(-1) to bypass the out-lier filtering.
 
int SampleRegionHeight [get, set]
 The height of the sample region, at least 5 pixels. Please check the Detect() function of individual gauge tool, for either it adopts this property or region's height during inspection.
 
int SampleRegionInterval [get, set]
 The distance between the centers of two nearby sample regions.
 
int SampleRegionWidth [get, set]
 The width of the sample region, at least 5 pixels.
 
- Properties inherited from ILGauge
int AcceptScore [get, set]
 The accept score used in inspection. It defines the minimum score for identifying the sample point as a valid result. You may pick a proper score with help of the score chart. More...
 
int KernelSize [get, set]
 The kernel size used in gradient filtering, should be an odd number which is ≥ 3, say 3, 5, 7, etc.
 
int MaxSamplePointCount [get, set]
 The maximum of sample points to find in each sample region.
 
BOOL NormScore [get, set]
 Whether we should normalize the score based on maximum gradient or grayscale value in region.
 
LPVPolarity Polarity [get, set]
 The detection polarity, either object or edge polarity is acceptable.
 
LPVGaugeFeatures SortBy [get, set]
 The method used to sort all sample point candidates, the top ones are reported as final results. More...
 
LPVFindBy SortByPosition [get, set]
 Works when SortBy enables LPVGaugeFeaturePosition, prefer either the last, the central or the last ones. More...
 
BOOL SortByScoreDescending [get, set]
 Works when SortBy enables LPVGaugeFeatureScore. True to sort all sample point candidates descending(from large score to small, aka. prefer the maximum magnitude), false for sorting in ascending order. More...
 

Detailed Description

This interface provide functionalities of line inspection via the gauge.

The line gauge is used to measure position and orientation of straight edges. Edge points are sampled along the given region using equally spaced point measurement gauges, and then fit to a straight line.

Compared with the feature locating tool LLineDetector, it's more resistant to noise and less restricted to the limitation of region's direction. But for high-accuracy required task, it's recommended to use LLineDetector instead.

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

Example Code

Member Function Documentation

◆ Detect()

LPVErrorCode Detect ( ILImage img,
ILRotRectRegion region,
ILShapeGaugeResult **  gaugeResult 
)

Detect the line using the line gauge.

Parameters
[in]img The input image.
[in]regionThe input region, it should be a rotated rectangle region with its direction well-defined, and its height is used as the height of the sample region
[out]gaugeResultReturn the gauge result, it contains the result line.
Return values
errorReturn error code if anything is wrong.