Javatpoint Logo
Javatpoint Logo

Mahotas - Haralick

Mahotas is an open-source computer vision library for Python that provides a wide range of image processing functions. One of the features provided by Mahotas is the ability to extract Haralick features from an image. Haralick features are texture features that are based on gray-level co-occurrence matrices (GLCMs).

The mahotas.features.haralick() function in the Mahotas library can be used to extract Haralick features from an image. The function takes an image as input and returns a matrix of 14 features for each pixel of the image. These features include information such as the contrast, dissimilarity, homogeneity, and energy of the image's texture.

The Haralick features are computed by calculating the statistics of the GLCM. They are rotation-invariant and can be computed for different distances and angles. They are useful for texture classification, segmentation and feature extraction.

Some applications of Haralick features include object recognition, medical imaging, and remote sensing. Haralick features have been used in many studies to classify images based on texture, such as identifying different types of soil, detecting cancer in medical images, and recognizing objects in aerial images.

A function called "mahotas.features.haralick()" in the Mahotas library retrieves a group of 14 Haralick features from a picture. The statistics of the image's gray-level co-occurrence matrices (GLCMs) constitute the foundation for these characteristics. The 14 Haralick characteristics that the function offers are listed as follows:

  1. Angular Second Moment (ASM)
  2. Contrast
  3. Correlation
  4. Sum of Squares: Variance
  5. Inverse Difference Moment (IDM)
  6. Sum Average
  7. Sum Variance
  8. Sum Entropy
  9. Entropy
  10. Difference Variance
  11. Difference Entropy
  12. Information Measure of Correlation 1 (IMC1)
  13. Information Measure of Correlation 2 (IMC2)
  14. Max Correlation Coefficient (MAXC)

Statistical measures: These features provide information about the distribution of gray levels in the image. Examples include Angular Second Moment (ASM), Sum of Squares: Variance, and Sum Average.

Contrast measures: These features provide information about the contrast or the difference in gray levels between pixels. Examples include Contrast, Inverse Difference Moment (IDM), and Sum Variance.

Entropy measures: These features provide information about the randomness or disorder of the gray levels in the image. Examples include Sum Entropy, Entropy, and Difference Entropy.

Correlation measures: These features provide information about the relationship between the gray levels of pairs of pixels. Examples include Correlation, Information Measure of Correlation 1 (IMC1), and Information Measure of Correlation 2 (IMC2).

Max correlation: This feature provides the maximum correlation coefficient among all the calculated angles.

Each feature is calculated using a specific mathematical formula based on the statistics of the GLCM. The exact formulas for each feature can be found in literature on texture analysis and image processing.

Applications of Mahotas-Haralick

The Haralick features provided by the Mahotas library have been used in a wide range of applications in image analysis and computer vision, some examples include:

  1. Object recognition: Haralick features have been used to classify images of different objects based on their texture. For example, they have been used to distinguish between different types of soil or to identify the species of a leaf based on its texture.
  2. Medical imaging: Haralick features have been used to detect cancer in medical images. For example, they have been used to classify mammograms as normal or abnormal based on the texture of the tissue.
  3. Remote sensing: Haralick features have been used to classify images of the earth's surface taken from satellites or aircraft. For example, they have been used to identify different types of land cover, such as forests, grasslands, and urban areas.
  4. Industrial Inspection: Haralick features have been used to classify defects in industrial inspection. For example, they have been used to classify defects in printed circuit boards, textiles, and metals.
  5. Quality control in the food industry: Haralick features have been used to classify the quality of food based on the texture of the food.
  6. Texture classification: Haralick features have been used to classify different textures in images, such as wood, stone, and fabric.
  7. Segmentation: Haralick features have been used as a feature descriptor for image segmentation, this is done by extracting the features from different regions of the image and clustering them to identify different segments of the image.

Other applications include, text recognition, face recognition, fingerprint recognition, and handwriting recognition.

In summary, Mahotas library is a powerful tool for image analysis, and Haralick features are texture features extracted from images based on gray-level co-occurrence matrices (GLCMs), these features are rotation-invariant and can be computed for different distances and angles. They are useful for texture classification, segmentation and feature extraction.


Next TopicPandas Copy Row





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA