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