Image Enhancement: Histogram Based Methods

Similar documents
Digital Image Processing. Lecture # 4 Image Enhancement (Histogram)

Histogram equalization

Computer Vision. Intensity transformations

Image Processing. 2. Point Processes. Computer Engineering, Sejong University Dongil Han. Spatial domain processing

TDI2131 Digital Image Processing

Digital Image Processing. Lecture 5 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Histogram equalization

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

Analysis of Contrast Enhancement Techniques For Underwater Image

Digital Image Processing

IMAGE PROCESSING: POINT PROCESSES

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

DIGITAL IMAGE PROCESSING Quiz exercises preparation for the midterm exam

Image processing. Image formation. Brightness images. Pre-digitization image. Subhransu Maji. CMPSCI 670: Computer Vision. September 22, 2016

November 11, Chapter 8: Probability: The Mathematics of Chance

PASS Sample Size Software

8. Statistical properties of grayscale images

Image Enhancement using Histogram Equalization and Spatial Filtering

Last Lecture. Lecture 2, Point Processing GW , & , Ida-Maria Which image is wich channel?

IMAGE ENHANCEMENT - POINT PROCESSING

What is an image? Bernd Girod: EE368 Digital Image Processing Pixel Operations no. 1. A digital image can be written as a matrix

Image Enhancement in Spatial Domain

Fuzzy Statistics Based Multi-HE for Image Enhancement with Brightness Preserving Behaviour

Intro to Probability Instructor: Alexandre Bouchard

Digital Imaging and Multimedia Point Operations in Digital Images. Ahmed Elgammal Dept. of Computer Science Rutgers University

Digital Image Processing. Lecture # 3 Image Enhancement

from: Point Operations (Single Operands)

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Computer Vision. Howie Choset Introduction to Robotics

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

Filtering. Image Enhancement Spatial and Frequency Based

Utilization of Multipaths for Spread-Spectrum Code Acquisition in Frequency-Selective Rayleigh Fading Channels

Time division multiplexing The block diagram for TDM is illustrated as shown in the figure

Table of contents. Vision industrielle 2002/2003. Local and semi-local smoothing. Linear noise filtering: example. Convolution: introduction

What is image enhancement? Point operation

1.Discuss the frequency domain techniques of image enhancement in detail.

Digital Image Processing

Stochastic Image Denoising using Minimum Mean Squared Error (Wiener) Filtering

Lab/Project Error Control Coding using LDPC Codes and HARQ

CS 89.15/189.5, Fall 2015 ASPECTS OF DIGITAL PHOTOGRAPHY COMPUTATIONAL. Image Processing Basics. Wojciech Jarosz

Image Enhancement (from Chapter 13) (V6)

November 8, Chapter 8: Probability: The Mathematics of Chance

4. Measuring Area in Digital Images

Ambient Passive Seismic Imaging with Noise Analysis Aleksandar Jeremic, Michael Thornton, Peter Duncan, MicroSeismic Inc.

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Gonzales & Woods, Emmanuel Agu Suleyman Tosun

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Problem Set I. Problem 1 Quantization. First, let us concentrate on the illustrious Lena: Page 1 of 14. Problem 1A - Quantized Lena Image

November 6, Chapter 8: Probability: The Mathematics of Chance

Discrete Random Variables Day 1

Transform. Processed original image. Processed transformed image. Inverse transform. Figure 2.1: Schema for transform processing

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals

Statistics, Probability and Noise

SOLUTIONS TO PROBLEM SET 5. Section 9.1

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Reading Instructions Chapters for this lecture. Computer Assisted Image Analysis Lecture 2 Point Processing. Image Processing

FLIR Camera Adjustments <9hz Boson

Fast Inverse Halftoning

Image Processing Lecture 4

Mod. 2 p. 1. Prof. Dr. Christoph Kleinn Institut für Waldinventur und Waldwachstum Arbeitsbereich Fernerkundung und Waldinventur

GE 113 REMOTE SENSING. Topic 7. Image Enhancement

1.Explain the principle and characteristics of a matched filter. Hence derive the expression for its frequency response function.

ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB

Non Linear Image Enhancement

RMT 2015 Power Round Solutions February 14, 2015

Joint Distributions, Independence Class 7, Jeremy Orloff and Jonathan Bloom

Real Time Jitter Analysis

On spatial resolution

Measure of image enhancement by parameter controlled histogram distribution using color image

Reduction of PAR and out-of-band egress. EIT 140, tom<at>eit.lth.se

HISTOGRAM EXPANSION-A TECHNIQUE OF HISTOGRAM EQULIZATION

CS 445 HW#2 Solutions

A Hybrid Colour Image Enhancement Technique Based on Contrast Stretching and Peak Based Histogram Equalization

Nonlinear Companding Transform Algorithm for Suppression of PAPR in OFDM Systems

3.5 Marginal Distributions

USE OF HISTOGRAM EQUALIZATION IN IMAGE PROCESSING FOR IMAGE ENHANCEMENT

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES

arxiv: v2 [math.pr] 20 Dec 2013

Mobile Radio Propagation: Small-Scale Fading and Multi-path

A MONTE CARLO CODE FOR SIMULATION OF PULSE PILE-UP SPECTRAL DISTORTION IN PULSE-HEIGHT MEASUREMENT

CS/ECE 545 (Digital Image Processing) Midterm Review

BBM 413 Fundamentals of Image Processing. Erkut Erdem Dept. of Computer Engineering Hacettepe University. Point Operations Histogram Processing

Revised 9/10/2015 Page 1 of 5

Lecture Topic: Image, Imaging, Image Capturing

Prof. Feng Liu. Fall /04/2018

BBM 413 Fundamentals of Image Processing. Erkut Erdem Dept. of Computer Engineering Hacettepe University. Point Operations Histogram Processing

Commercial Scanners and Science

HISTOGRAM specification (or modeling) refers to a

Image Processing for feature extraction

A Survey on Image Contrast Enhancement

APPENDIX 2.3: RULES OF PROBABILITY

Contrast Enhancement Using Bi-Histogram Equalization With Brightness Preservation

Image Processing for Mechatronics Engineering For senior undergraduate students Academic Year 2017/2018, Winter Semester

Contrast Enhancement using Improved Adaptive Gamma Correction With Weighting Distribution Technique

Keywords-Image Enhancement, Image Negation, Histogram Equalization, DWT, BPHE.

A Novel 3-D Color Histogram Equalization Method With Uniform 1-D Gray Scale Histogram Ji-Hee Han, Sejung Yang, and Byung-Uk Lee, Member, IEEE

Bi-Level Weighted Histogram Equalization with Adaptive Gamma Correction

Introduction. Chapter Time-Varying Signals

Frequency Domain Enhancement

MATH 20C: FUNDAMENTALS OF CALCULUS II FINAL EXAM

Do It Yourself 3. Speckle filtering

Transcription:

Image Enhancement: Histogram Based Methods 1

What is the histogram of a digital image? 0, r,, r L The histogram of a digital image with gray values 1 1 is the discrete function p( r n : Number of pixels with gray value r n: total Number of pixels in the image ) n n The function p(r ) represents the fraction of the total number of pixels with gray value r. r 2

Histogram provides a global description of the appearance of the image. If we consider the gray values in the image as realizations of a random variable R, with some probability density, histogram provides an approximation to this probability density. In other words, Pr( R r ) p( r ) 3

Some Typical Histograms The shape of a histogram provides useful information for contrast tenhancement. Dar image 4

Bright image Low contrast image 5

High contrast image What is the definition iti of contrast t for an image? If MAX and MIN are the gray values of an image, contrast could be defined as contrast = (MAX - MIN)/(MAX + MIN) 6

Histogram Equalization What is the histogram equalization? he histogram equalization is an approach to enhance a given image. The approach is to design a transformation T(.) such that the gray values in the output t is uniformly distributed ib t d in [0, 1]. Let us assume for the moment that the input image to be enhanced has continuous gray values, with r = 0 representing blac and r = 1 representing white. We need to design a gray value transformation s = T(r), based on the histogram of the input image, which will enhance the image. 7

As before, we assume that: (1) T(r) is a monotonically increasing function for 0 r 1 (preserves order from blac to white). (2) T(r) maps [0,1] into [0,1] (preserves the range of allowed Gray values). 8

Let us denote the inverse transformation by r T -1 (s) (). We assume that the inverse transformation also satisfies the above two conditions. We consider the gray values in the input image and output image as random variables in the interval [0, 1]. Let p in (r) and p out (s) denote the probability density of the Gray values in the input and output images. 9

If p (r) and T(r) are nown, and r T -1 in () (s) () satisfies condition 1, we can write (result from probability theory): p out ( s) p in ( r) dr ds rt 1 ( s) One way to enhance the image is to design a transformation T(.) () such that the gray values in the output is uniformly distributed in [0, 1], i.e. p out (s) 1, 0 s 1 In terms of histograms, the output image will have all gray values in equal proportion. This technique is called histogram equalization. 10

Equalization 11

Next we derive the gray values in the output is uniformly distributed in [0, 1]. Consider C the transformation s r T ( r ) p ( ), in w dw 0 r 1 0 Note that this is the cumulative distribution function (CDF) of p in (r) and satisfies the previous two conditions. From the previous equation and using the fundamental theorem of calculus, p out dr ( s) pin( r) 1 ds ds dr p in (r) 12

Therefore, the output histogram is given by p 1 ( r ) 1 1, 0 out ( s) p in ( r) r T s 1 1 ( s) p in rt The output probability density function is uniform, regardless of the input. 1 ( s) Thus, using a transformation function equal to the CDF of input gray values r, we can obtain an image with uniform gray values. This s usually results in an enhanced image, with an increase in the dynamic range of pixel values. 13

How to implement histogram equalization? Step 1:For images with discrete gray values, compute: p in n ( r ) 0 1 n L: Total number of gray levels r 0 L 1 n : Number of pixels with gray value r n: Total number of pixels in the image Step 2: Based on CDF, compute the discrete version of the previous transformation : s T( r ) pin ( rj ) 0 L 1 j0 14

Example: Consider an 8-level 64 x 64 image with gray values (0, 1,, 7). The normalized gray values are (0, 1/7, 2/7,,1). The normalized histogram is given below: NB: The gray values in output are also (0, 1/7, 2/7,, 1). 15

# pixels Fraction of # pixels Gray value Normalized gray value 16

Applying the transformation, s T( r ) p ( r ) we have j 0 in j 17

18

Notice that there are only five distinct gray levels --- (1/7, 3/7, 5/7, 6/7, 1) in the output image. We will relabel them as (s 0, s 1,, s 4 ). With this transformation, the output image will have histogram 19

Histogram of output image # pixels Gray values Note that the histogram of output image is only approximately, and not exactly, uniform. This should not be surprising, since there 20 is no result that t claims uniformity it in the discrete case.

Example Original image and its histogram 21

Histogram equalized image and its histogram 22

Comments: Histogram equalization may not always produce desirable results,,particularly if the given histogram is very narrow. It can produce false edges and regions. It can also increase image graininess i and d patchiness. 23

24

Histogram Specification (Histogram Matching) Histogram equalization yields an image whose pixels are (in theory) uniformly distributed ib t d among all gray levels. l Sometimes, this may not be desirable. Instead, we may want a transformation that yields an output image with a pre-specified histogram. This technique is called histogram specification. 25

Given Information (1) Input image from which we can compute its histogram. (2) Desired histogram. Goal Derive a point operation, H(r), that maps the input image into an output image that has the user-specified histogram. Again, we will assume, for the moment, continuous-gray values. 26

Approach of derivation z=h(r) = G -1 (v=s=t(r)) Input Uniform Output image s=t(r) image v=g(z) image Given Gaussian distribution Find negative exponential distribution? ib ti 27

Suppose, the input image has probability density in p(r).we want to find a transformation z H (r), such that the probability density of the new image obtained by this transformation is p out (z), which is not necessarily uniform. First apply the transformation s r T ( r ) p ( ), in w dw 0 r 1 0 This gives an image with a uniform probability density. (*) () If the desired output image were available, then the following transformation would generate an image with uniform density: z V out (**) G ( z ) p ( w ) dw, 0 z 1 0 28

From the gray values we can obtain the gray values z by using the inverse transformation, z G -1 (v) If instead of using the gray values obtained from (**), we use the gray values s obtained from (*) above (both are uniformly distributed! ), then the point transformation Z=H(r)= ) G -1 [ v=s =T(r)] will generate an image with the specified density out p(z), from an input image with density in p(r)! 29

For discrete gray levels, we have s T( r ) pin ( rj ) 0 L 1 v j0 G( z ) p ( z ) s 0 L 1 j0 out j If the transformation z G(z ) is one-to-one, the inverse transformation s G G -1 (s ), can be easily determined, d since we are dealing with a small set of discrete gray values. In practice, this is not usually the case (i.e., ) z G(z ) is not one-to-one) and we assign gray values to match the given histogram, as closely as possible. 30

Algorithm for histogram specification: (1) Equalize input image to get an image with uniform gray values, using the discrete equation: s T( r ) pin ( rj ) 0 L 1 j 0 (2) Based on desired histogram to get an image with uniform gray values, using the discrete equation: v G ( z ) p ( z ) s 0 L 1 j0 out v=s )] (3) 1 1 z G ( ) z G [ T ( r)] j 31

Example: Consider an 8-level 64 x 64 previous image. # pixels Gray value 32

It is desired to transform this image into a new image, using a transformation Z=H(r)= G -1 [T(r)], with histogram as specified below: #pixels Gray values 33

The transformation T(r) was obtained earlier (reproduced below): Now we compute the transformation ti G as before. 34

35

Computer z=g -1 (s)notice that G is not invertible. G -1 (0) =? G -1 (1/7) = 3/7 G -1 (2/7) = 4/7 G -1 (3/7) =? G -1 (4/7) =? G -1 (5/7) = 5/7 G -1 (6/7)=6/7 G -1 (1) = 1 36

Combining the two transformation T and G -1, compute z=h(r)= ) G -1 [v=s=t(r)] r =0z=G -1 (v=s=t(r))= z=g -1 (1/7)=3/7 From column 2 r =2/7z=G-1(v=s=T(r))= z=g-1(5/7)=5/7 r =3/7z=G-1(v=s=T(r))= z=g-1(6/7)=6/7 37 r =1/7z=G-1(v=s=T(r))= z=g-1(3/7)=?

r =4/7z=G-1(v=s=T(r))= z=g-1(6/7)=6/7 r =5/7z=G-1(v=s=T(r))= z=g-1(1)=1 r =6/7z=G-1(v=s=T(r))= ( z=g-1(1)=1 r =1z=G-1(v=s=T(r))= z=g-1(1)=1 r =1/7z=G-1(v=s=T(r))= ( z=g-1(3/7)=? 3/7 or 4/7 38

Applying y g the transformation H to the original image yields an image with histogram as below: Again, the actual histogram of the output image does not exactly but only approximately matches with the specified histogram. This is because we are dealing with discrete histograms. 39

Original image and its histogram 40 Histogram specified image and its histogram

Desired histogram 41