天天看點

兩種mask-邊緣提取-類拉普拉斯

</pre><pre name="code" class="plain">clc;clear;
f=imread('mm.jpg');
f=rgb2gray(f);
ff=double(f);
W1=[1,2,1;2,-12,2;1,2,1];
W2=[2,1,2;1,-12,1;2,1,1];
f1=conv2(ff,W1,'same');
f2=conv2(ff,W2,'same');
subplot(2,2,1),imshow(f);title(' ori img');
subplot(2,2,2),imshow(f1,[]);title(' mask w1');
subplot(2,2,3),imshow(f2,[]);title('mask w2');
subplot(2,2,4),imshow(f2-f1,[]);title('diff');
           

今天想到了兩個模闆,隻知道可以提取邊緣和拉普拉斯類似,不知道還有什麼用,先貼出來吧。