langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
23
Task/Image-convolution/Octave/image-convolution.octave
Normal file
23
Task/Image-convolution/Octave/image-convolution.octave
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue