M ATLAB L ECTURE 3 Histogram Processing. H ISTOGRAM E QUALIZATION The imhist function create a histogram that show the distribution of intensities in.

Slides:



Advertisements
Similar presentations
Filters, Edge Detection and Sharpening Francesca Pizzorni Ferrarese 28/04/2010.
Advertisements

Digital Image Processing
M ATLAB L ECTURE 3 Histogram Processing. H ISTOGRAM E QUALIZATION The imhist function create a histogram that show the distribution of intensities in.
Laboratory of Image Processing Pier Luigi Mazzeo
Neighborhood Processing
Spatial Filtering (Chapter 3)
Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 6 Sharpening Filters
CS 4487/9587 Algorithms for Image Analysis
Digital Image Processing
Face Recognition and Biometric Systems 2005/2006 Filters.
Lecture 4 Linear Filters and Convolution
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Digital Image Processing
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Contrast Enhancement: What for ä CE is between the imaging device output and the display voltages ä Get best perceived intensities to communicate.
Image Enhancement.
Lecture 2. Intensity Transformation and Spatial Filtering
© 2010 Cengage Learning Engineering. All Rights Reserved.
2D FOURIER TRANSFORMS AND IMAGE FILTERS DAVID COOPER SUMMER 2014.
Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence.
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
Chapter 3 Image Enhancement in the Spatial Domain.
…….CT Physics - Continued V.G.WimalasenaPrincipal School of radiography.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
CSC589 Introduction to Computer Vision Lecture 3 Gaussian Filter, Histogram Equalization Bei Xiao.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr. Bart ter Haar Romeny dr. Anna Vilanova Prof.dr.ir. Marcel Breeuwer Convolution.
Chapter 5 Neighborhood Processing
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing Lecture12: Basics of Spatial Filtering.
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
M ATLAB L ECTURE 1 Basic Concepts of Digital Image Processing.
Multimedia Data Introduction to Image Processing Dr Sandra I. Woolley Electronic, Electrical.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image Arithmetic Image arithmetic is the implementation of standard arithmetic operations, such as addition, subtraction, multiplication, and division,
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 10 Segmentation Chapter.
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,
Digital Image Processing Lecture9: Intensity (Gray-level) Transformation Functions using MATLAB.
Chapter 5: Neighborhood Processing
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
Spatial Filtering (Applying filters directly on Image) By Engr. Muhammad Saqib.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Chapter 5: Neighborhood Processing 5.1 Introduction
Image processing using MATLAB
CS 691B Computational Photography
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
M ATLAB L ECTURE 2 Image Enhancement in the Spatial Domain (MATLAB)
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Image Processing Lab Section 28/3/2016 Prepared by Mahmoud Abdelsatar Demonstrator at IT Dep. Faculty of computers and information Assuit University.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
Basis beeldverwerking (8D040) dr. Andrea Fuster dr. Anna Vilanova Prof
Fundamentals of Spatial Filtering:
Image Enhancement in the
Lecture 10 Image sharpening.
Lecture 3 (2.5.07) Image Enhancement in Spatial Domain
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
FREQUENTLY USED 3x3 CONVOLUTION KERNELS
Presentation transcript:

M ATLAB L ECTURE 3 Histogram Processing

H ISTOGRAM E QUALIZATION The imhist function create a histogram that show the distribution of intensities in pout.tif. (figure command display the image a new window.) >>figure, imhist(I)

H ISTOGRAM E QUALIZATION The toolbox provides several ways to improve the contrast in an image. One way is to call the histeq function to spread the intensity values over the full range of the image, a process called histogram equalization. >>I2 = histeq(I);

H ISTOGRAM E QUALIZATION Display the new equalized image, I2, in a new figure window. >>figure, imshow(I2) Call imhist again to create a histogram of the equalized image I2. If you compare the two histograms, the histogram of I2 is more spread out than the histogram of I1. >>figure, imhist(I2)

E XAMPLE 2 As you see, the very dark image has a corresponding histogram heavily clustered at the lower end of the scale. But we can apply histogram equalization to this image, and display the results:

E XAMPLE 2 AFTER APPLYING HISTEQ >> ch=histeq(c); >> imshow(ch),figure,imhist(ch) results shown below:

L INEAR S PATIAL F ILTERING - S MOOTHING % g=imfilter(f,w,filtering_mode, boundary_options,size_options) % f is the input image % w is the filter mask % Filtering mode: % ‘corr’ filtering is done using correlation % ‘conv’ filtering is done using convolution -- flips mask 180 degrees % Boundary options % P without quotes (default) - pad image with zeros % ‘replicate’ - extend image by replicating border pixels % ‘symmetric’ - extend image by mirroring it across its border % ‘circular’ - extend image byrepeating it (one period of a periodic function) % Size options % ‘full’ - output is the same size as the padded image % ‘same’ - output is the same size as the input

L INEAR S PATIAL F ILTERING - S MOOTHING >> f=imread('GWFig3_41.jpg'); % or load in checkerboard figure 'Checker_Board.jpg' >> w=ones(9); % create a 9x9 filter (not normalized) >> gd=imfilter(f,w); % filter using default values >> imshow( gd, [ ]) % [ ] causes MATLAB to display using low and high gray levels of input image. Good for low dynamic range >> gr=imfilter(f,w,'replicate'); % pad using replication >> figure, imshow(gr, [ ]) >> gs=imfilter(f,w,'symmetric'); % pad using symmetry >> figure, imshow(gs, [ ]) % show this figure in a new window Try with a 3x3 filter of ones: w = ones(3); Try with a 3x3 filter of 1/9 (averaging): w = ones(3) / 9;

L INEAR S PATIAL F ILTERING - S HARPENING >> f=imread('GWFig3_41.jpg'); >> w= [-1,-1,-1; -1, 8,-1; -1,-1,-1]; % create a Laplacian filter >> lap_img =imfilter(f,w,'replicate'); % pad using replication >> figure, imshow(lap_img, [ ]) % show this figure in a new window % sharpen the image >> sh = f + lap_img; % sharpen the image by adding the image to its Laplacian >> figure, imshow(sh) % the sharpened image >> figure, imshow(f) % show the image for comparison

MATLAB’ S BUILT - IN FILTERS % w = fspecial(‘type’, parameters); % create filter mask % filter types: % ‘average’, default is 3x3 % ‘gaussian’, default is 3x3 and sigma=0.5 % ‘laplacian, default alpha=0.5 % ‘prewitt’, vertical gradient, default is 3x3. Get horizontal by wh=w’ % ‘sobel’, vertical gradient, default is 3x3 % ‘unsharp’, default is 3x3 with alpha=0.2

U SING MATLAB’ S BUILT - IN FILTERS >> f=imread('GWFig3_41.jpg'); %load in lunar north pole image >> w4=fspecial('laplacian',0) % creates 3x3 laplacian, alpha=0 [0:1] >> w8=[1 1 1;1 -8 1;1 1 1] % create a Laplacian that fspecial can’t >>f = im2double(f); % output same as input unit8 so % negative values are truncated. % Convert to double to keep negative values. >> g4=f-imfilter(f,w4,'replicate'); % filter using default values >> g8=f-imfilter(f,w8,'replicate'); % filter using default values >> imshow(f) % display original image >> figure, imshow(g4) % display g4 processed image >> figure, imshow(g8) % display g8 processed image