Image Processing Using Scilab

Embed Size (px)

Citation preview

  • 8/18/2019 Image Processing Using Scilab

    1/23

    IMAGE PROCESSING

    USING SCILABRajesh B. Raut

     Associate Professor, Dept. of E&C

    Shri Ramdeobaba K.N. Engg. College, Nagpur

    [email protected]

  • 8/18/2019 Image Processing Using Scilab

    2/23

    INSTALLING SIVP TOOLBOX

    Toolboxes:

    SIP (Scilab Image Processing), SIVP (Scilab

    Image & Video Processing)

    Tool we discuss: SIVPInstallation in Windows :

     (XP sp3 onwards. Windows 7 is recommended)-

    SIVP through atoms (5.3 onwards)

      atomsInstall SIVP

  • 8/18/2019 Image Processing Using Scilab

    3/23

    INSTALLING SIVP……

     After atomsInstall SIVP, do the proxy settings

    Usehelp proxycommand to see the proxy

    settings

    Eg.atomsSetConfig (useProxy, “True/False”)

    atomsSetConfig (ProxyHost, “DNS/IP Address”)

    atomsSetConfig (ProxyPort, “Port Address”)

     

    Set the user name & password for proxy, if any.

  • 8/18/2019 Image Processing Using Scilab

    4/23

    DIGITAL IMAGE

    Image is a 2D matrix

    can be:

    Gray scale (M x N, M- rows and N-columns)Color image (M x N x 3)

  • 8/18/2019 Image Processing Using Scilab

    5/23

    BASIC FUNCTIONS:

    IMREAD/IMSHOW/IMWRITE

    imread

    output image=imread(‘input image’)

    imshowimshow(output image)

    imwrite

    output=imwrite(input image, ‘output image

    name’)

  • 8/18/2019 Image Processing Using Scilab

    6/23

    INFORMATION OF THE IMAGE

    imfinfo- Get the information about image file

    info =imfinfo(filename)

    Eg: info=imfinfo(‘baboon.png’)

    returns the information: filename filesize, width,

    height bitdepth, etc.

     fileinfo- also provides the information about

    image file

  • 8/18/2019 Image Processing Using Scilab

    7/23

    SCILAB SUPPORTING THE

    DATATYPES

    int8

    int16

    int32

    uint8uint16

    double

  • 8/18/2019 Image Processing Using Scilab

    8/23

    DATATYPE CONVERSION

    im2int8- Convert image to 8-bit signed integers

    im2int16

    im2int32

    im2uint8im2uint16

    im2double 

    u- unsigned

    double - double precision

  • 8/18/2019 Image Processing Using Scilab

    9/23

    IMAGE TYPE & ITS CONVERSION IN

    SCILAB

    rgb2gray

     Im2bw

    ind2rgb

    rgb2hsvhsv2rgb

    rgb2ycbcr

     ycbcr2rgb

    eg.

    bwlena=im2bw(‘lena.bmp’, 0.5)

    0.5 (threshold) : specify threshold in the range [0,1], regardless of the class of

    the input image.

  • 8/18/2019 Image Processing Using Scilab

    10/23

  • 8/18/2019 Image Processing Using Scilab

    11/23

    RESULTS: COMPLEMENT

    Original Complement

  • 8/18/2019 Image Processing Using Scilab

    12/23

    RESULTS: CROP

    lenacrop =imcrop(lena [200, 200, 200, 200]);

    Original Cropped

  • 8/18/2019 Image Processing Using Scilab

    13/23

    RESULTS: RESIZE

    Original Resized by 2

  • 8/18/2019 Image Processing Using Scilab

    14/23

    OTHER MOSTLY USED FUNCTIONS

    imadd: Add two images or add a constant to an

    image

    imsubtract

    imdivide Imabsdiff

    mean2: Average or mean of matrix elements

     std2:Standard deviation of 2D matrix elements

    2- 2D matrix elements

  • 8/18/2019 Image Processing Using Scilab

    15/23

    OTHER IMPORTANT FUNCTION

    imhist

    [counts, cells] =imhist(im)

    [counts, cells] =imhist(im, bins)

    Counts- the returned histogram.

    Cells- the intervals for bins.

    Bins- The number of bins of the histogram.

    If bins is not specified, default value will be used by the function

    & is determined by the image type:

    2 for Boolean, 2̂8 for uint8 and int8, 2̂16 for uint16 and

    int16, 2̂16 for int32, and 10 for double.

  • 8/18/2019 Image Processing Using Scilab

    16/23

    COLOR IMAGE HISTOGRAM

    manifests an important global statistics of digital

    images

    Function available for histogram of gray images,

    it can be applied directly for color images as a

    combination of 3 independent gray images in

    terms of R, G and B.

    It can not incorporate the correlation between R,

    G and B channels.

    Solution: table structure (colors and their

    population)

  • 8/18/2019 Image Processing Using Scilab

    17/23

    NOISE FUNCTIONS

    TypesGaussian- additive noise

    Salt & Pepper- black/white noise

    Speckle- multiplicative noise

    Localvar- Pixel-specific variance (Zero-mean Gaussian)

    Function:imnoise

    Outputimage=imnoise(inputimage, ‘noisetype)e.g. lenaNoised=imnoise(lena,’gaussian’)

  • 8/18/2019 Image Processing Using Scilab

    18/23

    IMAGES WITH VARIOUS TYPES OF

    NOISE

    Original

    Salt & pepper Gaussian Speckle

  • 8/18/2019 Image Processing Using Scilab

    19/23

    IMAGE FILTERING USING

    ‘FSPECIAL’

    High Pass filter- used forsobel

    prewitt

    laplacian

    F = fspecial(sobel);

    Low Pass filter- used for blurringgaussian

    Log

    average

  • 8/18/2019 Image Processing Using Scilab

    20/23

    HIGH PASS FILTERING &

    THRESHOLDING- EDGE DETECTION

    Kernel used-Sobel

    Prewitt

    Log

    canny

  • 8/18/2019 Image Processing Using Scilab

    21/23

    TOPICS TO BE EXPLORED

    FFT

    Wavelets

    Radon Transform

    Hough Transform

  • 8/18/2019 Image Processing Using Scilab

    22/23

    TO CONCLUDE….

    Scilab/SIVP is a very powerful numerical

    computational tool, it also has number of ready-

    to-use functions for processing an image/2D

    matrix elements and hence Image Processing

    operation can be performed with equal ease onScilab.

  • 8/18/2019 Image Processing Using Scilab

    23/23

    for any help on IP using SIVP, pl. feel free to contact:

    [email protected]