GrayLevelCooccurrenceMatrix Class |
Namespace: Accord.Imaging
The GrayLevelCooccurrenceMatrix type exposes the following members.
Name | Description | |
---|---|---|
GrayLevelCooccurrenceMatrix |
Initializes a new instance of the GrayLevelCooccurrenceMatrix class.
| |
GrayLevelCooccurrenceMatrix(Int32, CooccurrenceDegree) |
Initializes a new instance of the GrayLevelCooccurrenceMatrix class.
| |
GrayLevelCooccurrenceMatrix(Int32, CooccurrenceDegree, Boolean, Boolean) |
Initializes a new instance of the GrayLevelCooccurrenceMatrix class.
|
Name | Description | |
---|---|---|
AutoGray |
Gets or sets whether the maximum value of gray should be
automatically computed from the image. If set to false,
the maximum gray value will be assumed 255.
| |
Degree |
Gets or sets the direction at which the co-occurrence should
be found. Default is Degree0.
| |
Distance |
Gets or sets the distance at which the
texture should be analyzed. Default is 1.
| |
Normalize |
Gets or sets whether the produced GLCM should be normalized,
dividing each element by the number of pairs. Default is true.
| |
Pairs |
Gets the number of pairs registered during the
last computed GLCM.
|
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
| |
Compute(Bitmap) |
Computes the Gray-level Co-occurrence Matrix (GLCM)
for the given source image.
| |
Compute(BitmapData) |
Computes the Gray-level Co-occurrence Matrix (GLCM)
for the given source image.
| |
Compute(UnmanagedImage) |
Computes the Gray-level Co-occurrence Matrix (GLCM)
for the given source image.
| |
Compute(UnmanagedImage, Rectangle) |
Computes the Gray-level Co-occurrence Matrix for the given matrix.
| |
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.) | |
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.) |
A co-occurrence matrix or co-occurrence distribution is a matrix that is defined over an image to be the distribution of co-occurring pixel values (grayscale values, or colors) at a given offset.
Any matrix or pair of matrices can be used to generate a co-occurrence matrix, though their most common application has been in measuring texture in images, so the typical definition, as above, assumes that the matrix is an image. It is also possible to define the matrix across two different images.Such a matrix can then be used for color mapping.
References:
Gray-level Cooccurrence matrices can be computed directly from images:
// Let's load an example image, such as Lena, // from a standard dataset of example images: var images = new TestImages(path: localPath); Bitmap lena = images["lena.bmp"]; // Create a new gray-level cooccurrence matrix using default parameters var glcm = new GrayLevelCooccurrenceMatrix(distance: 1, degree: CooccurrenceDegree.Degree0, normalize: true); // Extract the matrix from the image double[,] matrix = glcm.Compute(lena);
These matrices also play a major role in the computation of Haralick descriptors. For more examples, including on how to use those matrices for image classification, please see Haralick and HaralickDescriptor documentation pages.