Acrobat PDF

Exercise 1 Introduction to Image Processing and Analysis in ...

You must be logged in to download this document
Reviews
Shared by: gregorio11
Stats
views:
90
rating:
not rated
reviews:
0
posted:
11/21/2008
language:
English
pages:
0
Exercise 1: Introduction to Image Processing and Analysis in Matlab Welcome to the first exercise lecture lab. The first part will be an introduction to Matlab in general and the second part will be to do image processing and analysis using Matlab. Part 1. Introduction to Matlab Matlab is an abbreviation of Matrix Laboratory. It is a popular mathematical programming environment and it is used extensively in education as well as in industry. It is a high-level matrix/array language and has a vast collection of computational algorithms. Code developed in Matlab can be converted into C, C++ and other languages. You can get help on any Matlab function by typing help or you could use the help browser. You can use the Help browser to search and view documentation and demonstrations for MATLAB functions. To open the Help browser, click the Help button in the desktop toolbar, type helpbrowser in the Command Window, or use the Help menu in any tool. There are two panes: The Help Navigator, on the left, for finding information, includes Contents, Index, Search, and Demos tabs. The display pane, on the right, is for viewing documentation and demos. Exercise 1 Start MATLAB and use the help function to learn more about the following commands: Whos Help Clear Close all Cd Dir Pwd lookfor The student lecturer will explain some basic MATLAB tasks: Matrix Declaration: Simple Declaration Null Matrix Matrix with Ones Matrix Arithmetic: Addition Subtraction Multiplication Division Matrix Manipulation: Addressing of individual element Complete Row Addressing Complete Column Addressing Transpose Saving and Loading Data Concept of Function and m-Files Part 2. Introduction to image processing and analysis in Matlab Exercise 2 Use the help browser and search to find out how to threshold an image with Otsu’s method. Read the image coins.png by using the command: I=imread('coins.png'); and show the image by using imagesc(I). What is the difference between the functions imshow and imagesc? Then use Otsu’s threshold method on this image and display the result. Which threshold value was used? Is it perfect? Display the histogram of the image by typing imhist(I). Look at the histogram and suggest a better threshold. Threshold the image I with the suggested threshold by typing: I2=(I>New_Threshold imagesc) and display the result. Did it improve? What is the difference between the functions imshow and imagesc? Write the result image I2 to file by typing: imwrite(I2, 'coinbw.png'); Exercise 3 In MATLAB there are four types of images. Black & White images are called binary images, containing 1 for white and 0 for black. Grey scale images are called intensity images, containing numbers e.g. in the range of 0 to 255. Coloured images may be represented as RGB Images. In RGB Images there exist three indexed images. First image contains all the red portion of the image, second green and third contains the blue portion. So for a 640 x 480 sized image the matrix will be 640 x 480 x 3. An alternate method of coloured image representation is Indexed image. It actually exist of two matrices namely image matrix and a map matrix. Each colour in the image is given an index number and in image matrix each colour is represented as an index number. The map matrix contains the database of which index number belongs to which colour. Read the labelled colour image X by: load flujet Convert the image X to rgb: im_rgb = ind2rgb(X,map); Convert the rgb image to grey-scale: im_grey = (im_rgb(:,:,1)+im_rgb(:,:,2)+im_rgb(:,:,3))/3; Look at the result. Exercise 4 Write a Matlab function mytest.m. This means your file will be called mytest.m and shall contain a function mytest. In future you will find it easier to manage larger projects if you keep all the code in a single file. The specifications of the function are: function mytest; % This function – % - loads an image, % - displays the image and its intensity histogram, % - converts the image to binary via a threshold % - displays the binary image % - detect the edges % - displays the edge image Exercise 4 Read the Image Processing Toolbox User's Guide !! Useful web pages: MATLAB tutorials: http://www.math.siu.edu/matlab/tutorials.html Mathworks: http://www.mathworks.com/academia/student_center/tutorials/ http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html

Related docs
What Is the Image Processing Toolbox
Views: 64  |  Downloads: 8
Introduction to Digital Image Analysis
Views: 78  |  Downloads: 14
1 Introduction
Views: 0  |  Downloads: 0
1 Introduction
Views: 0  |  Downloads: 0
Image
Views: 12  |  Downloads: 0
premium docs
Other docs by gregorio11