1 / 11

Matlab Lecture 1

Matlab Lecture 1. Basic Concepts of Digital Image Processing. Image processing Basic Concept. IP Basic Concepts

clarke
Download Presentation

Matlab Lecture 1

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. Matlab Lecture 1 Basic Concepts of Digital Image Processing

  2. Image processing Basic Concept • IP Basic Concepts • In this lecture we will introduce some basic image processing concepts, including reading and showing image, performing some image enhancement operations on images, and getting information about an image. • Step 1: Read and Display an Image • Step 2: Check How the Image Appears in the Workspace • Step 3: Image Sampling (Resizing Image) • Step 4: Image Quantization (Gray Level Reduction) • Step 5: Converting RGB image into grayscale intensity image.

  3. Step 1: Read and Display anImage • To Clear Matlab workspace, variables, and figure windows. >> close all • To read an image, use the imread command. • In the example below reads one of the sample images included with IPT, pout.tif, and stores it in an array named I. Example : >> I = imread('pout.tif'); • To display the image, Use the imshow command >> imshow(I)

  4. Step 2: Check How the Image Appearsin the Workspace • The Workspace browser displays information about all the variables you create during a MATLAB session. The imread function returned the image data in the variable I, which is a 291-by-240 element array of uint8 data. MATLAB can store images as uint8, uint16, or double arrays. • You can also get information about variables in the workspace by calling the whos command. >>whos Name Size Bytes Class I 291x240 69840 uint8 array

  5. Step3: Image SamplingMatlab: imresize • Resize an image • To change the size of an image, use the imresize function. • Using imresize, you can specify the size of the output image, specify the interpolation method used, and specify the filter to use to prevent aliasing. • Resize Syntax: • B = imresize(A,m) • B = imresize(A,m,method) • B = imresize(A,[mrowsncols],method) • B = imresize(...,method,n) • B = imresize(...,method,h)

  6. Description of imresize • B = imresize(A,m) returns an image B that is m times the size of A, using nearest-neighbor interpolation. • B = imresize(A,m,method) returns an image that is m times the size of A using the interpolation method specified by method. • B = imresize(A,[mrowsncols],method) returns an image of the size specified by [mrowsncols]. When the specified output size is smaller than the size of the input image, and method is 'bilinear' or 'bicubic', applies lowpass aliasing.

  7. Example: Sampling (example of resize)

  8. Step 4: Image Quantization (Gray Level Reduction) • The quantization used to reduce the number of gray levels. • Reducing the number of gray levels using the floor function. • Floor function is used in the following sytax: • X = floor(y/2)*2; • It is used to reduce the gray levels in an image. • You can divide many times according to the given gray level to see how the image is resulting from reducing the gray levels as in the following figure:

  9. Image Quantization example

  10. Converting Image Types

  11. Step 5: Converting RGB image into grayscale intensity image. • rgb2gray • Converts RGB image to grayscale. • Syntax • I = rgb2gray(RGB) • Description • I = rgb2gray(RGB) converts the truecolor image RGB to the grayscale intensity image I.

More Related