Pseudocode Min Filter Implementasi Order-Statistic Filters Untuk Mereduksi Noise Pada Citra Digital

Pada pseudocode program max filter, pertama nilai pixel citra diambil dari layer R , B atau G, dari kernel 3x3 selanjutnya dilakukan pengurutan secara ascending dan diambil nilai mediannya kemudian di-replace pada posisi pusat kernel 3x3 tersebut. Demikian seterusnya berulang-ulang sampai pada lebar dan tinggi citra yang dapat dicakup filter

3.2.4 Pseudocode Min Filter

Dalam Order-Statistic, median merepresentasikan urutan ke 50 dari rangking sejumlah angka. Dari situ dapat diambil pengertian bahwa ada urutan 0 yang int temp,temp2 int x,y for j  1 to y – 1 do for I  1 to x – 1 do temp2[0, 0]  pixel of image i - 1, j - 1 temp[0]  temp2[0, 0] temp2[1, 0]  pixel of image i, j - 1 temp[1]  temp2[1, 0] temp2[2, 0]  pixel of image i + 1, j - 1 temp[2]  temp2[2, 0] temp2[3, 0]  pixel of image i - 1, j temp[3]  temp2[3, 0] temp2[4, 0]  pixel of image i, j temp[4]  temp2[4, 0] temp2[5, 0]  pixel of imagei + 1, j temp[5]  temp2[5, 0] temp2[6, 0]  pixel of image i - 1, j + 1 temp[6]  temp2[6, 0] temp2[7, 0]  pixel of imagei, j + 1 temp[7]  temp2[7, 0] temp2[8, 0]  pixel of imagei + 1, j + 1 temp[8]  temp2[8, 0] endfor endfor Ascending Bubble Sorting maxi, j  temp2[8, 0] Universitas Sumatera Utara merupakan nilai terkecil dari rangking sejumlah angka selanjutnya menjadi min filter. Berikut ini merupakan pseudocode program Min filter. Pada pseudocode program Min filter, pertama nilai pixel citra diambil dari layer R , B atau G, dari kernel 3x3 selanjutnya dilakukan pengurutan secara ascending dan diambil nilai mediannya kemudian di-replace pada posisi pusat kernel 3x3 tersebut. Demikian seterusnya berulang-ulang sampai pada lebar dan tinggi citra yang dapat dicakup filter int temp,temp2 int x,y for j := 1 to y – 1 do for I := 1 to x – 1 do temp2[0, 0]  pixel of image i - 1, j - 1 temp[0]  temp2[0, 0] temp2[1, 0]  pixel of image i, j - 1 temp[1]  temp2[1, 0] temp2[2, 0]  pixel of image i + 1, j - 1 temp[2]  temp2[2, 0] temp2[3, 0]  pixel of image i - 1, j temp[3]  temp2[3, 0] temp2[4, 0]  pixel of image i, j temp[4]  temp2[4, 0] temp2[5, 0]  pixel of imagei + 1, j temp[5]  temp2[5, 0] temp2[6, 0]  pixel of image i - 1, j + 1 temp[6]  temp2[6, 0] temp2[7, 0]  pixel of imagei, j + 1 temp[7]  temp2[7, 0] temp2[8, 0]  pixel of imagei + 1, j + 1 temp[8]  temp2[8, 0] endfor endfor Ascending Bubble Sorting mini, j  temp2[0, 0] Universitas Sumatera Utara

3.2.5 Pseudocode Midpoint Filter