Download presentation
Presentation is loading. Please wait.
Published byBeatrix Cannon Modified over 8 years ago
1
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
2
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Reading Images Images are read into the MATLAB enviroment using function imread whose syntax is >> imread(‘filename’) >>f=imread(chest-xray.tif);
3
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
4
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Function size gives the row and column dimentions of an image: >>size(f) >>[M, N]=size(f);
5
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Displaying Images Images are displayed on MATLAB desktop using function imshow, which has the basic syntax: >> imshow(f,G) where f is an image array, and G is the number of intensity level used to display it. If G is omitted, it defaults to 256 levels. The syntax form of interest here is >> pixval Which shows the cursor on the last image displayed
6
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
7
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
8
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Writing Images Images are written to disc using function imwrite, which has the following basic syntax: imwrite(f,’filename’) >>imwrite(f, ‘patient10’, ‘tif’) or, alternatively, >>imwrite(f, ‘patient10.tif’)
9
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® The imwrite function can have other parameters, depending on the file format selected. A more general imwrite syntax applicable only to JPEG images is >>imwrite(f, ‘filename.jpg’, ‘quality’, q) Where q is an integer between 0 and 100 ( the lower the number the higher the degradation due to JPEG compression). >>imwrite(f, ‘bubbles25.jpg’, quality,25)
10
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
11
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Where filename is the complete file name of the image stored in disk. For example, >>imfinfo bubbles25.jpg ans = Filename: 'bubbles25.jpg' FileModDate: '13-Oct-2008 22:22:23' FileSize: 13354 Format: 'jpg' FormatVersion: '' Width: 720 Height: 688 BitDepth: 8 ColorType: 'grayscale' FormatSignature: '' Comment: {}
12
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
13
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
14
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Converting between Data Classes and Image Types Converting between Data Classes and Image Types
15
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2: Fundamentals
16
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ®
17
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
18
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
19
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
20
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
21
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
22
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
23
www.imageprocessingbook.com © 2004 R. C. Gonzalez, R. E. Woods, and S. L. Eddins Digital Image Processing Using MATLAB ® Chapter 2 Fundamentals Chapter 2 Fundamentals
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.