EasyObjectEChecker2¶
Support |
|
|---|---|
Required licenses |
EasyObject |
Recommended images |
Any image from the folder |
Location |
|
Purpose¶
EChecker2 is a golden template inspection algorithm.
This sample program demonstrates how to:
Specify the inspection area.
Select fiducials for the localization and the alignment of the inspection area.
Train the method and apply it on new images.
Code highlights¶
Initialize an object with a reference image, a vector of
ERegioncorresponding to the fiducials and anERegioncorresponding to the region to inspect.// Put fiducial regions in vector std::vector<ERegion*> fiducials; fiducials.push_back(regions_[RegionID_Fiducial1]); fiducials.push_back(regions_[RegionID_Fiducial2]); // Initialize training checker_.Initialize(referenceImage_, fiducials, *(regions_[RegionID_Inspection]));
Train the checker with a vector of training images.
Attention
As all the parameters of EChecker have an influence on how the model is built, you must restart the model creation if any of these parameters is changed.
```c++
// Train
checker_.SetInspectionTolerance(5.0f);
checker_.Train(images);
```
Inspect an image and filter the list of defects based on their area.
The result of a EChecker inspection is an object EasyObject ECodedImage2.
```c++
// Inspect Image
checker_.Inspect(image, codedImage_);
// Clear defect selection
defects_.Clear();
// Select defects on area
defects_.AddObjects(codedImage_);
defects_.RemoveUsingUnsignedIntegerFeature(EFeature_Area, 25, ESingleThresholdMode_Less);
```