Introduction to Digital Image Processing

Similar documents
Intensity Transformations and Spatial Filtering

Point Operations and Spatial Filtering

Chapter 3: Intensity Transformations and Spatial Filtering

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

Digital Image Analysis and Processing

Digital Image Processing, 2nd ed. Digital Image Processing, 2nd ed. The principal objective of enhancement

Lecture 4. Digital Image Enhancement. 1. Principle of image enhancement 2. Spatial domain transformation. Histogram processing

IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

UNIT - 5 IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Image Enhancement: To improve the quality of images

Lecture 4 Image Enhancement in Spatial Domain

Digital Image Processing

Sampling and Reconstruction

Intensity Transformation and Spatial Filtering

Selected Topics in Computer. Image Enhancement Part I Intensity Transformation

In this lecture. Background. Background. Background. PAM3012 Digital Image Processing for Radiographers

Image Enhancement in Spatial Domain (Chapter 3)

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

EELE 5310: Digital Image Processing. Lecture 2 Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

EELE 5310: Digital Image Processing. Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Digital Image Processing. Lecture # 3 Image Enhancement

Digital Image Processing

IMAGE ENHANCEMENT in SPATIAL DOMAIN by Intensity Transformations

IMAGING. Images are stored by capturing the binary data using some electronic devices (SENSORS)

EE795: Computer Vision and Intelligent Systems

Digital Image Processing. Image Enhancement (Point Processing)

Image Enhancement in Spatial Domain. By Dr. Rajeev Srivastava

Digital Image Processing, 3rd ed. Gonzalez & Woods

Histograms. h(r k ) = n k. p(r k )= n k /NM. Histogram: number of times intensity level rk appears in the image

Digital Image Processing

Basic relations between pixels (Chapter 2)

Basic Algorithms for Digital Image Analysis: a course

Lecture 4: Spatial Domain Transformations

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Point operation Spatial operation Transform operation Pseudocoloring

1.Some Basic Gray Level Transformations

Point Operations. Prof. George Wolberg Dept. of Computer Science City College of New York

Chapter4 Image Enhancement

Introduction to Digital Image Processing

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Intensity Transformations. Digital Image Processing. What Is Image Enhancement? Contents. Image Enhancement Examples. Intensity Transformations

Motivation. Gray Levels

3.3 Histogram Processing(page 142) h(r k )=n k. p(r k )=1

Digital Image Fundamentals

Image Enhancement. Digital Image Processing, Pratt Chapter 10 (pages ) Part 1: pixel-based operations

Image Acquisition + Histograms

Motivation. Intensity Levels

Filtering and Enhancing Images

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

ECG782: Multidimensional Digital Signal Processing

ELEN E4830 Digital Image Processing. Homework 3 Solution

Image Processing. Chapter(3) Part 3:Intensity Transformation and spatial filters. Prepared by: Hanan Hardan. Hanan Hardan 1

Digital Image Processing

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

Edge and local feature detection - 2. Importance of edge detection in computer vision

Lecture 3 - Intensity transformation

Computer Vision & Digital Image Processing. Image segmentation: thresholding

Chapter - 2 : IMAGE ENHANCEMENT

Image Restoration and Reconstruction

An introduction to image enhancement in the spatial domain.

Lecture #5. Point transformations (cont.) Histogram transformations. Intro to neighborhoods and spatial filtering

Image Restoration and Reconstruction

CHAPTER 6 DETECTION OF MASS USING NOVEL SEGMENTATION, GLCM AND NEURAL NETWORKS

FPGA IMPLEMENTATION FOR REAL TIME SOBEL EDGE DETECTOR BLOCK USING 3-LINE BUFFERS

Lecture 2 Image Processing and Filtering

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Linear Operations Using Masks

Image restoration. Restoration: Enhancement:

Chapter 3 Image Enhancement in the Spatial Domain

Feature extraction. Bi-Histogram Binarization Entropy. What is texture Texture primitives. Filter banks 2D Fourier Transform Wavlet maxima points

Review for Exam I, EE552 2/2009

EE663 Image Processing Histogram Equalization I

1.What is meant by image enhancement by point processing? Discuss any two methods in it.

Texture. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors

ECG782: Multidimensional Digital Signal Processing

Image Processing Lecture 10

Image Processing. Cosimo Distante. Lecture 6: Monochrome and Color processing

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Recursive Estimation

Digital Image Processing

Image Segmentation Image Thresholds Edge-detection Edge-detection, the 1 st derivative Edge-detection, the 2 nd derivative Horizontal Edges Vertical

BSc (Hons) Computer Science. with Network Security. Examinations for / Semester 2

What is an Image? Image Acquisition. Image Processing - Lesson 2. An image is a projection of a 3D scene into a 2D projection plane.

Gray level histograms

Digital Image Analysis and Processing

Digital image processing

Coarse-to-fine image registration

Texture Analysis. Selim Aksoy Department of Computer Engineering Bilkent University

Filtering Images. Contents

EN1610 Image Understanding Lab # 3: Edges

Image Differentiation

Local Features: Detection, Description & Matching

VC 16/17 TP5 Single Pixel Manipulation

Digital Image Processing. Prof. P.K. Biswas. Department of Electronics & Electrical Communication Engineering

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

Morphological Image Processing

Transcription:

Introduction to Digital Image Processing Ranga Rodrigo June 9, 29 Outline Contents Introduction 2 Point Operations 2 Histogram Processing 5 Introduction We can process images either in spatial domain or in transform domains. Spatial domain refers to image plane itself. In spatial domain processing, we directly manipulate pixels. Spatial domain processing is common. Frequency domain and wavelets are examples of transform domains. Domains Image enhancement Spatial domain Transform domain Spatial Domain Processing Spatial domain processing Range operations Domain operations Point operations Neighborhood operations

Point Operations g (x, y ) = T [ f (x, y ) ]. These are known as gray level transformations. Examples: Gamma correction. Window-center correction. Histogram equalization. Neighborhood Operations [ ] g (x, y ) = T (x,y) N f (x, y), where N is some neighborhood of (x, y ). Examples: Filtering: mean, Gaussian, median etc. Image gradients etc. Domain Operations g (x, y ) = f (T x (x, y ),T y (x, y )). Examples: Warping. Flipping, rotating, etc. Image registration. 2 Point Operations Recapitulation g (x, y ) = T [ f (x, y ) ]. These are known as gray level transformations. The enhanced value of a pixel depends only on the original value of the pixel. If we denote the value of the pixel before and after the transformation as r and s, respectively, the above expression reduces to s = T (r ). () For example, s = 255 r gives the negative of the image. Example. Write a program to generate the negative of an image. 2

L L Figure : Intensity transformation function for image negative. L γ =. γ =.5 γ = 2 L Figure 2: Intensity transformation function using power law. Power-Law Transformations where c and γ are positive constants. s = cr γ, (2) Values of γ such that < γ < map a narrow range of dark input pixels vales into a wider range of output values, with opposite being true for higher values of input levels. Values γ > have the opposite behavior to above. c = γ = gives the identity transformation. Gamma correction is an application. Example 2. Write a program to carry out power-law transformation on an image.

L T (r ) L Figure : Intensity transformation function using power law. Piecewise-Linear Transformation Functions These functions can be used to do gray level operations such as these: Contrast stretching. Window-center correction to enhance a portion of levels. Gray-level slicing. Here is an example of a piecewise linear transformation. im = imread ( Images/airplane.jpg ) ; r = rgb2gray (im ) ; line = :. 5 : ; line2 = 55/ 55*([ 2: : 255] 2) + ; t = [ line, line2 ] plot ( t ) s = t ( r + ) ; subplot (, 2, ) imshow( r ) t i t l e ( Original ) subplot (, 2, 2 ) imshow( mat2gray ( s ) ) t i t l e ( Output ) Example. Write a program to carry out contrast stretching. 4

Histogram Processing The histogram of a digital image with gray levels in the range [,L ] is a discrete function h(r k ) = n k, where r k is the kth gray level and n k is the number of pixels having gray level r k. We can normalize the histogram by dividing by the total number of pixels n. Then we have an estimate of the probability of occurrence of level r k, i.e., p(r k ) = n k /n. Number of Bins in a Histogram The histogram that we described above has L bins. We can construct a coarser histogram by selecting a smaller number of bins than L. Then several adjacent values of r will be counted for a bin. Example 4. Write a program to compute the histogram with a given number of bins. 5

Histogram Equalization We saw that a given image may have a peaked histogram. Such a peaked or nonflat histogram show that pixels do not equally occupy the all the gray levels. This results in a low contrast image. We can remedy this by carrying out the operation called histogram equalization. Histogram equalization carries out a gray level transformation that results in an image with a more or less flat histogram. Consider for now continuous intensity values of am image to be processed. We assume that r [,L ]. Lets consider the intensity transformation s = T (r ) r L () that produces an output intensity level s for every pixel in the input image having intensity r. We assume that T (r ) is monotonically increasing in the interval r L, and T (r ) L for r L. The intensity levels in the image may be viewed as random variables in the interval [,L ]. Let p r (r ) and p s (s) denote the probability density functions (PDFs) of r and s. A fundamental result in basic probability from basic probability theory is is that if p r (r ) and T (r ) are known, and T (r ) is continuous and differentiable over the range of values of interest, then the PDF of the transformed variable s can be obtained using the simple formula p s (s) = p r (r ) dr ds. (4) Now let s consider the following transform function: r s = T (r ) = (L ) p r (w)dw. (5) where w is the dummy variable of integration. The right-hand side of this equation is the cumulative distribution function (CDF) of random variable r. This function satisfies the two conditions that we mentioned. Because PDFs are always positive and the integral of a function is the area under the curve, Equation 5 satisfies the first condition. This is because the area under the curve cannot decrease as r increases. When the upper limit in this equation is r = L, the integral evaluates to, because the area under a PDF curve is always. So the maximum value of s is L, and the second condition is also satisfied. To find p s (s) corresponding to this transformation we use Equation. ds dr dt (r ) =, dr = (L ) d dr [ int r p r (w)dw ], (6) = (L )p r (r ). 6

r k n k p r (r k ) = n k /MN r = 79.9 r = 2.25 r 2 = 2 85.2 r = 656.6 r 4 = 4 29.8 r 5 = 5 245.6 r 6 = 6 22. r 7 = 7 8.2 Table : Table for Example 5. Substituting this result in Equation, and keeping in mind that all probability values are positive, yields p s (s) = p r (r ) dr ds, = p r (r ) (L )p r (r ), (7) = s L. L We recognize the form of p s (s) in the last line of this equation as a uniform probability density function. For discrete values, we deal with probabilities (histogram values) and the summation instead of probability density functions and integrals. The probability of occurrence of intensity level r k in a digital image is approximated by p r (r k ) = n k MN k =,,...,L, (8) where M N is the total number of pixels in the image, n k is the number of pixels that have intensity r k, and L is the number of possible intensity levels in the image (e.g., 256). Recall that a plot of p r (r k ) versus r k is commonly referred to as a histogram. The discrete form of the Equation 4 is k s k = T (r k ) = (L ) p r (r j ), j = (L ) k = n j k =,,...,L. MN j = (9) Thus the output image is obtained by mapping each pixel in the input image with intensity r k into a corresponding pixel level s k in the output image using Equation 9. Example 5. Suppose that a -bit image (L = 8) of size 64 64 pixels (MN = 496) has the intensity distribution shown in Table, where the intensity levels are in the range [, L ] = [, 7]. carry out histogram equalization. 7

Example 6. White a program to carry out histogram equalization. 8