|
int | ConnectTolerance [get, set] |
| The connect tolerance used in contour connection. For two contour candidates whose end points are nearby, we connect them into one result. By default, it's set to 1 which means no extra connection.
|
|
LPVExcludeBoundaryMode | ExcludeBoundaryMode [get, set] |
| The mode how to handle contours that intersect the region boundary, only LPVEBModeEntire and LPVEBModeNone is supported.
|
|
int | FilterShort [get, set] |
| The relative length threshold in percentage based on the longest contour in the candidates, used to filter a short contour. Worked together with FilterWeak, the short-and-weak is filtered.
|
|
int | FilterWeak [get, set] |
| The relative magnitude threshold in percentage based on the strongest contour in the candidates, used to filter a weak contour. Worked together with FilterShort, the short-and-weak is filtered.
|
|
int | KSize [get, set] |
| The kernel size used in edge filtering, should be an odd number, say, 3, 5, 7, etc. By default, it's 3. For the blurring image, you may use a bigger kernel size.
|
|
int | MaxCount [get, set] |
| The maximum of contours to find. If there are more than the setting counts of contours, sort the candidates then pick the tops. More...
|
|
BOOL | OnlyClosed [get, set] |
| Whether to report only closed contour results. By default, it's off.
|
|
int | RejectShort [get, set] |
| The absolute length threshold used to reject a short contour. Worked together with RejectWeak, the very short-or-weak is rejected.
|
|
int | RejectWeak [get, set] |
| The absolute magnitude threshold used to reject a weak contour. Worked together with RejectShort, the very short-or-weak is rejected.
|
|
LPVContourFeatures | SortBy [get, set] |
| The method used to sort all contour candidates, the top ones are reported as final results. More...
|
|
BOOL | SortByDescending [get, set] |
| Works together with SortBy. True to sort all contour candidates descending(from large value to small), false for sorting in ascending order. More...
|
|
This interface provide functionalities of sub-pixel contour detection.
Contour detector is designed to locate a single or multiple contours in given image.
For the outstanding edge pixels in the image, the algorithm connect the nearby ones into contours based on their direction consistence. We may then reject/filter short and weak contours, and also filter them by polarity along the region's direction.
The algorithm is real-time and has accuracy of sub-pixel.
To use this interface, you should create a LContourDetector object.
Example Code
C++
ILContourDetectorPtr contourDetector = LContourDetector::Create();
contourDetector->ConnectTolerance = 16;
contourDetector->KSize = 5;
contourDetector->RejectShort = 100;
LPVErrorCode err = contourDetector->DetectWithDir(img, rotRectRoi,
LPVPolarity::LPVBlack2White, 30, 70, &contourResults);
if (err != LPVErrorCode::LPVNoError) return;
LPVErrorCode
This enumeration represents the type of a LPV function error.
Definition: LPVCore.idl:530
C#
LContourDetector contourDetector = new LContourDetector();
contourDetector.ConnectTolerance = 16;
contourDetector.KSize = 5;
contourDetector.RejectShort = 100;
LPVErrorCode err = contourDetector.DetectWithDir(img, rotRectRoi,
LPVPolarity.LPVBlack2White, 30, 70, out contourResults);
LPVPolarity
This enumeration represents the polarity of the edge or object to be located.
Definition: LPVCore.idl:1094
COM
ILContourDetectorPtr contourDetector = LContourDetector::Create();
contourDetector->ConnectTolerance = 16;
contourDetector->KSize = 5;
contourDetector->RejectShort = 100;
LPVErrorCode err = contourDetector->DetectWithDir(img, rotRectRoi,
LPVPolarity::LPVBlack2White, 30, 70, &contourResults);
if (err != LPVErrorCode::LPVNoError) return;