Compte Rendu

Suite à quelques difficultés pour faire ce TP ce matin, j'ai constaté que la configuration de l'installation des logiciels chez moi permettait d'aller plus loin.

     ___________________________________________        
                      scilab-5.1
               Consortium Scilab (DIGITEO)
             Copyright (c) 1989-2009 (INRIA)
             Copyright (c) 1989-2007 (ENPC)
      ___________________________________________        
 
 
Initialisation:
  Chargement de l'environnement de travail
 SIVP - Scilab Image and Video Processing Toolbox 0.5.0
Bibliothèque partagée chargée.
Link done.

-->

/home/suitable/Documents
-->im2 = imread('bois.jpg');
 
-->imshow(im2);

  1. →[count, cells]=imhist(im2);
  2. →imshow counts

!–error 10000

Data type string is not supported.
at line      22 of function im2uint8 called by :  
line    23 of function imshow called by :  
imshow counts
 
 
-->imshow(counts);
         !--error 4 
Variable non définie: counts


  
-->boisbruit = imnoise(im2, 'speckle', .001);
 !--error 4 
Variable non définie: d

at line     111 of function imnoise called by :  
boisbruit = imnoise(im2, 'speckle', .001);-->imshow counts
 !--error 10000 
Data type string is not supported.
at line      22 of function im2uint8 called by :  
line    23 of function imshow called by :  
imshow counts
 
 
-->imshow(counts);
         !--error 4 
Variable non définie: counts
   
-->boisbruit = imnoise(im2, 'speckle', .001);
!--error 4 
Variable non définie: d

at line     111 of function imnoise called by :  
boisbruit = imnoise(im2, 'speckle', .001);-->boisbruit = imnoise(im2, 'speckle', ,001);
 -->imshow(boisbruit);
 
-->ret = imwrite(boisbruit, 'boisbruit.jpg');

 
-->ret
 ret  =
 
    1.  -->h1 = h1/9
 h1  =
 
    0.1111111    0.1111111    0.1111111  
    0.1111111    0.1111111    0.1111111  
    0.1111111    0.1111111    0.1111111  
 
-->res = imfilter(im2, h1);
 
-->imshow( res)
 
-->imwrite(res, 'bois3x3.jpg');
 

  1. →h2=ones(9,9)/81

h2 =

 
 
         column 1 to 5
 
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457    0.0123457  
 
         column 6 to 9
 
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
    0.0123457    0.0123457    0.0123457    0.0123457  
 
-->res2 = imfilter(im2, h2);
 
-->imshow(res2);
 
-->imwrite(res2, 'bois9x9.jpg')
 ans  =
 
    1.  
    

—-

    help file extract :
    Name
imnoise — Add noise (gaussian, etc.) to an image
Calling Sequence
imn = imnoise(im, type [,parameters])

Parameters
im
Input image.
type
String having one of these values:
'salt & pepper'
drop-out/On-off noise
'speckle'
multiplicative noise
'gaussian'
Gaussian white/additive noise
'localvar'
Pixel-specific variance (Zero-mean Gaussian)
'poisson'
Not yet implemented
parameters
A sequence of parameters to control the noise distribution, depending on the chosen type. If   omitted, default values are used (see below).
imn
Noisy image, which has the same size and type as input image im.

Description
imnoise(im, type [, parameters]) adds a type of noise to the intensity image im.       Optionally,   you can control the noise parameters starting at the 3rd. Argument to imnoise.     Here are example of noise types and their parameterss:

imn = imnoise(im,'salt & pepper',d) adds drop-out noise, where d is the noise density (probability of swapping a pixel). (default: d=0.05). imn = imnoise(im,'gaussian',m,v) adds Gaussian additive noise of mean m and variance v. (default: m=0 and v=0.01) im = imnoise(im,'localvar',V) additive zero-mean Gaussian noise where the variance at im(i,j) is V(i,j). imn = imnoise(im,'localvar', intensity, V) additive zero-mean Gaussian noise, and the local variance of the noise, var, is a function of the image intensity values in im. The variance is matrix( interp1(intensity(:),V(:),im(:)), size(im) ) imn = imnoise(im,'speckle',v) adds multiplicative noise, using imn = im + noise*im, where noise is uniformly distributed with mean 0 and variance v. (default: v=0.04) By default, we consider that “1” corresponds to the maximum intensity value of the image, and “0” to minimum. If the input image im is an integer image, it will be converted to double using im2double function first. Before return the result, the image will be converted to the same type as the input image. The elements in the output matrix imn that exceed the range of the integer or double type will be truncated. Supported classes: INT8, UINT8, INT16, UINT16, INT32, DOUBLE.

Examples

  im = imread('lena.png');
  imn = imnoise(im, 'gaussian');
  imshow(imn);
  imn = imnoise(im, 'salt & pepper');
  imshow(imn);
  imn = imnoise(im(:,:,1), 'salt & pepper', 0.2);
  imshow(imn);
  lowtri = tril(ones(im(:,:,1)));
  imn = imnoise( im(:,:,1), 'localvar', lowtri/5);
  imshow(imn);
  imn = imnoise( im(:,:,1), 'localvar', [0:0.1:1], [0:0.1:1].^3);
  imshow(imn);
  imn = imnoise(im, 'speckle' );
  imshow(imn);

Bugs and Shortcomings 'poisson' noise is not yet implemented.


 
m1ilc/fainbis_scilab.txt · Dernière modification: 2010/03/30 22:23 par suitable