laplaciansem.m
上传用户:jiaji168
上传日期:2016-05-12
资源大小:816k
文件大小:0k
源码类别:

图形图像处理

开发平台:

Matlab

  1. I=imread('sem.bmp');
  2. I=im2double(I);
  3. %figure;
  4. %imshow(I);title('org img');
  5. [height width R]=size(I);
  6. for i=2:height-1
  7.     for j=2:width-1
  8.        L(i,j)=4*I(i,j)-I(i-1,j)-I(i+1,j)-I(i,j-1)-I(i,j+1);
  9.     
  10.     end
  11. end
  12. %figure;
  13. %imshow(L,[]);
  14.    G(i,j)=0.3*L(i,j)+0.7*I(i,j);
  15. %figure;
  16. %imshow(G,[]);
  17. for i=1:height-1
  18.     for j=1:width-1
  19.         if (L(i,j)<-0.1)
  20.             L(i,j)=0;
  21.         else L(i,j)=1;
  22.         end
  23.     end
  24. end
  25. figure;
  26. imshow(L,[]);