ExhaustiveTemplateMatching Class |
Namespace: Accord.Imaging
The ExhaustiveTemplateMatching type exposes the following members.
Name | Description | |
---|---|---|
ExhaustiveTemplateMatching |
Initializes a new instance of the ExhaustiveTemplateMatching class.
| |
ExhaustiveTemplateMatching(Single) |
Initializes a new instance of the ExhaustiveTemplateMatching class.
|
Name | Description | |
---|---|---|
SimilarityThreshold |
Similarity threshold, [0..1].
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ProcessImage(Bitmap, Bitmap) |
Process image looking for matchings with specified template.
| |
ProcessImage(BitmapData, BitmapData) |
Process image looking for matchings with specified template.
| |
ProcessImage(UnmanagedImage, UnmanagedImage) |
Process image looking for matchings with specified template.
| |
ProcessImage(Bitmap, Bitmap, Rectangle) |
Process image looking for matchings with specified template.
| |
ProcessImage(BitmapData, BitmapData, Rectangle) |
Process image looking for matchings with specified template.
| |
ProcessImage(UnmanagedImage, UnmanagedImage, Rectangle) |
Process image looking for matchings with specified template.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The class implements exhaustive template matching algorithm, which performs complete scan of source image, comparing each pixel with corresponding pixel of template.
The class processes only grayscale 8 bpp and color 24 bpp images.
Sample usage:
// create template matching algorithm's instance var tm = new ExhaustiveTemplateMatching(0.9f); // find all matchings with specified above similarity TemplateMatch[] matchings = tm.ProcessImage(sourceImage, templateImage); // highlight found matchings BitmapData data = sourceImage.LockBits(ImageLockMode.ReadWrite); foreach (TemplateMatch m in matchings) { Drawing.Rectangle(data, m.Rectangle, Color.White); // do something else with the matching } sourceImage.UnlockBits(data);
The class also can be used to get similarity level between two image of the same size, which can be useful to get information about how different/similar are images:
// create template matching algorithm's instance // use zero similarity to make sure algorithm will provide anything ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0); // compare two images TemplateMatch[] matchings = tm.ProcessImage(image1, image2); // check similarity level if (matchings[0].Similarity > 0.95f) { // do something with quite similar images }