ImageHelper

Registering Image Matching

Image matching lives in the GPAL.Image package so GPAL itself carries no image library. GPALImage.Register() hands GPAL its OpenCV matcher, and every image selector and ImageHelper.FindImage uses it from then on. GPAL.RegisterImageMatcher takes any IImageMatcher, which is how the package registers and how a matcher of your own would replace it.

NOTE

With nothing registered, an image selector finds nothing and GPAL publishes one warning saying the GPAL.Image package is needed. See Add-On Packages: Keeping GPAL Light.

WARNING

GPAL.Image needs a 64-bit process, since OpenCV ships its native library for 64-bit Windows only. For an AnyCPU program, turn off Prefer 32-bit or target x64. In a 32-bit process Register() registers nothing and publishes a warning.

Examples

GPAL Fluent: High-level fluent C# API

//Call it once, before the first image selector runs. Registering again replaces the matcher that was there.

using GenerallyPositive.Image;


// once, at startup

GPALImage.Register();


// or a matcher of your own, implementing IImageMatcher

GPAL.RegisterImageMatcher(myMatcher);

💬 Ask GPAL