1 / 28

Digital Image Processing & Pattern Analysis (CSCE 563) Fundamentals

Digital Image Processing & Pattern Analysis (CSCE 563) Fundamentals. Prof. Amr Goneid. Department of Computer Science & Engineering The American University in Cairo. Image Acquisition & Display. Image Models Sampling & Quantization Storage Media Image Formats Representation in MATLAB

ritchies
Télécharger la présentation

Digital Image Processing & Pattern Analysis (CSCE 563) Fundamentals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Image Processing&Pattern Analysis (CSCE 563) Fundamentals Prof. Amr Goneid Department of Computer Science & Engineering The American University in Cairo

  2. Image Acquisition & Display • Image Models • Sampling & Quantization • Storage Media • Image Formats • Representation in MATLAB • Loading, Saving and Display • Types of Image Operations • Types of Neighborhoods Prof. Amr Goneid, AUC

  3. Real Image Model A 2-D Signal with amplitude a(x,y) representing light intensity or color at real position (x,y). Amplitude is normally a real number or an integer number. An image may contain a Region of Interest (ROI) (i.e. a sub-image) Signal y ROI a(x,y) x Prof. Amr Goneid, AUC

  4. Digital Image Model An acquisition device converts a real (analog) image a(x,y) into a digital image. Sampling and quantization comprise the digitization process. The output is a matrix f(i,j) of pixels with n rows and m columns. a(x,y) Sampling & Quantization f(i,j) Prof. Amr Goneid, AUC

  5. Image Acquisition:Sampling & Quantization • Sampling Sample at x,y = one pixel at f(i,j) y y x S(x,y) = average Intensity over the area x y Sampling Rate affects image size x Prof. Amr Goneid, AUC

  6. Sampling: Spatial Resolution Low Resolution High Resolution Prof. Amr Goneid, AUC

  7. Sampling & Quantization • Quantization Digital Image f(x,y) Fk+1 f11 f12 … f1m f21 f22 … f2m S(x,y) Fk y fij Fk-1 x Pixel value fn1 fn2 … fnm Prof. Amr Goneid, AUC

  8. Quantization: Color Resolution 16 Colors 256 colors Quantization scale determines number of bits per pixel Prof. Amr Goneid, AUC

  9. Image Storage Media • Magnetic & Video Tapes • Magnetic Disks • Optical Disks ( CD ) Prof. Amr Goneid, AUC

  10. Storage Requirements • Image Size: n x m pixels • n , m depend on sampling rate • B = no. of bits to represent a pixel • L = no. of Quantization levels (gray levels or colors) = 2B • Storage size = n m B/8 bytes • e.g. for 128 x 128 pixels with 256 colors the size is 16 kbytes • When B = 1 we have a Binary Image (Black & White) Prof. Amr Goneid, AUC

  11. Image Formats • Graphics Interchange Format ( .GIF) • Tagged Image File Format (.TIFF) • Bit Map Format (.BMP) • ISO Standard Format (.JPEG , .JPG , .JPE) • Other Formats ( .PCX , .CGI , .PNG, etc) • Viewers ( Image Viewing S/W) Prof. Amr Goneid, AUC

  12. Image Formats 302 Kb (BMP) 80 Kb (jpg) Prof. Amr Goneid, AUC

  13. Representation in MATLAB • Intensity Images (Gray Scale) • Indexed Images • RGB Images • Binary Images • Conversion between Formats • Loading & Saving Images • Displaying Images in MATLAB Prof. Amr Goneid, AUC

  14. Intensity Images • Used for Gray Scale images • One matrix I = f(n,m) • Each pixel f(i,j) is a real number (r) with 0 =< r <= 1 ( 0 : black; 1 : white) Prof. Amr Goneid, AUC

  15. Indexed Images Prof. Amr Goneid, AUC

  16. Indexed Images • For color (and gray scale images) • Uses a color map and a matrix X = f(n,m) with a pixel value f(i,j) = index to the map , • map is (m x 3) array, m = no. of colors • e.g. f(i,j) = 23 G R B 23 0.3 0.1 0.2 Color Map Prof. Amr Goneid, AUC

  17. RGB Images • For color images.Uses 3 matrices : R(n,m) , G(n,m) , B(n,m) • R(i,j) is the red color intensity, etc. RGB R G B Prof. Amr Goneid, AUC

  18. RGB Planes A pixel at (i,j) in an RGB image has components: R(i,j) , G(i,j) , B(i,j) In MATLAB, it is possible to extract the 3 components: If F is an RGB image, FR = F(: , : , 1); FG = F(: , : , 2); FB = F(: , : , 3); B G R Summer 2008 Prof. Amr Goneid, AUC Prof. Amr Goneid, AUC 18

  19. Binary Images • For Black and White images • One matrix B = f(n,m) where a pixel value is f(i,j) = 0 or 1 Prof. Amr Goneid, AUC

  20. Conversion between Formats im2bw ind2rgb Indexed gray2ind rgb2ind RGB Binary gray2ind ind2gray rgb2gray im2bw edge Intensity Prof. Amr Goneid, AUC

  21. Loading & Saving Images • MATLAB reads disk formats and converts to pixel matrices • e.g. for BMP files: [X,map] = imread(‘filename.bmp’) imwrite(X,map,’filename.bmp’) • Some of the types supported: BMP JPG GIF TIFF PCX • Matrix format can be saved on disk: save filenameX map • Matrix format files can be loaded from disk: load filename Prof. Amr Goneid, AUC

  22. Displaying Images in MATLAB • Indexed Images: imshow(X,map) • Intensity Images: imshow(I) • RGB Images: imshow(RGB_image) • Binary Images: imshow(BW) , imshow(~BW) Prof. Amr Goneid, AUC

  23. Example1input color image, output red image [X,map] = imread(‘eaglec.bmp’); % Read eaglec.bmp from disk [n,m] = size(X); % Image size save eaglec X map; % Save in matrix form _________________________________________________ load eaglec; % Load matrix form imshow(X,map); % Display image [L , C] = size(map); % L rows by 3 columns map(: , 2) = zeros(L , 1); % zero green map(: , 3) = zeros(L , 1); % zero blue % now the map contains only red imwrite( X , map , ‘eagler.bmp) % write red image Prof. Amr Goneid, AUC

  24. Example2Convert to Intensity and Binary Images load eaglec; % Load matrix form imshow(X,map); % Display image I = ind2gray(X,map); % Convert to gray imshow(I); % Display BW = im2bw(I); % Convert to binary imshow(BW); % Display imshow(~BW); % Display negative Prof. Amr Goneid, AUC

  25. Types of Image Operations(ref: http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip.html ) The types of operations that can be applied to digital images to transform an input image f [m,n] into an output image f’[m,n] can be classified into three categories as shown in the Table. Prof. Amr Goneid, AUC

  26. Types of Image Operations(ref: http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip.html ) Prof. Amr Goneid, AUC

  27. Neighborhood Prof. Amr Goneid, AUC

  28. Types of Neighborhoods 4-connected 8-connected 6-connected Rectangular Hexagonal Prof. Amr Goneid, AUC

More Related