Tool Chain

This code snippet shows how to perform a threshold on a region coming for a previous EasyFind process.

C++

#include <eVision/EasyImage/EasyImage.h>
#include <eVision/EasyFind/EPatternFinder.h>
using namespace eVision;

// Image constructors
EImageBW8 findImage;
EImageBW8 srcImage;
EImageBW8 dstImage;


// EPatternFinder constructor
EPatternFinder finder;

//...

// Use EasyFind
std::vector<EFoundPattern> patterns = finder.Find(&findImage);


// Create region from found pattern
ERegion foundRegion = patterns[0].ToRegion();


// Threshold the image
EasyImage::Threshold(&srcImage, foundRegion, &dstImage);

C#

using eVision;
// Image constructors
EImageBW8 findImage = new EImageBW8();
EImageBW8 srcImage = new EImageBW8();
EImageBW8 dstImage = new EImageBW8();

// EPatternFinder constructor
EPatternFinder finder = new EPatternFinder();


//...

// Use EasyFind
EFoundPattern[] patterns = finder.Find(findImage);

// Create region from found pattern
ERegion foundRegion = patterns[0].ToRegion();


// Threshold the image
EasyImage.Threshold(srcImage, foundRegion, dstImage);

Python

import eVision
# Image constructors
find_image = eVision.EImageBW8()
src_image = eVision.EImageBW8()
dst_image = eVision.EImageBW8()


# EPatternFinder constructor
finder = eVision.EPatternFinder()

# ...

# Use EasyFind
patterns = finder.Find(find_image)


# Create region from found pattern
found_region = patterns[0].ToRegion()


# Threshold the image
eVision.EasyImage.Threshold(src_image, found_region, dst_image)