ELE 488 Fall 2006 Image Processing and Transmission 09-21-06 1.Generate and Display of Gray Scale images in Matlab 2.Histogram of Gray Scale Image 3.Point.

Slides:



Advertisements
Similar presentations
Digital Image Processing Lecture 3: Image Display & Enhancement
Advertisements

Image Display MATLAB functions for displaying image Bit Planes
Digital Image Processing
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Image Processing Lecture 4
Chapter 3 Image Enhancement in the Spatial Domain.
Chapter - 2 IMAGE ENHANCEMENT
Image Histograms Cumulative histogram
Digital Image Processing Lecture11: Histogram Processing.
Intensity Transformations (Chapter 3)
HISTOGRAM TRANSFORMATION IN IMAGE PROCESSING AND ITS APPLICATIONS Attila Kuba University of Szeged.
EE663 Image Processing Histogram Equalization Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Digital Image Processing
Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(rk)=nk, where: rk is the kth gray level nk.
ECE 472/572 - Digital Image Processing
Image Enhancement in the Spatial Domain
Image (and Video) Coding and Processing Lecture 5: Point Operations Wade Trappe.
Intensity Transformations
Image Processing IB Paper 8 – Part A Ognjen Arandjelović Ognjen Arandjelović
HISTOGRAM TRANSFORMATION IN IMAGE PROCESSING SHINTA P TEKNIK INFORMATIKA STMIK MDP 2011.
Chapter 4: Image Enhancement
BYST Eh-1 DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Image Enhancement.
Image Enhancement by Modifying Gray Scale of Individual Pixels
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Lecture 4 Digital Image Enhancement
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Digital Image Processing
Chapter 3: Image Enhancement in the Spatial Domain
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Image Enhancement To process an image so that the result is more suitable than the original image for a specific application. Spatial domain methods and.
EEE 498/591- Real-Time DSP1 What is image processing? x(t 1,t 2 ) : ANALOG SIGNAL x : real value (t 1,t 2 ) : pair of real continuous space (time) variables.
6/9/2015Digital Image Processing1. 2 Example Histogram.
CS443: Digital Imaging and Multimedia Point Operations on Digital Images Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring.
Image Enhancement in the Spatial Domain (chapter 3) Math 5467, Spring 2008 Most slides stolen from Gonzalez & Woods, Steve Seitz and Alexei Efros.
Spectral contrast enhancement
Lecture 4 Digital Image Enhancement
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Digital Image Processing
University of Ioannina - Department of Computer Science Intensity Transformations (Point Processing) Christophoros Nikou Digital Image.
Manipulating contrast/point operations. Examples of point operations: Threshold (demo) Threshold (demo) Invert (demo) Invert (demo) Out[x,y] = max – In[x,y]
M. Wu: ENEE631 Digital Image Processing (Spring'09) Point Operations Spring ’09 Instructor: Min Wu Electrical and Computer Engineering Department, University.
CS6825: Point Processing Contents – not complete What is point processing? What is point processing? Altering/TRANSFORMING the image at a pixel only.
Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
CIS 601 Image ENHANCEMENT in the SPATIAL DOMAIN Dr. Rolf Lakaemper.
Intensity Transformations or Translation in Spatial Domain.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - IMAGES. Processing digital Images digital images are often processed using “digital filters” digital images are.
3. Image Sampling & Quantisation 3.1 Basic Concepts To create a digital image, we need to convert continuous sensed data into digital form. This involves.
CS654: Digital Image Analysis Lecture 18: Image Enhancement in Spatial Domain (Histogram)
Digital Image Processing Lecture9: Intensity (Gray-level) Transformation Functions using MATLAB.
Presented By: ROLL No IMTIAZ HUSSAIN048 M.EHSAN ULLAH012 MUHAMMAD IDREES027 HAFIZ ABU BAKKAR096(06)
Image Display & Enhancement Lecture 2 Prepared by R. Lathrop 10/99 updated 1/03 Readings: ERDAS Field Guide 5th ed Chap 4; Ch 5: ; App A Math Topics:
Intensity Transformations (Histogram Processing)
Digital Image Processing Image Enhancement in the Spatial Domain.
CIS 601 – 04 Image ENHANCEMENT in the SPATIAL DOMAIN Longin Jan Latecki Based on Slides by Dr. Rolf Lakaemper.
Histograms and Color Balancing Computational Photography Derek Hoiem, University of Illinois 09/10/15 “Empire of Light”, Magritte.
ENEE631 Digital Image Processing (Spring'04) Point Operations Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park  
ENEE631 Digital Image Processing (Spring'04) Signal Processing: From 1-D to 2-D (m-D) Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland,
Digital Image Processing EEE415 Lecture 3
CH2. Point Processes Arithmetic Operation Histogram Equalization
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
Digital Image Processing Image Enhancement in Spatial Domain
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter.
Point Processing When doing so you actually perform a special type of image processing known as point processing.
Image Enhancement.
Digital Image Processing
Image Processing – Contrast Enhancement
Histogram Equalization
Presentation transcript:

ELE 488 Fall 2006 Image Processing and Transmission Generate and Display of Gray Scale images in Matlab 2.Histogram of Gray Scale Image 3.Point Operations: brightness, contrast, gamma – correction 9/21/06

A Gray Scale Image: an array of integers (quantization) columns rows Intensity value at pixel (2,7) j i Each pixel can be addressed by a row and column number. MATLAB indexes from 1 to N. (although sometimes convenient to index from 0 to N – 1) 0 (black) 255 (white) Quantization

Generate and Display Images in Matlab 256 x 256 MATLAB: J=0.5 * ones(256,256); imshow(J) or image(J * 256) MATLAB: vones = ones(256,1); ramp=[0:1:255]/256; J=vones * ramp ’ ; imshow(J) Separable if J(i,j) = f(i) g(j) j i

Separable Images Special 2-D functions (i.e. images): In matrix notation, J is the outer product of vectors f and g: = * (column x row)

More Examples MATLAB: csig=cos(ramp * 4 * pi); J=csig’ * ramp; 256 x 256 MATLAB: J=cos(4*pi*ramp)*cos(4*pi*ramp)’; To use imshow, need to scale J so that 0 ≤ J ≤ 1.

2-D sinc function N=100; K=2; % how many cycles x=(-N:1:N)/N; x=(K*2*pi*x)’; f=sin(x)./x; f(N+1)=1; J = f * f’ ; % Normalize to 0,1 maxJ=max(max(J)); minJ=min(min(J)); J=(J-minJ)/(maxJ-minJ); figure(1);imshow(J); figure(2);mesh(x,x,J);

Load Image and Store Image in MATLAB 480 x 480 meanv = maxv = 219 minv = 0 m=480 n=480 A=imread(‘monkey’,’bmp’); or A=imread(‘monkey.bmp’); imshow(A); maxv=max(max(A)); minv=min(min(A)); meanv=mean2(A); [m n]=size(A);. (processing A to get B) imwrite(B,’mymonkey’,’bmp’); or imwrite(B, ‘mymonkey.bmp’);

Conversion uint8  double float in MATLAB B=im2double(A); mean2(B) ans= max(max(B)) ans= min(min(B)) ans=0 uint8 format: each pixel value is 1 byte unsigned integer, 0 to 255 double float format: each pixel value is a floating point number between 0 and 1. Float format is more convenient for mathematical operations, but may not be practical for final implementation

Luminance Histogram Represents the relative frequency of occurrence of the various gray levels in the image –For each gray level, count the # of pixels having that level –Can group nearby levels to form a big bin & count #pixels in it Pixels in image J take values from a set V=[0,…,L-1], e.g. L=256 Let k j be the number of pixels taking value j k j as a function of j is the image histogram of image J UMCP ENEE631 Slides (created by M.Wu © 2001/2004) j kjkj

Histogram in MATLAB 480 x 480 = 230,400 pixels MATLAB: imhist(A); % default 256 bins % binned with 4 equal bins: imhist(A,4);

Why Interested in Image Histograms Histogram shows distribution of pixel intensities - indicates dynamic range and can guide adjustment of image values. Normalized histogram can be interpreted as the probability that a randomly selected pixel takes a given value (or lies within a range of values). “Unbalanced” histogram doesn’t fully utilize the dynamic range Low contrast image ~ histogram concentrating in a narrow range Under-exposed image ~ histogram concentrating on the dark side Over-exposed image ~ histogram concentrating on the bright side Balanced histogram gives more pleasant look and reveals rich content Two images having similar histograms may be similar images. Images not having similar histograms are not similar. Applications in image/video classification, segmentation,...

UMCP ENEE631 Slides (created by M.Wu © 2004) Example: Balanced and Unbalanced Histograms Figure is from slides at Gonzalez/ Woods DIP book website (Chapter 3)

Point Operations / Intensity Transform Basic idea –“Zero memory” operation u each output only depend on the input intensity at the point –Map a given gray or color level u to a new level v, i.e. v = h ( u ) –Doesn’t bring in new info. –But can improve visual appearance or make features easier to detect Given a function h(x) and an image, denote the value of the (m,n)-th pixel by A(m,n). A point operation changes A(m,n) to B(m,n) according to B(m,n) = h ( A(m,n) ) independent of neighboring pixels. input gray level u output gray level v UMCP ENEE631 Slides (created by M.Wu © 2001/2004)

Contrast Stretching for Low-Contrast Images Stretch the over-concentrated graylevels in histogram via a nonlinear mapping –Piece-wise linear stretching function –Assign slopes of the stretching region to be greater than 1 UMCP ENEE631 Slides (created by M.Wu © 2001) expandcompress dynamic range

Contrast Stretching: Example original stretched UMCP ENEE631 Slides (created by M.Wu © 2001)

Point Operation: Scaling, h(x) = a*x A=imread(‘monkey’,’bmp’); A=im2double(A); imshow(A); imhist(A); a=max(max(A)); B=(1/a)*A; imshow(B); imhist(B); a<1 a>1

Point Operation: h(x) = a*x+b Point Operation: h(x) = a*x+b a – contrast, b – brightness [1, 0][0.5, 0][0.5, 0.25]

Point operation: brightness adjustment b=0.1 b=0.2b=0.3b=0.4 b shifting histogram

Point operation: linear contrast adjustment a=1.2 a=0.8 a=1.0 original more contrastless contrast h(x) = max ( min ( a(x – m) + m, 1), 0 )

Clipping & Thresholding Clipping –Special case of contrast stretching –Useful for noise reduction when interested signal mostly lie in range [a,b] Thresholding –Special case of clipping with a = b = T –Useful for scanned binary images u documents, signatures, fingerprints input gray level u output gray level v a b o  input gray level u output gray level v T o UMCP ENEE631 Slides (created by M.Wu © 2001)

Gamma Characteristics & Gamma Correction Non-linearity in CRT display –Voltage U vs. Displayed luminance L’ L’ ~ U  where  = 2.0 ~ 2.5 Use pre-processing to compensate  -distortion –U ~ L 1/  –log(L) gives similar compensation curve to  - correction, good for many applications –Camera may have L 1/  c capturing distortion with  c = 1.0 – 1.7 Power-law transformations are also useful for general purpose contrast manipulation U L’ L’ = a U  L U ~ logL ~ L 1/  UMCP ENEE631 Slides (created by M.Wu © 2001/2004)

Gamma Correction UMCP ENEE631 Slides (created by M.Wu © 2004) Gonzalez/ Woods DIP book no correction with correction

UMCP ENEE631 Slides (created by M.Wu © 2004) Typical Types of Gray-level Transformation Gonzalez/ Woods DIP book

Examples of Histogram Equalization ( From Matlab Image Toolbox Guide Fig & ) UMCP ENEE631 Slides (created by M.Wu © 2001)

Equalization Example (cont’d) original equalized UMCP ENEE631 Slides (created by M.Wu © 2001)

Quick Review of Random Variable

Histogram Equalization n pixel gray level image, n k pixels have luminance r k, 0≤ k ≤L–1. To find transformation T, s k = T(r k ), so that {s k } is ‘uniformly’ distributed Model input luminance r as random variable with pdf p r ( ), and output luminance s as random variable with pdf p s ( ), 0≤ r, s ≤1. Then p s (w) = p r (u) / T’(u) with w=T(u). p s (w) = 1 = p r (u) / T’(u), so p r (u) = T’(u), and T(w) = ∫ w p r (u) du. (cdf of u) Discrete Case: approximate s k =T(r k ) = ∫ r k p r (u)du by General Case: to find transform from r to z having specified pdf p z ( ). –Find G( ) from z to s, with p s (w) = 1, as above. So s=G(z), z=G –1 (s). –Find T( ) from r to uniform s, as above. –s = T(r), z=G –1 (s)=G –1 (T(r)). and, from r k to z k, so that 0

gray levelr c.d.f Prob(r≤ r k ) = F u (r r ) rkrk o 1 1   F r (r k ) gray level s c.d.f Prob(s<=s k ) = F s (s k ) sksk o 1 1   F s (s k ) For uniform s, s k =F s (s k ) Histogram Equalization

Histogram Equalization: A Mini-Example r k (L=8) p(r k ) Σp=s k [1.5] [4.7] [5.8] [6.6] s k q