P.pranay Kumar 21BAI1504 EXP-10

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Name:P.

Pranay Kumar
Reg no:21BAI1504
Faculty:Dr.Palani Thanaraj

Experiment-10
Texture Analysis based on GLCM

Aim: To perform GLCM (Gray Level Co-Occurrence Matrix on a mountain image, with the
Mountain as the foreground and the sky behind It as the background.

Resources Used: Anaconda Python Environment


Google Colab Jupyter Notebook

Theory
OpenCV (Open-Source Computer Vision Library) is an open-source computer vision and machine
learning software library. OpenCV was built to provide a common infrastructure for computer
vision applications and to accelerate the use of machine perception in the commercial products.
NumPy is a library for the Python programming language, adding support for large, multi-
dimensional arrays and matrices, along with a large collection of high-level mathematical functions
to operate on these arrays.
Matplotlib is a plotting library for the Python programming language and its numerical
mathematics extension NumPy. It provides an object-oriented API for embedding plots into
applications using general-purpose GUI toolkits like Tkinter, Python, Qt, or GTK.

Tasks:
Task 1: Obtain Region of Interest (ROI) of the given image namely few points for the foreground
and few points on the background.

Task 2: Compute the GLCM for the selected ROIs and display the min and max value of the selected
ROIs

Task 3: Provide a scatter plot considering the features contrast and Correlation and provide your
inference
Procedure:
Open Google Colab and create a new Jupyter Notebook.
Import the required libraries which are OpenCV, Matplotlib, Skimage.data and graycomatrix along
with graycoprops.

Task 1: Obtain Region of Interest (ROI) of the given image namely few points for the foreground
and few points on the background.
Read the image in grayscale and obseve it for points in the foreground and background.
Task 2: Compute the GLCM for the selected ROIs and display the min and max value of the selected
Regions of Interest.
Select the patches of sky as background at (50,200), (50, 100),(100,500),(150,100) and
patches of the mountain as the foreground at (300, 500), (270, 400), (250, 200), (220, 100).
Display the selected Regions of Interest from the selected patches.

Display the min and max values of the selected regions of interest.
Scatter plot between the Contrast and the Correlation

We observe the selected regions of interest have a similar range of minimum values and
maximum values among the patches.

Results: The given tasks have been done using programs in Python using Opencv
Skimage and Matplotlib libraries.

Conclusion: Python program have been created to Obtain Regions of Interest (a few points
in the background - sky and a few points in the foreground - mountains) for the
mountain image, GLCM for the selected ROI’s has been computed, the min and
the max values of the selected ROI’s have been displayed and a scatter plot of
features contrast vs correlation has been generated

You might also like