Simulation And Modeling Prepared by- Sabbir Muhammad Saleh Lecturer (00627) University of South Asia Mob- 01785547626 Mail- saleh.sabbir.aiub@gmail.com
Introduction to MATLAB Engineering H192 Winter 2005 Introduction to MATLAB Instructor notes: This is the first set of slides for Matlab in the H192 C/C++ programming course. It provides an overview of information that will be helpful in getting started working with Matlab and in the Matlab environment. Lecture 18
So why MATLAB and IMAGE PROCESSING ? Images So why MATLAB and IMAGE PROCESSING ? Images can be treated as matrices !
a = imread(‘picture.jpg’); imshow(a); Images Loading an image: a = imread(‘picture.jpg’); imshow(a);
Images Image (=matrix) size: size(a): 384 512 3 R G B 384 512
Images Color image: 3D Matrix of RGB planes
Images Show RED plane: a(:,:,2:3) = 0; imshow(a);
Images Show GREEN plane: a(:,:,[1 3]) = 0; imshow(a);
Images Show BLUE plane: a(:,:,1:2) = 0; imshow(a);
Advanced: Shuffling columns Images Advanced: Shuffling columns rn = rand(1,512); [rn1,i] = sort(rn); b = a(:,i,:); imshow(b);
Images
By the way… MATLAB can also handle Movies 3D objects …
MATLAB is a mighty tool to manipulate matrices Conclusion MATLAB is a mighty tool to manipulate matrices Images can be treated as matrices MATLAB is a mighty tool to manipulate images
MATLAB should be used to code software prototypes In my opinion… MATLAB should be used to code software prototypes Research is mostly about prototypes, not runtime-optimized software MATLAB should be used in research
Algorithm development time is drastically shorter in MATLAB In my opinion… MATLAB prototypes must be re-coded (e.g. in C++) if there’s need for speed Algorithm development time is drastically shorter in MATLAB
Image Algebra A+B (matrix addition) A-B Examples: http://www.ee.siue.edu/~cvip/CVIPtools_demos/mainframe.shtml Matlab program: algebraEx.m Quick Matlab overview Homework: Write a Matlab program that computes a complement image to a given gray level image A
Thank You