langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,23 @@
function [r, g, b] = rgbconv2(a, c)
r = im2uint8(mat2gray(conv2(a(:,:,1), c)));
g = im2uint8(mat2gray(conv2(a(:,:,2), c)));
b = im2uint8(mat2gray(conv2(a(:,:,3), c)));
endfunction
im = jpgread("Lenna100.jpg");
emboss = [-2, -1, 0;
-1, 1, 1;
0, 1, 2 ];
sobel = [-1., -2., -1.;
0., 0., 0.;
1., 2., 1. ];
sharpen = [ -1.0, -1.0, -1.0;
-1.0, 9.0, -1.0;
-1.0, -1.0, -1.0 ];
[r, g, b] = rgbconv2(im, emboss);
jpgwrite("LennaEmboss.jpg", r, g, b, 100);
[r, g, b] = rgbconv2(im, sobel);
jpgwrite("LennaSobel.jpg", r, g, b, 100);
[r, g, b] = rgbconv2(im, sharpen);
jpgwrite("LennaSharpen.jpg", r, g, b, 100);