Download pdf - Tach Bien Anh

Transcript
  • 5/22/2018 Tach Bien Anh

    1/6

    BO CO LN 2 MN N I - HC K 20132

    Tch bin nh trong matlab

    Cc bc tch bin nh trong matlab

    B1: c nh sdng hm : imread();

    B2: lm xm sdng hm: rgb2gray

    B3:tch bin sdng cc phng php tch bin :Sobel, Prewitt, Roberts, LoG,Zero Crossing, Canny.

    Cc btch bin nh :

    1. Btch bin sobel- C php : a=edge(h,'sobel'); h l nh c lm xm

    Vd:

    f=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');h=rgb2gray(f);

    g1=edge(h,'sobel');figure,imshow(g1);

  • 5/22/2018 Tach Bien Anh

    2/6

    2. Btch bin Prewittf=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');

    h=rgb2gray(f);

    g2=edge(h,'prewitt');figure,imshow(g2);

    Btch ny n gin hn btch sobel nhng c sinh ra mt cht nhiu

    3. Btch bin RobertsC php : edge(h,'roberts');

    Vd:

    f=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');

    h=rgb2gray(f);g3=edge(h,'roberts');

    figure,imshow(g3);

  • 5/22/2018 Tach Bien Anh

    3/6

    - Btch Roberts l btch n gin nht v l btch bin xa nht trongxl s

    - Btch ny c sdng t hn so vi cc btch khc do chc nng giihn ca n ( n khng i xng v khng c tng qut ha tch bin )

    4. Btch bin LoGC php :edge(h,'log');Vd :

    f=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');

    h=rgb2gray(f);

    g4=edge(h,'log');figure,imshow(g4);

  • 5/22/2018 Tach Bien Anh

    4/6

    Phng php ny gim nhiu v c bin nh r nt

    5. Btch bin Zero CrossingC php : edge(h,'zerocross');

    Vd:

    f=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');h=rgb2gray(f);g5=edge(h,'zerocross');

    figure,imshow(g5);

  • 5/22/2018 Tach Bien Anh

    5/6

    6. Btch bin Canny.C php : edge(h,'canny');

    Vd:f=imread('C:\Users\Thao BK\Desktop\deckop\matlab\oto3.png');

    h=rgb2gray(f);g6=edge(h,'canny');

    figure,imshow(g6);

  • 5/22/2018 Tach Bien Anh

    6/6

    L btch bin mnh nht ca hm edge nh c lm trn sdng blcGauss