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

This interface provide functionalities of sub-pixel cross mark detection. More...

Inheritance diagram for ILCrossMarkDetector:
ILObject LCrossMarkDetector

Public Member Functions

LPVErrorCode Detect (ILImage *img, ILRegion *region, ILCrossMarkResults **results)
 
void SetMarkRange (int grayLB, int grayUB)
 
void SetSizeRange (int lb, int ub)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

double FitDistThreshold [get, set]
 The distance threshold is used for the fitting of the cross lines, as the maximum acceptable distance between the fitting results and the valid fitting points. Those exceed the limitation will be treated as outliers and then excluded from the fitting. By default, it's set to 0, means we'll decide a proper threshold on the fly during detection, according the cross mark's size and width.
 
int KernelSize [get, set]
 The kernel size used in edge filtering, should be an odd number which is ≥ 3, say 3, 5, 7, etc.
 
int MarkRangeLB [get]
 The lower bound of the mark's grayscale value range when custom thresholding is used.
 
int MarkRangeUB [get]
 The upper bound of the mark's grayscale value range when custom thresholding is used.
 
int MaxCount [get, set]
 The maximum of cross marks to find. If there are more than the setting counts of cross marks, sort the candidates then pick the tops.
 
int NoiseThreshold [get, set]
 The noise threshold is used to filter false detections, which is the required minimum luminance difference between the cross mark and the background. It's in 1 ~ 100. By default, it's set to 20.
 
LPVPolarity Polarity [get, set]
 The detection polarity, either object or edge polarity is acceptable.
Edge polarities are recommended to use when the cross mark's edge is clear and stable.
. More...
 
int SizeRangeLB [get]
 The lower bound of the mark's size range.
 
int SizeRangeUB [get]
 The upper bound of the mark's size range.
 
BOOL UseAutoThreshold [get, set]
 Whether to use auto-thresholding for candidate position extraction. By default, it's true. Local-adaptive thresholding is adopted when there's available mark size range, otherwise global-adaptive thresholding is used.
 
double Width [get, set]
 The width of the cross mark's two cross lines. By default, it's set to 0, means we'll guess a proper width on the fly during detection.
 

Detailed Description

This interface provide functionalities of sub-pixel cross mark detection.

Cross mark detector is designed to locate a single or multiple cross mark in given image.
The algorithm firstly extracts the candidate positions according the grayscale difference or edges around the mark, then tries to locate the two crossed midlines of the cross at each candidate position to obtain the intersection point as mark center. For multi-results scenarios, we evaluate each result based on its edge lines' fitting quality and parallelism, as well as the symmetry of the pattern, then the top scores are reported as final results.
The algorithm is real-time and has accuracy of sub-pixel.

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

Example Code

Member Function Documentation

◆ Detect()

LPVErrorCode Detect ( ILImage img,
ILRegion region,
ILCrossMarkResults **  results 
)

Detect cross marks using the cross mark detector.

Parameters
[in]img The input image.
[in]regionThe input region.
[out]resultsReturn the cross mark results.
Return values
errorReturn error code if anything is wrong.

◆ SetMarkRange()

void SetMarkRange ( int  grayLB,
int  grayUB 
)

Set the cross mark's grayscale range and use the custom thresholding for candidate position extraction. UseAutoThreshold will be set to false then.

Parameters
[in]grayLBThe lower bound of the grayscale value range.
[in]grayUBThe upper bound of the grayscale value range.
See also
MarkRangeLB, MarkRangeUB, UseAutoThreshold

◆ SetSizeRange()

void SetSizeRange ( int  lb,
int  ub 
)

Set the cross mark's size range. By default, it's set to an empty (0, 0) range, means we'll guess a proper size on the fly during detection.

Parameters
[in]lbThe lower bound of the size range.
[in]ubThe upper bound of the size range.
See also
Width

Property Documentation

◆ Polarity

LPVPolarity Polarity
getset

The detection polarity, either object or edge polarity is acceptable.
Edge polarities are recommended to use when the cross mark's edge is clear and stable.
.

Otherwise, when the mark object is small or blurry or edge transition changes from time to time, use object polarity instead.

See also
KernelSize, UseAutoThreshold