matlab 이미지 처리 (2)

1062 단어 matlab
diagram = imread('lena1.png')
diagram = rgb2gray(diagram);%------------------------------         
N=120
M=100
%     B = roipoly(diagram)
%     [B,c,r] = roipoly(diagram)
%        
%     h = imhist(diagram)
%     h1 = h(1:10:256)
%     horz = 1:10:256
%     bar(h)
%  ROI   
    c = [122+N 172+N 200+N 170+N 121+N 94+N];
    r = [21+M 21+M 75+M 121+M 121+M 75+M];
%     c = [1 3 3 1 ];
%     r = [1 1 3 3 ];
%     B = roipoly(diagram,c,r);
    figure,imshow(diagram) %    
%     figure, imshow(B)
%  ROI   
%     [p,npix] = histroi(diagram,c,r) %   p      ,npix ROI      
%     figure,bar(p,1)
% B           ,  ROI           。
    [v,unv] = statmoments(p,2) %   unv(1) ROI   ,unv(2) ROI    
%    -    
%     f1 = medfilt2(diagram,[17,17],'symmetric')
%     figure,imshow(f1)
%    -       
    f2 = adpmedian(diagram,57)
    figure,imshow(f2)
%      
%     fp = spfilt(diagram,'chmean',3,3,9)
%     figure,imshow(fp)
%      
    fs = spfilt(diagram,'chmean',5,5,-15)
    figure,imshow(fs)

좋은 웹페이지 즐겨찾기