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

This interface provide functionalities of the edge-based gauge tool. More...

Inheritance diagram for ILEdgeGauge:
ILGauge ILObject LEdgeGauge

Public Member Functions

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

Properties

double Distance [get, set]
 The expected distance of edge pair used for double-side edge inspection. Works when SortBy enables LPVGaugeFeatureDistance.
 
double DistanceTolerance [get, set]
 The tolerance in percentage for the difference between the true distance of edge pair and the expectation Distance, used for double-side edge inspection. Works when SortBy enables LPVGaugeFeatureDistance.
 
int MaxCount [get, set]
 The maximum of edges or edge pairs to find. Modification to this property may also change MaxSamplePointCount.
 
LPVPolarity Polarity2 [get, set]
 The detection polarity for the second edge, either object or edge polarity is acceptable. Used for double-side edge inspection.
 
- 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 the edge-based gauge tool.

The edge gauge tool is used to measure the width of objects, the location of edges or features, and the location and spacing of pairs of edges in images. It locates single-side edges or double-side edge pairs by their peak locations in an image's projection applied a simple 1-D edge kernel.

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

Example Code

Member Function Documentation

◆ Detect1()

LPVErrorCode Detect1 ( ILImage img,
ILRotRectRegion region,
ILEdgeGaugeResult **  gaugeResult 
)

Detect the single-side edges using the edge gauge.

Parameters
[in]img The input image.
[in]regionThe input region, it should be a rotated rectangle region with its direction well-defined.
[out]gaugeResultReturn the edge gauge result contains the single-side edges.
Return values
errorReturn error code if anything is wrong.

◆ Detect2()

LPVErrorCode Detect2 ( ILImage img,
ILRotRectRegion region,
ILEdgeGaugeResult **  gaugeResult 
)

Detect the double-side edges using the edge gauge.

Parameters
[in]img The input image.
[in]regionThe input region, it should be a rotated rectangle region with its direction well-defined.
[out]gaugeResultReturn the edge gauge result contains the double-side edges.
Return values
errorReturn error code if anything is wrong.