摘自 http://blog.csdn.net/coolbacon/article/details/4042054

clear;
clc;
m1 = [[0 2];[3 1]];
u1=ones(2, 2);
m2=[[4*m1 4*m1+2*u1];[4*m1+3*u1 4*m1+u1]]
u2=ones(4, 4);
m3=[[4*m2 4*m2+2*u2];[4*m2+3*u2 4*m2+u2]]
I = imread('E:\\beichuan1.jpg');

gI = .2989*I(:,:,1)...
    +.5870*I(:,:,2)...
    +.1140*I(:,:,3);

[h w] = size(gI);

bw = 0;
for i=1:h
    for j=1:w
        if (gI(i,j) / 4> m3(bitand(i, 7) + 1, bitand(j,7) + 1))
            bw(i,j)= 255;
        else
            bw(i,j)= 0;
        end
    end
end
imshow(bw);

 

 

相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2021-12-15
  • 2021-07-17
  • 2021-12-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-20
  • 2021-11-18
  • 2021-05-16
  • 2021-05-19
  • 2021-11-21
  • 2021-10-01
相关资源
相似解决方案