Learn a Pattern from Image(s)

  • EasyFind can extract its feature points from an image using EPatternFinder::Learn .NET Python.

  • The most common usage is to take a picture of the object of interest and to learn the ROI around that object in your picture.

  • Use an ERegion to specify your pattern more precisely if the ROI contains unwanted features from the background.

Learn Multiple Patterns from different images

With EasyFind, you can also learn multiple patterns at once.

Note

This is useful when different instances of the pattern look very different, for example because of perspective, illumination or mechanical deformations.

../../../_images/learn_multiple_models_1.webp

Pins appearing different due to perspective

../../../_images/learn_multiple_models_2.webp

Top and bottom faces of batteries appearing different due to illumination

To learn multiple patterns:

  1. Call the function EPatternFinder::LearnPatterns .NET Python with several images instead of the function EPatternFinder::Learn .NET Python with a single image.

  2. When you call EPatternFinder::Find .NET Python, the patterns are searched in the image in parallel.

Note

The setting Easy::SetMaxNumberOfProcessingThreads .NET Python is thus especially interesting here.

Learning Parameters

Note

These parameter settings are saved together with your pattern when calling EPatternFinder::Save() .NET Python.

Pattern type

Use the parameter EPatternFinder::SetPatternType .NET Python to set the pattern type as Consistent Edges (default) or Thin Structures.

EasyFind supports 2 pattern types:

  • Use Consistent Edges when:

    • Your pattern is well contrasted with sharp edges.

    • Your pattern is substantially different from the rest of the expected search fields.

  • Use Thin Structures when:

    • The edges of your pattern are consistent between thin elements and regions.

    • The contrast is the same for each thin element.

../../../_images/purpose_illu_thin_structures.webp

Examples of Thin Structures

Light Balance

Use the parameter EPatternFinder::SetLightBalance .NET Python to adjust the gray-level threshold of the EPatternFinder so that it fits the useful parts of the pattern.

Timeout

EPatternFinder::Learn .NET Python possesses a timeout:

Note

This timeout mechanism is used to prevent the application from freezing while tuning parameters. This is especially useful in eVision Studio. Note that this does not correspond to the behavior of code reader timeouts, which aim to prevent long processing times in production settings.

Advanced

Thin Structure Mode

If the Pattern Type is Thin Structure, use the parameter EPatternFinder::SetThinStructureMode .NET Python to adjust the gray-level threshold of the model so that it fits the useful parts of the pattern:

Number of Feature Points and Reduction Strength

Note

More feature points lead to a finer matching and a better positioning accuracy but also to a longer processing time.