Top Banner

of 12

Image Processing Introduction Matlab

Jan 14, 2016

Download

Documents

Image Processing Introduction in Matlab
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Introduction to Image Processing

Introduction to Image Processing

What is Image Data?In the MATLAB workspace, most images are represented as two-dimensional arrays (matrices), in which each element of the matrix corresponds to a single pixel in the displayed image. For example, an image composed of 200 rows and 300 columns of different colour dots stored as a 200-by-300 matrix. Some images, such as RGB, require a three-dimensional array, where the first plane in the third dimension represents the red pixel intensities, the second plane represents the green pixel intensities, and the third plane represents the blue pixel intensities .

What is the Image Processing Toolbox?The Image Processing Toolbox is a collection of functions that extend the capabilities of the MATLABs numeric computing environment. The toolbox supports a wide range of image processing operations, including: Geometric operations Neighborhood and block operations Linear filtering and filter design Transforms Image analysis and enhancement Binary image operations Region of interest operations

33Images in MATLABMATLAB can import/export several image formats:BMP (Microsoft Windows Bitmap)GIF (Graphics Interchange Files)HDF (Hierarchical Data Format)JPEG (Joint Photographic Experts Group)PCX (Paintbrush)PNG (Portable Network Graphics)TIFF (Tagged Image File Format)XWD (X Window Dump)raw-data and other types of image data

Data types in MATLABDouble (64-bit double-precision floating point)Single (32-bit single-precision floating point)Int32 (32-bit signed integer)Int16 (16-bit signed integer)Int8 (8-bit signed integer)Uint32 (32-bit unsigned integer)Uint16 (16-bit unsigned integer)Uint8 (8-bit unsigned integer)

44

Images in MATLAB Binary images : {0,1} Intensity images : [0,1] or uint8, double etc. RGB images : m n 3 Multidimensional images: m n p (p is the number of layers)

55Image Import Read and write images in Matlabimg = imread('apple.jpg');dim = size(img);figure;imshow(img);

66The imagesc function scales image data to the full range of the current colormap and displays the image.imtool opens a new Image Tool in an empty state. imtool(I) displays the grayscale image I.image(C) displays matrix C as an image.Images and Matrices

Column 1 to 256Row 1 to 256o[0, 0]o[256, 256]How to build a matrix(or image)?Intensity Image:

row = 256;col = 256;img = zeros(row, col);img(100:105, :) = 0.5;img(:, 100:105) = 1;figure;imshow(img);

77Images and MatricesBinary Image:

row = 256;col = 256;img = rand(row, col);img = round(img);figure;imshow(img);

8Image Displayimage - create and display image objectimagesc - scale and display as imageimshow - display imagecolorbar - display colorbargetimage - get image data from axestruesize - adjust display size of imagezoom - zoom in and zoom out of 2D plot

99Image OperationsRGB image to gray imageImage resizeImage cropImage rotate

1010Image Conversiongray2ind - intensity image to index imageim2bw - image to binaryim2double - image to double precisionim2uint8 - image to 8-bit unsigned integersim2uint16 - image to 16-bit unsigned integersind2gray - indexed image to intensity imagemat2gray - matrix to intensity imagergb2gray - RGB image to grayscalergb2ind - RGB image to indexed image

1111THANK YOU