Dutormasi. com –Haloo sahabat dutormasi ! dipostingan ini dutormasi akan membahas mengenai matlab lagi ni yaitu membahas mengenai cara melakukan peningkatan kualitas citra pada matlab. Sebelum kita kepemabahasan pemrograman nya kita harus mengetahui proses proses pada kualitas citra tersebut.
Pada peningkatan kualitas citra ada proses proses yang termasuk kedalamnya yaitu adalah :
- Pengubahan kecerahan gambar
- Peregangan kontras
- Pengubahan hostogram citra
- Pelembutan citra
- Penajaman
- Pengubahan geometrik
- Pewarnaan semu
1. Lakukan konvolusi dengan dua buah fungsi berikut ( matriks kernel harus diputar dulu sampai 180 derajat ) :
Pembahasannya adalah :
1.(20x-2)+(13×1)+(8x-1)+
(18×0) +(8×3) +(19×0)+
(10x-3)+(13×2)+ (8×1)= (-40)+13+(-8)+24+(-30)+26+8 = -7
2.(13x-2)+(8×1) +(21x-1)+
(8×0) +(19×3)+(8×0) +
(13x-3)+(8×2) +(10×1) = (-26)+8+(-21)+57+(-39)+16+10 = 5
3.(8x-2)+(21×1)+(4x-1)+
(19×0)+(8×3) +(19×0)+
(8x-3)+(10×2)+(0x1) = (-16)+21+(-4)+24+(-24)+20 = 21
4.(21x-2)+(4×1) +(17x-1)+
(8×0) +(19×3)+(4×0) +
(10x-3)+(0x2) +(11×1) = (-42)+4+(-17)+57+(-30)+11 = -17
5.(18x-2)+(8×1) +(19x-1)+
(10×0) +(13×3)+(8×0) +
(12x-3)+(0x2) +(11×1) = (-36)+8+(-19)+39+(-36)+11 = -33
6.(8x-2)+(19×1)+(8x-1)+
(13×0)+(8×3) +(10×0)+
(0x-3)+(11×2)+(0x1) = (-16)+19+(-8)+24+22 = 41
7.(19x-2)+(8×1) +(19x-1)+
(8×0) +(10×3)+(0x0) +
(11x-3)+(0x2) +(24×1) = (-38)+8+(-19)+30+(-33)+24 = -28
8.(8x-2)+(19×1)+(4x-1)+
(10×0)+(0x3) +(11×0)+
(0x-3)+(24×2)+(11×1)= (-16)+19+(-4)+48+11 = 58
9.(10x-2)+(13×1)+(8x-1)+
(12×0) +(0x3) +(11×0)+
(8x-3) +(0x2) +(12×1)= (-20)+13+(-8)+(-24)+12 = -27
10.(13x-2)+(8×1) +(10x-1)+
(0x0) +(11×3)+(0x0) +
(0x-3) +(12×2)+(4×1) = (-26)+8+(-10)+33+24+4 = 33
11.(8x-2) +(10×1)+(0x-1)+
(11×0) +(0x3) +(24×0)+
(12x-3)+(4×2) +(11×1)= (-16)+10+(-36)+8+11 = -23
12.(10x-2)+(0x1) +(11x-1)+
(0x0) +(24×3)+(18×0) +
(4x-3) +(11×2)+(0x1) = (-20)+(-11)+72+(-12)+22 = 51
13.(12x-2)+(0x1)+(11x-1)+
(8×0) +(0x3)+(12×0) +
(10x-3)+(0x2)+(20×1) = (-24)+(-11)+(-30)+20 = -45
14.(0x-2)+(11×1)+(0x-1) +
(0x0) +(12×3)+(4×0) +
(0x-3)+(20×2)+(19×1) = 11+36+40+19 = 106
15.(11x-2)+(0x1) +(24x-1)+
(12×0) +(4×3) +(11×0) +
(20x-3)+(19×2)+(4×1) = (-22)+(-24)+12+(-60)+38+4 = -52
16.(0x-2) +(24×1)+(18x-1)+
(4×0) +(11×3)+(0x0) +
(19x-3)+(4×2) +(12×1) = 24+(-18)+33+(-57)+8+12 = 2
2. Filter Linier
clear; clc;A = imread(‘eight.tif’);A = imnoise(A, ‘salt & pepper’, 0.01);k = ones(3) / 9;[r c] = size(A);[m n] = size(k);h = rot90(k, 2);center = floor((size(h)+1)/2);left = center(2) – 1;right = n – center(2);top = center(1) – 1;bottom = m – center(1);Rep = zeros(r + top + bottom, c + left + right);for x = 1 + top : r + topfor y = 1 + left : c + leftRep(x,y) = A(x – top, y – left);endendB = zeros(r , c);for x = 1 : rfor y = 1 : cfor i = 1 : mfor j = 1 : nq = x – 1;w = y -1;B(x, y) = B(x, y) + (Rep(i + q, j + w) * h(i, j));endendendendfigure, imshow(A);figure, imshow(uint8(B));
clear; clc;I = imread(‘cameraman.tif’);hpf =[-1 -1 -1; -1 9 -1; -1 -1 -1];[r c] = size(I);[m n] = size(hpf);h = rot90(hpf, 2);center = floor((size(h)+1)/2);left = center(2) – 1;right = n – center(2);top = center(1) – 1;bottom = m – center(1);Rep = zeros(r + top + bottom, c + left + right);for x = 1 + top : r + topfor y = 1 + left : c + leftRep(x,y) = I(x – top, y – left);endendB = zeros(r , c);for x = 1 : rfor y = 1 : cfor i = 1 : mfor j = 1 : nq = x – 1;w = y -1;B(x, y) = B(x, y) + (Rep(i + q, j + w) * h(i, j));endendendendfigure, imshow(I);figure, imshow(uint8(B));
clear; clc;I = imread(‘eight.tif’);I = imnoise(I, ‘salt & pepper’, 0.01);[r c] = size(I);Rep = zeros(r + 2, c + 2);for x = 2 : r + 1for y = 2 : c + 1Rep(x,y) = I(x – 1, y – 1);endendRep;B = zeros(r, c);for x = 1 : rfor y = 1 : cfor i = 1 : 3for j = 1 : 3q = x – 1;w = y -1;array((i – 1) * 3 + j) = Rep(i + q, j + w);endendB(x, y) = median(array(:));endendfigure, imshow(I);figure, imshow(uint8(B))
- Cara Melakukan Operasi Dasar Pengolahan Citral Pada Matlab
- Cara Melakukan Pengolahan Citra Dasar Pada Matlab | 2