Computer Vision & Digital Image Processing Histogram Processing [PDF]

MATLAB Histogram Function function [h]=histogram(f);. [xmax,ymax]=size(f); h=linspace(0,0,256); for x=1:xmax for y=1:yma

0 downloads 7 Views 73KB Size

Recommend Stories


[PDF] Digital Image Processing
Almost everything will work again if you unplug it for a few minutes, including you. Anne Lamott

[PDF] Introductory Digital Image Processing
We may have all come on different ships, but we're in the same boat now. M.L.King

Digital Image Processing: Introduction
You have survived, EVERY SINGLE bad day so far. Anonymous

Digital Image Processing
You can never cross the ocean unless you have the courage to lose sight of the shore. Andrè Gide

CAP5400 – Digital Image Processing
So many books, so little time. Frank Zappa

305434 Digital Image Processing
Pretending to not be afraid is as good as actually not being afraid. David Letterman

Introductory Digital Image Processing
The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together.

Digital Image Processing Color Image Processing Color Fundamentals
Happiness doesn't result from what we get, but from what we give. Ben Carson

[PDF] Digital Image Processing (3rd Edition)
The greatest of richness is the richness of the soul. Prophet Muhammad (Peace be upon him)

Idea Transcript


Histogram Processing

Computer Vision & Digital Image Processing

– Divide the components by the total number of pixels in the image – Assuming an MxN image, this yields p(rk) = nk/MN for k=0,1,2,….,L-1 – p(rk) is, basically, an estimate of the probability of occurrence of intensity level rk in an image Σ p(rk) = 1

Histogram Processing I

Electrical & Computer Engineering

• The histogram of a digital image, f, (with intensities [0,L-1]) is a discrete function h(rk) = nk • Where rk is the kth intensity value and nk is the number of pixels in f with intensity rk • Normalizing the histogram is common practice

Dr. D. J. Jackson Lecture 6-1

Electrical & Computer Engineering

Uses for Histogram Processing

Histogram Examples

• • • •

• Four basic image types and their corresponding histograms

Image enhancements Image statistics Image compression Image segmentation

– – – –

• Simple to calculate in software • Economic hardware implementations – Popular tool in real-time image processing

• A plot of this function for all values of k provides a global description of the appearance of the image (gives useful information for contrast enhancement) Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-3

Dr. D. J. Jackson Lecture 6-2

Dark Light Low contrast High contrast

• Histograms commonly viewed in plots as h(rk) = nk versus rk p(rk) = nk /MN versus rk

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-4

MATLAB Histogram Function

Histogram Equalization

function [h]=histogram(f); [xmax,ymax]=size(f); h=linspace(0,0,256); for x=1:xmax for y=1:ymax h(f(x,y))=h(f(x,y))+1; end; end;

• Histogram equalization is a process for increasing the contrast in an image by spreading the histogram out to be approximately uniformly distributed • The gray levels of an image that has been subjected to histogram equalization are spread out and always reach white

Electrical & Computer Engineering

– The increase of dynamic range produces an increase in contrast

• For images with low contrast, histogram equalization has the adverse effect of increasing visual graininess Dr. D. J. Jackson Lecture 6-5

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-6

Histogram Equalization (assumptions)

Histogram Equalization (assumptions)

• The intensity transformation function we are constructing is of the form

s = T (r ) 0 ≤ r ≤ L − 1

• An output intensity level s is produced for every pixel in the input image having intensity r • We assume – T(r) is monotonically increasing in the interval 0≤ r ≤ L-1 – 0≤ Τ(r) ≤ L-1 for 0≤ r ≤ L-1

• If we define the inverse

r = T −1 ( s ) 0 ≤ s ≤ L − 1 • Then T(r) should be strictly monotonically increasing Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-7

Histogram Equalization (continued)

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-8

Histogram Equalization (continued)

• Histogram equalization requires construction of a transformation function sk k

sk = T (rk ) = ∑ j =0

nj M ×N

sk = T (rk ) =

( L − 1) k ∑nj M × N j =0

• where rk is the kth gray level, nk is the number of pixels with that gray level, MxN is the number of pixels in the image, and k=0,1,…,L-1 • This yields an s with as many elements as the original image’s histogram (normally 256 for our test images) • The values of s will be in the range [0,1]. For constructing a new image, s would be scaled to the range [1,256]

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-9

Electrical & Computer Engineering

Dr. D. J. Jackson Lecture 6-10

An Interactive MATLAB Histogram Function

An Interactive MATLAB Histogram Function

function winhist(action); global p1 global p2 global FIG if nargin

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.