ExhaustiveBlockMatching Class |
Namespace: Accord.Imaging
The ExhaustiveBlockMatching type exposes the following members.
Name | Description | |
---|---|---|
ExhaustiveBlockMatching |
Initializes a new instance of the ExhaustiveBlockMatching class.
| |
ExhaustiveBlockMatching(Int32, Int32) |
Initializes a new instance of the ExhaustiveBlockMatching class.
|
Name | Description | |
---|---|---|
BlockSize |
Block size to search for.
| |
SearchRadius |
Search radius.
| |
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, ListIntPoint, Bitmap) |
Process images matching blocks between hem.
| |
ProcessImage(BitmapData, ListIntPoint, BitmapData) |
Process images matching blocks between them.
| |
ProcessImage(UnmanagedImage, ListIntPoint, UnmanagedImage) |
Process images matching blocks between them.
| |
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 search block matching algorithm (see documentation for IBlockMatching for information about block matching algorithms). Exhaustive search algorithm tests each possible location of block within search window trying to find a match with minimal difference.
Note |
---|
Because of the exhaustive nature of the algorithm, high performance should not be expected in the case if big number of reference points is provided or big block size and search radius are specified. Minimizing theses values increases performance. But too small block size and search radius may affect quality. |
Note |
---|
The class processes only grayscale (8 bpp indexed) and color (24 bpp) images. |
Sample usage:
// collect reference points using corners detector (for example) SusanCornersDetector scd = new SusanCornersDetector( 30, 18 ); List<IntPoint> points = scd.ProcessImage( sourceImage ); // create block matching algorithm's instance ExhaustiveBlockMatching bm = new ExhaustiveBlockMatching( 8, 12 ); // process images searching for block matchings List<BlockMatch> matches = bm.ProcessImage( sourceImage, points, searchImage ); // draw displacement vectors BitmapData data = sourceImage.LockBits( new Rectangle( 0, 0, sourceImage.Width, sourceImage.Height ), ImageLockMode.ReadWrite, sourceImage.PixelFormat ); foreach ( BlockMatch match in matches ) { // highlight the original point in source image Drawing.FillRectangle( data, new Rectangle( match.SourcePoint.X - 1, match.SourcePoint.Y - 1, 3, 3 ), Color.Yellow ); // draw line to the point in search image Drawing.Line( data, match.SourcePoint, match.MatchPoint, Color.Red ); // check similarity if ( match.Similarity > 0.98f ) { // process block with high similarity somehow special } } sourceImage.UnlockBits( data );
Test image 1 (source):
Test image 2 (search):
Result image: