素描matlab实现

I = imread('GF.png');
[height,width] = size(I);
imggray = rgb2gray(I);
N = 255-imggray;   
h1=fspecial('gaussian',3,3);
g=imfilter(N,h1,'same');
for i=1:height
    for j=1:width
        b = double(g(i,j));
        a = double(imggray(i,j));
        temp = a+a*b/(255-b);
        out(i,j)=min(temp,255);
    end
end
imshow(out/255);

你可能感兴趣的:(matlab,素描)