SIVP: SCILAB Image and Video Processing Toolbox

2 downloads 0 Views 268KB Size Report
DevOps - A Review 32. Practitioner Workbench. SIVP: SCILAB Image and. Video Processing Toolbox 37. Technical Trends. Parallelized Hadoop Video.






































ISSN 0970-647X

Volume No. 39 | Issue No. 6 | September 2015

IMAGE AND VIDE PROCESSING Cover Story Article Object Detection: A Key Component in Image & Video Processing 9

Cover Story Image Segmentation: From the Beginning to Current Trends 14



































DevOps - A Review 32

Practitioner Workbench SIVP: SCILAB Image and Video Processing Toolbox 37

Technical Trends Parallelized Hadoop Video Processing: Challenges and Applications 27 CSI Communications | September 2015 | 1

Practitioner Workbench

Shubhashree Savant (Kadam) Assistant Professor, MCA Dept., Marathwada Institute of Technology (Engineering), Aurangabad, Maharashtra

Programming.Tips() »

SIVP: SCILAB Image and Video Processing Toolbox Introduction Scilab is free and open source, user friendly, numerical and computational software. It is widely used in various streams of science and engineering for developing and testing mathematical algorithms and image processing applications. Scilab supports various functionalities like Aerospace, Data Analysis and Statistics, Graphics, Image Processing, Linear Algebra, Signal Processing etc. Scilab can be downloaded from the http://www.scilab.org . The SIVP is an Image and Video Processing toolbox, which can be downloaded from http://sivp.sourceforge. net website. It has various features like Image I/O (Supported formats: PNG, BMP, JPEG, TIFF, PBM, PGM, PPM, SR), Video I/O, Spatial transformation functions, image arithmetic functions, image analysis and statistical functions, morphological operations, and color space conversions. Digital Images Images stored in digital forms. A digital image is a representation of a 2-D finite set of digital values, called picture elements or pixels. Images can be Grayscale or Color (RGB), specified as a matrix of size MxNx3 (MxN for grayscale)[1], where M is number of rows, N is number of columns and 3 is number of channels. And for gray image number of channel is 1

Converting color image to grayscale image

size() gives rows and columns of an image.

im = imread(‘lena.jpg’); img = rgb2gray(im); imshow(img);

Resizing image

rgb2gray() converts color image to gray image. Dimension of color (RGB) image should be MxNx3 and dimension of output image (gray) is MxN.









2

!

3

1

)

.

$

4

)

-

#



(

)



#

Converting color/grayscale image to binary image im = imread(‘lena.jpg’); imbw = im2bw(im,0.5); imshow(imbw);

Imb: 1.5 

!

+



$

,

-

)

.



&





(

"

#

$



%



&



'

(

)



#

im = imread(‘lena.jpg’); subim = imcrop(im, [50, 50, 100, 100]); imshow(subim); 





/

!

0



&

)

1

.



(

)



imcrop() crops the input image with coordinates 50,50 – top left corners and 100,100 – width and height

#

im = imread(‘lena.jpg’); img = rgb2gray(im); imwrite(img,‘lenagray.jpg’);

Knowing size of image in pixels

*

!

Crop an image

imwrite() is used to create a image file after making any changes in original image file. Above command will create a new image file ‘lenagray.jpg’ in current directory.





Writing an image

imread() will read the image into im variable i.e. matrix and imshow() will display image using im variable.





imresize() is used to change the size of image in the given scale like 0.5 or 1.5

Reading and displaying image





im2bw() converts color / grayscale image to binary image.





Ima: 0.5

Original Image

Working with Scilab Sample images used in all examples are available in default directory (To check default directory use pwd command). If images are stored other than default directory then use full image file path. im = imread(‘lena.jpg’); imshow(im);

im = imread(‘lena.jpg’); ima = imresize(im, 0.5); imb=imresize(im, 1.5); imshow(ima); imshow(imb);

)



#

im = imread(‘lena.jpg’); [M,N] = size(im) M=225 and N=225









5

!

6

1

7

,

,

#

8



(

)



#

Negative of an image im = imread(‘lena.jpg’); imc = imcomplement(im); imshow(imc); CSI Communications | September 2015 | 37

imcomplement() makes the negative of an input image. Dark pixel becomes lighter and light pixel become darker.

imshow(im); imshow(I2); imshow(I3); imshow(I4);

Edge Detection: Edge detection is used to detect edges of objects in an image.

flipdim() flips the img components along the dimension number i.e. 1 or 2

im = imread(‘lena.jpg’); img = rgb2gray(im); imshow(img); e1 = edge(img,’sobel’); imshow(e1)









B

!

:

#



Ɵ

)

#

'

(

)



e2 = edge(img,’canny’); imshow(e2)

#

;

Original Image

Horizontal flip

Vertical flip

Horizontal Vertical flip

This can also be done with simple program as follows: Program: Negative of an image Im = imread(‘rice.jpg’); imshow(im); [m,n]=size(im); for i=1:m-1 for j=1:n-1 imn(i,j)=256-1-im(i,j); end; end; imshow(imn);

Gray Image














$

?

7



1

)

(

imhist() computes histogram of given image im, scf is set the current graphic figure (window)







*

@

!

A

canny operator 8



#

8

#

?

#

4

Ɵ

7

&

edge() function performs edge detection on a grayscale image and detect edges in an image using different operators. Scilab-5.5.0 is used for all above examples. References [1] Rafael C Gonzalez, Richard E Woods “Digital Image Processing”, Pearson, Third Edition. [2] Ramachandran, H “Image and video processing toolbox in Scilab”, CSI Communications (2012). [3] http://www.scilab.org/ platform [4] http://sivp.sourceforge.net/ sivpdoc-2006.en.pdf [5] http://scilab.in/spoken-tutorial n

Ms. Shubhashree Savant (Kadam) [CSI– I0155080] is Assistant Professor in MCA Dept. at Marathwada Institute of Technology (Engineering), Aurangabad, Maharashtra. She is pursuing Ph.D in Dr. Babasaheb Ambedkar Marathwada University, Aurangabad. Her area of interest includes Image Processing, Database Management Systems, Cryptography and Steganography. She can be reached at [email protected]

CSI Communications | September 2015 | 38

www.csi-india.org