Pattern Learning¶
This code snippet shows how to learn a pattern defined by a region of interest (ROI).
C++¶
#include <eVision/EasyFind/EPatternFinder.h>
using namespace eVision;
// Image constructor
EImageBW8 srcImage;
// ROI constructor
EROIBW8 pattern;
// EPatternFinder constructor
EPatternFinder finder;
// ...
// Attach the ROI to the source image
// and set its position
pattern.Attach(&srcImage);
pattern.SetPlacement(214, 52, 200, 200);
// Learn the pattern
finder.Learn(&pattern);
See also
C#¶
using eVision;
// Image constructor
EImageBW8 srcImage = new EImageBW8();
// ROI constructor
EROIBW8 pattern = new EROIBW8();
// EPatternFinder constructor
EPatternFinder finder = new EPatternFinder();
// ...
// Attach the ROI to the source image
// and set its position
pattern.Attach(srcImage);
pattern.SetPlacement(214, 52, 200, 200);
// Learn the pattern
finder.Learn(pattern);
See also
Python¶
import eVision
# Image constructor
src_image = eVision.EImageBW8()
# ROI constructor
pattern = eVision.EROIBW8()
# EPatternFinder constructor
finder = eVision.EPatternFinder()
# ...
# Attach the ROI to the source image
# and set its position
pattern.Attach(src_image)
pattern.SetPlacement(214, 52, 200, 200)
# Learn the pattern
finder.Learn(pattern)
See also