mfasl13

Upload: hamid58

Post on 02-Mar-2016

9 views

Category:

Documents


0 download

DESCRIPTION

Matlab Training in Persian

TRANSCRIPT

  • 7/18/2019 MFasl13

    1/54

  • 7/18/2019 MFasl13

    2/54

    : 13-1- .:.(Depth:) ().(Resolution:)

    dpi.. .

  • 7/18/2019 MFasl13

    3/54

    : 13-1---::

    RGB

    : :PNG.JPGBMPTIFFGIF .

  • 7/18/2019 MFasl13

    4/54

    : 13-2-(Intensity Image) .:

    .010255.uint8.

    images .uint8 .uint8

  • 7/18/2019 MFasl13

    5/54

    : 13-2-- :-

  • 7/18/2019 MFasl13

    6/54

    : 13-2-- :((Indexed Image.1: .1256..2(map:)3

    . . .

  • 7/18/2019 MFasl13

    7/54

    : 13-2-- (Indexed Image)-

  • 7/18/2019 MFasl13

    8/54

    : 13-2--

    (01).doubleuint8.

    uint8010255.

  • 7/18/2019 MFasl13

    9/54

    : 13-2-- RGB

    RGBtrue color 0255 255. 00255 ((256*256*25616. .rgb.

    0.(r,g,b)rgb1(double)0255(uint8)

    .rgb

  • 7/18/2019 MFasl13

    10/54

    : 13-2--

    RGB-rgb

  • 7/18/2019 MFasl13

    11/54

    : 13-3--imreadImread :.rgb:m=imread(filename):[m,map]=imread(filename).mapm

    :imread. .

  • 7/18/2019 MFasl13

    12/54

    : 13-4--imshow imshow:

    imshow(m); rgbimshow(I , map) imshow(filename); :>>imshow(fabric.png)

    : >>m=imread(fabric.png);

    imshow(m)

  • 7/18/2019 MFasl13

    13/54

    : 13-4--imshow-

  • 7/18/2019 MFasl13

    14/54

    : 13-4--imtoolimtool. imshow:

    >>imshow(fabric.png)

  • 7/18/2019 MFasl13

    15/54

    : 13-5--imwriteimwrite.:

    imwrite(m , filename);

    imwrite(X , map , filename);

  • 7/18/2019 MFasl13

    16/54

    : 13-6--imfinfo : ....

    : info=imfinfo(filename)

  • 7/18/2019 MFasl13

    17/54

    : :-13-7

    bw=im2bw(m , level)

    bw=im2bw(x , map , level)

    level(.01)m=ind2gray(x , map);

    [x,map]=gray2ind(m);

    [x,map]=rgb2ind(m);

    m=ind2rgb(x , map);

    m=rgb2gray(m); .

  • 7/18/2019 MFasl13

    18/54

    : 13-8-uint8

    .double.uint8:

    m=double(m);m=im2uint8(m);

  • 7/18/2019 MFasl13

    19/54

    : 13-9-.:

    :imresize:imrotate:imcrop

    .

  • 7/18/2019 MFasl13

    20/54

    : 13-9-- :imresize

    : y=imresize(x , a);y=imresize(x , [m , n]); 2.a .1..

  • 7/18/2019 MFasl13

    21/54

    : 13-9-- -imrotate

    :m2=imrotate(m , d , [Option] , [crop]). .bilinear, nearestbicubic nearest

    . crop. .

  • 7/18/2019 MFasl13

    22/54

    : 13-9-- -imrotate- :

    m=imread(ic.tif);

    n=imrotate(m , 35);p=imrotate(m , 35,crop);

    imshow(n); figure; imshow(p);

  • 7/18/2019 MFasl13

    23/54

    : 13-9-- ::imcrop

    I2 = IMCROP(I,RECT)X2 = IMCROP(X,MAP,RECT)RGB2 = IMCROP(RGB,RECT)[A,RECT] = IMCROP(...)

    rect. .

  • 7/18/2019 MFasl13

    24/54

    : 13-9-- :imcrop- :

    m=imread(pout.tif);

    imshow(m);figure;imcrop(m,[size(m)/4,size(m)/2]

  • 7/18/2019 MFasl13

    25/54

    : 13-10-filter2:

    m2=filter2(h , m) hm.h .3*35*5

  • 7/18/2019 MFasl13

    26/54

    : 13-10--

    fspecialfilter2.:

    h=fspecial( , .( :gaussian: sobel: prewitt: laplacian: log: average: unsharp:

  • 7/18/2019 MFasl13

    27/54

    : 13-10---

    SobelFilter=fspecial(sobel);

    [I,map]=imread('kids.tif');I=ind2gray(I,map);I2=filter2(SobelFilter,I);

    imshow( I ); figure; imshow( I2 );

  • 7/18/2019 MFasl13

    28/54

    : 13-11-:

  • 7/18/2019 MFasl13

    29/54

    : 13-11--pixvalimpixel impixel. :

    P = IMPIXEL(I)P = IMPIXEL(X,MAP)

    P = IMPIXEL(RGB). p .. pixval. imshow.

  • 7/18/2019 MFasl13

    30/54

    : 13-11---improfile:

    ::

    imshow(flowers.tif);improfile;

  • 7/18/2019 MFasl13

    31/54

    : 13-11---imcontour::

    im=imread(ic.tif);

    imshow(im);figure;imcontour(im,3);

  • 7/18/2019 MFasl13

    32/54

    : 13-11---imhist::

    I=imread(flowers.tif);I=rgb2gray(I);

    imshow(I);figure;imhist(I);

  • 7/18/2019 MFasl13

    33/54

    : 13-11---

    mean2std2:meanstd

    ... .mean2std2.

  • 7/18/2019 MFasl13

    34/54

    : 13-11-- :

    .

  • 7/18/2019 MFasl13

    35/54

    : 13-11-- :

    .. :

  • 7/18/2019 MFasl13

    36/54

    : 13-11-- - :.-imadjust

    J=imadjust(I , [low , high] , [bottom , top]). . :I=imread(pout.tif);J=imadjust(I , [0.3 , 0.7] , [0 ,1]);

    subplot(2,2,1);imshow(I); subplot(2,2,2);imshow(J);

    subplot(2,2,3); imhist(I); subplot(2,2,4); imhist(J)

  • 7/18/2019 MFasl13

    37/54

    : 13-11-- - -imadjust-

  • 7/18/2019 MFasl13

    38/54

    : 13-11-- -histeq-histeq. :

    I=imread(tire.tif);

    J=histeq(I);figure;

    subplot(2,2,1);imshow(I);

    subplot(2,2,2);imshow(J);subplot(2,2,3);imhist(I);

    subplot(2,2,4);imhist(J);

  • 7/18/2019 MFasl13

    39/54

    : 13-11--

    -histeq--

  • 7/18/2019 MFasl13

    40/54

    : 13-11-- -

    .:..

    fspecialfilter2.medfilt2. .(sharpness) .

  • 7/18/2019 MFasl13

    41/54

    : 13-11-- - -:

    I = imread(eight.tif);

    J= imnoise(I , Salt & pepper , 0.02); % K= filter2(fspecial(average , 3) , J) / 255; % L=medfilt2(J , [3 , 3]); % subplot(2,2,1); imshow( I ); title(Initial Image)

    subplot(2,2,2); imshow( J ); title(Noised Image);subplot(2,2,3); imshow( K ); title(Mean Filter);

    subplot(2,2,4); imshow( L ); title(Median Filter);

  • 7/18/2019 MFasl13

    42/54

    : 13-11-- - --:

  • 7/18/2019 MFasl13

    43/54

    : -13-12 .

    ..255100 .

  • 7/18/2019 MFasl13

    44/54

    : -13-12

    imshow. (:imshow(m.:imshow(I ,map)

  • 7/18/2019 MFasl13

    45/54

    : Morphological Operations-13-12

    . ... :----

  • 7/18/2019 MFasl13

    46/54

    : --13-12 Morphological Operations- ((Dilation & Erosion

    . . .

    ... .

  • 7/18/2019 MFasl13

    47/54

    : --13-12 Morphological Operations- -

    .(Mask)3*3 .1 3*39 .

    imdilateimerode bwmorph.:.

    bw2=imerode(bw1, se);

    bw2=imdilate(bw1 , se);

  • 7/18/2019 MFasl13

    48/54

    : --13-12 Morphological Operations- -

    bw1=imread(circbw.tif); SE=eye(5);

    bw2=imerode(bw1 , SE);

    imshow(bw1); figure; imshow(bw2);

  • 7/18/2019 MFasl13

    49/54

    : --13-12 Morphological Operations- Open & Close. .

    .. .

    bwmorph. (. (

  • 7/18/2019 MFasl13

    50/54

    : --13-12 Morphological Operations- Open & Close-

    bw1=imread(circbw.tif);

    se= ones(40 , 30); bw2= imerode(bw1 , se);

    bw3=imdilate(bw2 , se);

    imshow(bw2); figure; imshow(bw3);

  • 7/18/2019 MFasl13

    51/54

    : --13-12 Morphological Operations- :immorph

    immorph:.

    bw2 = bwmorph(bw1 , operation , [n]); . :.erode fill hbreak open skel remove close dilate

  • 7/18/2019 MFasl13

    52/54

    : --13-12 Morphological Operations- ::immorph-

    bw1= imread(circbw.tif); bw2= bwmorph(bw1 , skel , inf)

    imshow(bw1); figure; imshow(bw2);

  • 7/18/2019 MFasl13

    53/54

    : .rgbtif.flower-13-1 :. m 180120-

    b1b2. :.:m(:,:,2)>120 & m(:,:,1) < 100. .b11b1- cb11b2- . .b1b11b2- b1b2(-(- . text-

    http://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/flower.tif
  • 7/18/2019 MFasl13

    54/54

    : tif.fabric13-2- .((grayscale .600dpi. :...

    http://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tifhttp://localhost/var/www/apps/conversion/tmp/scratch_6/fabric.tif