Sunteți pe pagina 1din 2

Article

Baisa L Gunjal* and Dr. Suresh N Mali**


* Assistant professor, Amrutvahini College of Engineering Sangamner, Anagar, MS
** Principal, Singhgad Institute of Technology and Science, Narhe, Pune, India

Image Processing with Matlab, Scilab,


and Octave
MATLAB, Scilab, and Octave are widely
used by engineers and scientists in both
industry and academia for performing
numerical
computations
and
for
developing and testing mathematical
algorithms and image processing with
related applications. It makes it very easy
to write mathematical programs quickly
and display data in a wide range of different
ways for various applications, research,
and development work. This article
focuses on practical approach for image
processing and mathematical computing
with Matlab, Scilab, and Octave.

Working with Matlab


The name MATLAB stands for MATrix
LABoratory. MATLAB is a high-performance
language for technical computing. It
integrates computation, visualization, and
programming environment. It is a modern
programming language environment with
sophisticated data structures, contains
built-in editing and debugging tools, and
supports object-oriented programming.
These factors make MATLAB an excellent
tool for teaching and research. MATLAB is a
script that runs main MATLAB executable on
Microsoft Windows platforms and provides
interactive system for solving technical
problems. MATLAB documentation is
mostly available online[1,4,5]. We can run
Matlab script on various platforms like
Windows, Macintosh, and Unix etc. Fig. 1 is
a snapshot of Matlab working environment.

Fig. 1: Working with Matlab environment

Matlab provides efficient way for all


image, audio, and video processing. Program
Listing 1 shows sample read and display of
image with noise addition and ltering. The
output of sample is depicted in Fig. 2.

Program Listing 1:
clc;
clear all;
clear all;
le_name='colorlina.jpg';
I=imread(le_name);
imshow(I);
title('Original Image');
J = imnoise(I,'salt & pepper', 0.02);
imshow(J);
title('Paper & Salt Noise');
% median ltering for remove salt
pepper noise
K = medlt2(J);
imshow(K);
title('Filtered Image');

Original Image

Pepper &
Salt Noise

and non-differentiable optimization;


ix] Signal processing, x] Statistics etc.
We can download Scilab from the scilab.
org website for windows, Linux, Mac
OS[3,8,9].
While performing operations on
images, the input images are saved in
current working directory. The current
working directory can be found by using
pwd at console.
As per requirement of application,
console or editor can be used while
working with Scilab. Sample plots are
shown in Program Listing 2 with console
operating and its output is shown in Fig. 3.

Program Listing 2 with Scilab Console

Filtered Image

Fig. 2: Output of program listing 1

The variety of applications developed


using Matlab can be found online[6].

Working with Scilab


Scilab is an open source freeware
software for numerical mathematics and
scientic visualization of plot 2D and
3D graphs and other graphic functions.
It is capable of interactive calculations
as well as automation of computations
through programming. Scilab supports
following
various
capabilities:
i] Linear algebra; ii] sparse matrices;
iii] Polynomials and rational functions;
iv]
Interpolation,
approximation;
v] Linear, quadratic, and nonlinear
optimization; vi] Ordinary Differential
Equation solver and Diffrential Algebraic
Equations solver; vii] Classic and
robust control, Linear Matrix Inequality
optimization;
viii]
Differentiable

Fig. 3: Output plots of program listing 2

The editor can be opened just by


typing editor at console. The working
with Scilab editor with sample Scilab
script is given in Program Listing 3. To
run Scilab script go to Execute option in
editor and select File with no echo. The
output of same is shown in Fig. 4.

CSI Communications | December 2012 | 19

Program Listing 3 with Scilab Editor

Distance with respect to Nasik


Now, we are in Sangamner
Good day!!!
- ->
Fig. 4: Output of program listing 3

Working with Octave

About the Authors

Octave is an open source interactive


software
system
for
numerical
computations and graphics. It is particularly
designed for matrix computations: solving
simultaneous
equations,
computing
eigenvectors and eigenvalues and statistics,
signal and image processing etc. In many
real-world engineering problems, the
data can be expressed as matrices and
vectors. Octave can be efficiently used
with windows and LINUX. Matlab is more
exible, advanced, powerful, and costly
but Octave is freeware. Octave texts are
mixed lower and uppercase. Octave is
case-sensitive. Octave makes it easy to
solve a wide range of numerical problems;
Octaves usefulness is enhanced by making
it compatible with MATLAB which is
commonly used in industry and academia.
C++ and other industry standard
programming languages are normally
designed for writing general purpose
software.
However,
solutions
to
mathematical problems take time to
program using C++, Octave is specially
designed to perform calculations and

display the results[7,10]. Steps of Octave


installation for Windows are given below:
1. Go to http://octave.sourceforge.net/
and click on Windows installer.
2. Install
the
downloaded
le:
Octave-3.2.4_i686-pc-mingw32_
gcc-4.4.0_setup.exe. and follow
messages displayed on screen
(Follow steps 1 through step 9.)
After completing installation go to start
then go to programs and select GNU
Octave. Now, Octave console environment
will be ready for use. Program Listing
4 depicts Octave console with sample
matrix operations and concern output.

Program Listing 4 with Octave


Console and its output
octave:1> a=[1 2 3; 4 5 6; 6 7 8; 9 10 11]
a=
1 2 3
4 5 6
6 7 8
9 10 11
octave:2> s=size(a)
s=
4 3
octave:3> b=rand(s)
b=
0.722364 0.909136 0.630090
0.676830 0.267017 0.065113
0.353159 0.825540 0.438571
0.135161 0.026703 0.463656
octave:4> size(b)
ans =
4 3
Here, Sample code for image read, write,
display is shown in Program Listing 5.

Program Listing 5: Image


read,write,display with Octave
I = imread ("my_input_image.img");
imwrite ("my_output_image.img", J);
imshow(I);
imshow(J);

Closing Remarks
Matlab, Scilab, and Octave are used by
developers, engineers, and scientists for

development in industries, academia, and


in research work. Matlab has plenty of
license toolboxes with numerous facilities
fullling requirements of industry and
academia. Scilab and Octave are open
source freewares used as alternate for
Matlab and used with Windows, Linux,
Macintosh etc. The programmer familiar
with Matlab can easily switch to Scilab
and Octave.

Acknowledgment
Thanks to Board of Colleges and University
Development (BCUD), University of
Pune for providing research grant for
research work for period 2010-2012. We
are also thankful to Amrutvahini College
of Engineering, Sangamner, Singhgad
Institute of Technology and Science, Pune,
and Padmashree Dr. D.Y. Patil Institute
of Engineering and Technology, Pune for
technical support during this research work.

References
[1] Gonzalez, R C, et al. (2009). "Digital
Image Processing Using MATLAB",
Prentice Hall.
[2] Magyar, Z et al. (2010). "Using
SciLab for building of virtual lab". 9th
International Conference on Information
Technology Based Higher Education and
Training (ITHET), 280-283.
[3] Ramachandran, H (2012). Image
and video processing toolbox in
Scilab. Computer Society of India
Communications (CSIC), 36(4), 20-22.
[4] The MathWorks, Inc., Getting Started
with MATLAB. http://www.mathworks.
com/access/helpdesk/help/techdoc/
learn_matlab/learn_matlab.shtml
[5] Weisstein, E World of Mathematics,
Prime Spiral, http://mathworld.wolfram.
com/PrimeSpiral.html
[6] en.pudn.com
[7] http://www.malinc.se/math/octave/
threeden.php
[8] http://www.scilab.org/platform
[9] http://spoken-tutorial.org/NMEICTIntro
[10] www.octave.org
n

Baisa L Gunjal is pursuing PhD in University of Pune and working in Amrutvahini College of Engineering Sangamner, Anagar, MS.
She has 14 years teaching experience and she is coordinator of seven postgraduate courses running in her college. She is also
working on research project funded by BCUD, University of Pune, and having more than 15 International publications including IEEE
Explorer, IET-UK libraries, CSIC etc. She is recipient of Lady Engineer Award-2012 from Institution of Engineers and Student branch
coordinator, Computer Society of India at AVCOE Sangamner.
Dr. Suresh N Mali has completed his PhD and presently working as Principal, Singhgad Institute of Technology and Science, Narhe,
Pune, India. He has written 3 technical books and published 25 papers in various national and international journals and conferences.
He is member of Board of Studies for Computer Engineering in various universities like University of Pune, Shivaji University,
Kolhapur, MS, India. He is a member of IEEE, life member of ISTE and his research interests are information security, data hiding,
signal processing, digital multimedia communications, and Steganography.

CSI Communications | December 2012 | 20

www.csi-india.org

S-ar putea să vă placă și