Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Maulana Mukhtar Ahmad Nadvi Technical Campus, Mansoora Malegaon

Department of Electronics and Telecommunication Engineering

Experiment No. : 01

Aim: Introduction to Image Processing Toolbox (MATLAB)

Learning Objectives:
1. To familiar about Image processing software.
2. To study different features of DIP tools.

Equipments Required:
1. MATLAB
2. SCI LAB
Theory:

1) MATLAB:

MATLAB stands for Matrix Laboratory. It is a high-performance language that is


used for technical computing. It was developed by Cleve Molar of the company
MathWorks.Inc in the year 1984.It is written in C, C++, Java. It allows matrix
manipulations, plotting of functions, and implementation of algorithms and creation
of user interfaces.

 Getting started with MATLAB:

It is both a programming language as well as a programming environment. It allows


the computation of statements in the command window itself.

1) Command Window:

In this window one must type and immediately execute the statements, as it requires
quick prototyping. These statements cannot be saved. Thus, this is can be used for
small, easily executable programs.

2) Editor (Script):

In this window one can execute larger programs with multiple statements, and
complex functions These can be saved and are done with the file extension „.m „

3) Workspace:

In this window the values of the variables that are created in the course of the program
(in the editor) are displayed.
This window displays the exact location(path) of the program file being created.
MATLAB Library comes with a set of many inbuilt functions. These functions mostly
perform mathematical operations like sine, cosine and tangent. They perform more
complex functions too like finding the inverse and determinant of a matrix, cross
product and dot product

Although MATLAB is encoded in C, C++ and Java, it is a lot easier to implement


than these three languages. For example, unlike the other three, no header files need
1
Maulana Mukhtar Ahmad Nadvi Technical Campus, Mansoora Malegaon
Department of Electronics and Telecommunication Engineering

to be initialized in the beginning of the document and for declaring a variable, the data
type need not be provided. It provides an easier alternative for vector operations. They
can be performed using one command instead of multiple statements in a for or while
loop.
Some of the basic functions in MATLAB and their uses are listed below:

Function Description
disp() The values or the text printed within single quotes is
displayed on the output screen
clear To clear all variables
close all To close all graphics window
clc To clear the command window
exp(x) To compute the exponential value of x to the base e
abs(x) To compute the absolute value of x
sqrt(x) To compute the square root of x
log(x) To compute the logarithmic value of x to the base e
log10(x) To compute the logarithmic value of x to the base 10
rem(x, y) To compute the remainder of x/y
sin(x) To compute the sine of x
cos(x) To compute the cosine of x
tan(x) To compute the tangent of x
atan2(x, y) To compute the arctangent or inverse of y/x

Writing a MATLAB program:

Using Command Window:


Only one statement can be typed and executed at a time. It executes the statement
when the enter key is pressed. This is mostly used for simple calculations.
Note: ans is a default variable created by MATLAB that store the output of the given
computation.

Using Editor:
Multiple lines of code can be written here and only after pressing the run button (or
F5) will the code be executed. It is always a good practice to write clc, clear and close
all in the beginning of the program.
Note: Statements ending with a semicolon will not be displayed in the command
window; however, their values will be displayed in the workspace.
Any statement followed by % in MATLAB is considered as a comment

Vector Operations:
Operations such as addition, subtraction, multiplication and division can be done
using a single command instead of multiple loops

2
Maulana Mukhtar Ahmad Nadvi Technical Campus, Mansoora Malegaon
Department of Electronics and Telecommunication Engineering

2) SCILAB:

Scilab is a free, open-source numerical computation software that is similar to the


popular MATLAB. In this tutorial series, we shall see how we can use Scilab to
model and simulate concepts in electrical engineering one by one. This will help us to
understand concepts more clearly and also solve problems of greater complexity with
ease.

In this introductory tutorial we shall see the basics that are required to get started with
Scilab. Scilab can be downloaded freely from: http://www.scilab.org/

After it is downloaded and installed, this is how we are welcomed.

The region marked (1) is the file browser where we choose the folder where we would
want to work on, select files and save files. The region marked (2) is the Scilab
console or the command window. Here we can just type a command after the prompt
that looks like “-->” and the press enter/return to obtain the result of that command.
Take a look at the example below.

3
Maulana Mukhtar Ahmad Nadvi Technical Campus, Mansoora Malegaon
Department of Electronics and Telecommunication Engineering

4
Maulana Mukhtar Ahmad Nadvi Technical Campus, Mansoora Malegaon
Department of Electronics and Telecommunication Engineering

Here x and y are the variables. If the result of any operation is not assigned to a
specific variable, then the result is stored in a temporary variable named “ans”
meaning “answer”. So, where do we find all the variables that have been used at one
place? It‟s the variable browser which is marked (3). To clear the variable browser,
just type clear in the console and press enter or return. When your console looks
messy, just type clc in the console and press enter / return and it‟ll look fresh.

The region marked (4) is the command history. As the name suggests, it keeps a track
of all the commands executed.

It is not possible to save commands when we type them into the console window, nor
is the console window appropriate to run multiple commands. For this purpose we
have the editor window (also called SciNotes) where we can type the commands and
save it as a .sce file and then execute it. To open the editor window, go to the top left.

Conclusion: Thus we have studied about Digital Image Processing Tools like
MATLAB and SCILAB.

You might also like