SlideShare a Scribd company logo
5
Most read
6
Most read
Presented by:
Dr. Moe Moe Myint
Information Technology Department
Technological University (Kyaukse), Myanmar
Digital Image Processing
moemoemyint@moemyanmar.ml
www.slideshare.net/MoeMoeMyint
• Only Original Owner has full rights reserved for copied images.
• This PPT is only for fair academic use.
Pixel Value and Statistic
(Lab 5)
M. M. Myint
Dr. Moe Moe Myint
Information Technology Department
Technological University (Kyaukse)
Create histograms, contour plots, and get statistics
on image regions
Objectives
• To display histogram of image data and pixel color values
Required Equipment
• Computers with MATLAB software and Projector
Practical Procedures
• Read the image and display it
• Use histeq for enhancing the contrast of images
• Use impixel for pixel color values
• Use improfile for pixel-value cross-sections along line
segments
• Use imcontour for create contour plot of image data
Pixel Values and Statistics
corr2 2-D correlation coefficient
imhist Display histogram of image data
impixel Pixel color values
improfile Pixel-value cross-sections along line segments
imcontour Create contour plot of image data
mean2 Average or mean of matrix elements
regionprops Measure properties of image regions
std2 Standard deviation of matrix elements
Histogram of Image Data
• An image histogram is a chart that shows the distribution of intensities in
an indexed or grayscale image. You can use the information in a histogram
to choose an appropriate enhancement operation. For example, if an
image histogram shows that the range of intensity values is small, you can
use an intensity adjustment function to spread the values across a wider
range.
• imhist(I) displays a histogram for the image
Examples
Read image and display it.
I = imread('rice.png');
imshow(I)
figure, imhist(I)
adapthisteq
• Contrast-limited adaptive histogram equalization
(CLAHE)
Syntax
J = adapthisteq(I)
J = adapthisteq(I,param1,val1,param2,val2...)
• histeq enhances the contrast of images by transforming the values in
an intensity image, or the values in the colormap of an indexed image,
so that the histogram of the output image approximately matches a
specified histogram.
Examples
• Enhance the contrast of an intensity image using histogram
equalization.
I = imread('tire.tif');
J1 = histeq(I);
J2 = adapthisteq(I);
imshow(I), title('Original Image');
figure, imshow(J1); title('Histogram Equalization');
figure, imshow(J2); title('Adaptive Histogram Equalization');
Example
clc,clear all, close all;
I=imread('pout.tif');
figure;
subplot(1,2,1);imshow(I);
subplot(1,2,2);imhist(I);
imh=imadjust(I,[0.3;0.6],[0.0,1.0]);
imh1=histeq(I);
figure;
subplot(2,2,1);imshow(imh);title('Stretched Image');
subplot(2,2,2);imhist(imh);
subplot(2,2,3);imshow(imh1);title('Histeq Image');
subplot(2,2,4);imhist(imh1);
subplot
• Create axes in tiled positions
• impixel returns the red, green, and blue color values of specified image pixels.
In the syntax below, impixel displays the input image and waits for you to
specify the pixels with the mouse.
1. Display an image.
imshow canoe.tif
2. Call impixel. When called with no input arguments, impixel associates itself
with the image in the current axes.
impixel
3. Select the points you want to examine in the image by clicking the mouse.
impixel places a star at each point you select.
4. When you are finished selecting points, press Return. impixel returns the pixel
values in an n-by-3 array, where n is the number of points you selected. The stars
used to indicate selected points disappear from the image.
pixel_values =
0.1294 0.1294 0.1294
0.5176 0 0
0.7765 0.6118 0.4196
improfile
• The intensity profile of an image is the set of intensity values
taken from regularly spaced points along a line segment or
multi
I = fitsread('solarspectra.fts');
imshow(I,[]);
improfile
improfile displays a plot of the data along the line. Notice the
peaks and valleys and how they correspond to the light and dark
bands in the image.
The example below shows how improfile works with an RGB image. Use
imshow to display the image in a figure window. Call improfile without any
arguments and trace a line segment in the image interactively. In the figure, the
black line indicates a line segment drawn from top to bottom. Double-click to
end the line segment.
imshow peppers.png
improfile
The improfile function displays a plot of the intensity values along the line
segment. The plot includes separate lines for the red, green, and blue
intensities. In the plot, notice how low the blue values are at the beginning of
the plot where the line traverses the orange pepper.
imcontour
• You can use the toolbox function imcontour to display a contour
plot of the data in a grayscale image.
• This example displays a grayscale image of grains of rice and a
contour plot of the image data:
1. Read a grayscale image and display it.
I = imread('rice.png');
imshow(I)
2. Display a contour plot of the grayscale image.
figure, imcontour(I,3)
Questions?

More Related Content

PPTX
1.arithmetic & logical operations
PPTX
Digital Image Processing (Lab 07)
PPTX
Digital Image Processing (Lab 06)
PPTX
Digital Image Processing (Lab 09 and 10)
PPTX
Digital Image Processing (Lab 08)
PPT
Dital Image Processing (Lab 2+3+4)
PPTX
Mathematical operations in image processing
DOC
Simple Matlab tutorial using matlab inbuilt commands
1.arithmetic & logical operations
Digital Image Processing (Lab 07)
Digital Image Processing (Lab 06)
Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 08)
Dital Image Processing (Lab 2+3+4)
Mathematical operations in image processing
Simple Matlab tutorial using matlab inbuilt commands

What's hot (20)

PPSX
point processing
PPT
Point Processing
PPTX
point operations in image processing
PPTX
Introduction to Image Processing with MATLAB
PPT
Dip Morphological
PPT
Matlab
PDF
Image processing with matlab
PDF
Image processing basics using matlab
PDF
Digital image processing using matlab: basic transformations, filters and ope...
PPTX
Image Processing Using MATLAB
PPTX
Ec section
PDF
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
PPTX
3.point operation and histogram based image enhancement
PPTX
Lect 03 - first portion
PDF
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
PPTX
Matlab Working With Images
DOCX
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
PPTX
Contrast limited adaptive histogram equalization
PPT
Image processing using matlab
PDF
Histogram equalization
point processing
Point Processing
point operations in image processing
Introduction to Image Processing with MATLAB
Dip Morphological
Matlab
Image processing with matlab
Image processing basics using matlab
Digital image processing using matlab: basic transformations, filters and ope...
Image Processing Using MATLAB
Ec section
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
3.point operation and histogram based image enhancement
Lect 03 - first portion
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
Matlab Working With Images
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Contrast limited adaptive histogram equalization
Image processing using matlab
Histogram equalization
Ad

Similar to Digital Image Processing (Lab 05) (20)

DOCX
The method of comparing two image files
DOCX
The method of comparing two image files
PPTX
Intensity Transformation and Spatial filtering
PDF
Image-Processing-ch3-part-3.pdf
PDF
Gonzalez, rafael,c.digitalimageprocessingusing matlab
PDF
PDF
E251014
PDF
PDF
Basics of image processing using MATLAB
PDF
Programming in matlab lesson5
PDF
Matlab practical ---5.pdf
PPTX
HISTOGRAM_EQUALİZATİON FOR UNDERGRADUATE .pptx
PPTX
Histograms and Point Operations in Computer Vision
PPTX
Images in matlab
PPT
Histogram.ppt Histogram equilization to improve the image quality
PPTX
Computer vision labs for improving in the subject
PPT
Image Enhancement in the Spatial Domain1.ppt
PPT
Image enhancement in the spatial domain1
PPTX
Dip day1&2
PPTX
02 image processing
The method of comparing two image files
The method of comparing two image files
Intensity Transformation and Spatial filtering
Image-Processing-ch3-part-3.pdf
Gonzalez, rafael,c.digitalimageprocessingusing matlab
E251014
Basics of image processing using MATLAB
Programming in matlab lesson5
Matlab practical ---5.pdf
HISTOGRAM_EQUALİZATİON FOR UNDERGRADUATE .pptx
Histograms and Point Operations in Computer Vision
Images in matlab
Histogram.ppt Histogram equilization to improve the image quality
Computer vision labs for improving in the subject
Image Enhancement in the Spatial Domain1.ppt
Image enhancement in the spatial domain1
Dip day1&2
02 image processing
Ad

More from Moe Moe Myint (18)

PPTX
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
PPTX
Chapter 8 Embedded Hardware Design and Development (third portion)
PPTX
Chapter 8 Embedded Hardware Design and Development (second portion)
PPTX
Schematic and PCB Design Using Eagle
PPTX
Chapter 4 Embedded System: Application and Domain Specific
PPTX
Chapter 3 Charateristics and Quality Attributes of Embedded System
PPTX
Introduction to Embedded System I: Chapter 2 (5th portion)
PPTX
Introduction to Embedded System: Chapter 2 (4th portion)
PPTX
Introduction to Embedded System I : Chapter 2 (3rd portion)
PPTX
Introduction to Embedded System I : Chapter 2 (2nd portion)
PPTX
Introduction to Embedded Systems I: Chapter 2 (1st portion)
PPTX
Introduction to Embedded Systems I : Chapter 1
PPTX
Lect 06
PPTX
Lect 02 second portion
PPTX
Lect 02 first portion
PPTX
Lect 02 first portion
PPTX
Lecture 1 for Digital Image Processing (2nd Edition)
PPT
Digital image processing lab 1
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (second portion)
Schematic and PCB Design Using Eagle
Chapter 4 Embedded System: Application and Domain Specific
Chapter 3 Charateristics and Quality Attributes of Embedded System
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System: Chapter 2 (4th portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I : Chapter 1
Lect 06
Lect 02 second portion
Lect 02 first portion
Lect 02 first portion
Lecture 1 for Digital Image Processing (2nd Edition)
Digital image processing lab 1

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Welding lecture in detail for understanding
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Sustainable Sites - Green Building Construction
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Construction Project Organization Group 2.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Welding lecture in detail for understanding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Structs to JSON How Go Powers REST APIs.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Sustainable Sites - Green Building Construction
CH1 Production IntroductoryConcepts.pptx
Construction Project Organization Group 2.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CYBER-CRIMES AND SECURITY A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
additive manufacturing of ss316l using mig welding
Internet of Things (IOT) - A guide to understanding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Lesson 3_Tessellation.pptx finite Mathematics
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...

Digital Image Processing (Lab 05)

  • 1. Presented by: Dr. Moe Moe Myint Information Technology Department Technological University (Kyaukse), Myanmar Digital Image Processing moemoemyint@moemyanmar.ml www.slideshare.net/MoeMoeMyint
  • 2. • Only Original Owner has full rights reserved for copied images. • This PPT is only for fair academic use.
  • 3. Pixel Value and Statistic (Lab 5) M. M. Myint Dr. Moe Moe Myint Information Technology Department Technological University (Kyaukse) Create histograms, contour plots, and get statistics on image regions
  • 4. Objectives • To display histogram of image data and pixel color values Required Equipment • Computers with MATLAB software and Projector Practical Procedures • Read the image and display it • Use histeq for enhancing the contrast of images • Use impixel for pixel color values • Use improfile for pixel-value cross-sections along line segments • Use imcontour for create contour plot of image data
  • 5. Pixel Values and Statistics corr2 2-D correlation coefficient imhist Display histogram of image data impixel Pixel color values improfile Pixel-value cross-sections along line segments imcontour Create contour plot of image data mean2 Average or mean of matrix elements regionprops Measure properties of image regions std2 Standard deviation of matrix elements
  • 6. Histogram of Image Data • An image histogram is a chart that shows the distribution of intensities in an indexed or grayscale image. You can use the information in a histogram to choose an appropriate enhancement operation. For example, if an image histogram shows that the range of intensity values is small, you can use an intensity adjustment function to spread the values across a wider range. • imhist(I) displays a histogram for the image Examples Read image and display it. I = imread('rice.png'); imshow(I) figure, imhist(I)
  • 7. adapthisteq • Contrast-limited adaptive histogram equalization (CLAHE) Syntax J = adapthisteq(I) J = adapthisteq(I,param1,val1,param2,val2...)
  • 8. • histeq enhances the contrast of images by transforming the values in an intensity image, or the values in the colormap of an indexed image, so that the histogram of the output image approximately matches a specified histogram. Examples • Enhance the contrast of an intensity image using histogram equalization. I = imread('tire.tif'); J1 = histeq(I); J2 = adapthisteq(I); imshow(I), title('Original Image'); figure, imshow(J1); title('Histogram Equalization'); figure, imshow(J2); title('Adaptive Histogram Equalization');
  • 9. Example clc,clear all, close all; I=imread('pout.tif'); figure; subplot(1,2,1);imshow(I); subplot(1,2,2);imhist(I); imh=imadjust(I,[0.3;0.6],[0.0,1.0]); imh1=histeq(I); figure; subplot(2,2,1);imshow(imh);title('Stretched Image'); subplot(2,2,2);imhist(imh); subplot(2,2,3);imshow(imh1);title('Histeq Image'); subplot(2,2,4);imhist(imh1);
  • 10. subplot • Create axes in tiled positions
  • 11. • impixel returns the red, green, and blue color values of specified image pixels. In the syntax below, impixel displays the input image and waits for you to specify the pixels with the mouse. 1. Display an image. imshow canoe.tif 2. Call impixel. When called with no input arguments, impixel associates itself with the image in the current axes. impixel 3. Select the points you want to examine in the image by clicking the mouse. impixel places a star at each point you select. 4. When you are finished selecting points, press Return. impixel returns the pixel values in an n-by-3 array, where n is the number of points you selected. The stars used to indicate selected points disappear from the image. pixel_values = 0.1294 0.1294 0.1294 0.5176 0 0 0.7765 0.6118 0.4196
  • 12. improfile • The intensity profile of an image is the set of intensity values taken from regularly spaced points along a line segment or multi I = fitsread('solarspectra.fts'); imshow(I,[]); improfile improfile displays a plot of the data along the line. Notice the peaks and valleys and how they correspond to the light and dark bands in the image.
  • 13. The example below shows how improfile works with an RGB image. Use imshow to display the image in a figure window. Call improfile without any arguments and trace a line segment in the image interactively. In the figure, the black line indicates a line segment drawn from top to bottom. Double-click to end the line segment. imshow peppers.png improfile The improfile function displays a plot of the intensity values along the line segment. The plot includes separate lines for the red, green, and blue intensities. In the plot, notice how low the blue values are at the beginning of the plot where the line traverses the orange pepper.
  • 14. imcontour • You can use the toolbox function imcontour to display a contour plot of the data in a grayscale image. • This example displays a grayscale image of grains of rice and a contour plot of the image data: 1. Read a grayscale image and display it. I = imread('rice.png'); imshow(I) 2. Display a contour plot of the grayscale image. figure, imcontour(I,3)

Editor's Notes

  • #4: A spatial transformation (also known as a geometric operation) modifies the spatial relationship between pixels in an image, mapping pixel locations in an input image to new locations in an output image. The toolbox includes functions that perform certain specialized spatial transformations, such as resizing and rotating an image. In addition, the toolbox includes functions that you can use to perform many types of 2-D and N-D spatial transformations, including custom transformations. Resizing an Image Rotating an Image Cropping an Image Performing General 2-D Spatial Transformations Performing N-Dimensional Spatial Transformations Example: Performing Image Registration
  • #12: impixel returns the red, green, and blue color values of specified image pixels. In the syntax below, impixel displays the input image and waits for you to specify the pixels with the mouse. P = impixel(I) P = impixel(X,map) P = impixel(RGB) If you omit the input arguments, impixel operates on the image in the current axes. Use normal button clicks to select pixels. Press Backspace or Delete to remove the previously selected pixel. A shift-click, right-click, or double-click adds a final pixel and ends the selection; pressing Return finishes the selection without adding a pixel. When you finish selecting pixels, impixel returns an m-by-3 matrix of RGB values in the supplied output argument. If you do not supply an output argument, impixel returns the matrix in ans. You can also specify the pixels noninteractively, using these syntax. P = impixel(I,c,r) P = impixel(X,map,c,r) P = impixel(RGB,c,r) r and c are equal-length vectors specifying the coordinates of the pixels whose RGB values are returned in P. The kth row of P contains the RGB values for the pixel (r(k),c(k)). If you supply three output arguments, impixel returns the coordinates of the selected pixels. For example, [c,r,P] = impixel(...) To specify a nondefault spatial coordinate system for the input image, use these syntax. P = impixel(x,y,I,xi,yi) P = impixel(x,y,X,map,xi,yi) P = impixel(x,y,RGB,xi,yi) x and y are two-element vectors specifying the image XData and YData. xi and yi are equal-length vectors specifying the spatial coordinates of the pixels whose RGB values are returned in P. If you supply three output arguments, impixel returns the coordinates of the selected pixels. [xi,yi,P] = impixel(x,y,...)