12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- clear all;
- close all;
- clc;
- path = '낚�暠獗/헌九/8.jpg';
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % path = '낚�暠獗/꼇헌九/3.jpg';
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % path = '낚�暠獗/꼇헌九2/11.jpg';
-
- % path = '뿍�.jpg';
-
- Img = imread(path);
- if size(Img,3) == 3
- Img = rgb2gray(Img);
- end
- [h,w]=size(Img);
- if h<64
- Img = imresize(Img, [64, w], 'bilinear');
- h=64;
- end
- if w<64
- Img = imresize(Img, [h, 64], 'bilinear');
- w=64;
- end
- figure;
- subplot(2,2,1);
- imshow(Img);
- title('Original Image');
- sigma = 2.0;
- K=fspecial('gaussian',15,sigma); % 15 Caussian kernel
- gausImg = conv2(double(Img),double(K),'same');
- % gausImg = conv2(Img, K,'same');
- gausImg8 = uint8(gausImg);
- subplot(2,2,2);
- title('Smoothed image');
- % imshow(gausImg,[0, 255]);
- imshow(gausImg8);
- val1 = CPBD_compute(Img);
- val2 = CPBD_compute(gausImg8);
- val = val1 - val2;
|