5.1 Kesimpulan
Setelah merancang dan mengaplikasikan perangkat lunak perbaikan kualitas citra manuskrip kuno dengan mengimplementasikan algoritma edge detection operator Sobel, maka diperoleh hasil pengujian sistem adalah sebagai berikut:
1. Perangkat lunak dapat mengolah citra manuskrip kuno dengan algoritma Edge Detection operator Sobel.
2. Tambahan operator powerlaw meningkatkan intensitas citra saat operasi deteksi tepi dijalankan dan memberikan tingkat kecerahan dalam garis batas antar objek
3. Kualitas citra hasil deteksi tepi secara visual untuk kedua format JPG dan BMP adalah sama.
4. Beberapa kelemahan penggunaan deteksi tepi ditemukan dalam kasus deteksi citra yang memiliki nilai kontras rendah.
5.2 Saran
Adapun saran-saran yang diperlukan untuk penelitian maupun pengembangan berikutnya adalah :
1. Membandingkan operator yang digunakan seperti operator Prewitt, Robert maupun Canny.
2. Sebaiknya menggunakan tambahan operatorpowerlawsaat melakukan deteksi tepi pada sebuah objek.
Ahmad, N. & Hadinegoro, A. 2012.Metode Histogram Equalization Untuk Perbaikan Citra Digital. Seminar Nasional Teknologi Informasi & Komunikasi Terapan 2012 (Semantik 2012). Semarang, 23 Juni 2012 Program Pasca Sarjana Magister Teknik Informatika,Universitas Atma Jaya Yogyakarta. Arnia, F. & Munadi, K. 2010. Metode Restorasi Citra Manuskrip Kuno Berbasis
Histogram Terekualisasi. Seminar Nasional Teknologi Informasi 2010. Teknik Elektro Universitas Syiah Kuala. Banda Aceh.
Awaluddin, M.D & Bambang Y.Penajaman Dan Segmentasi Citra Pada Pengolahan Citra Digital.Jurnal TEKNIK – Vol. 31 No. 1 Tahun 2010, ISSN 0852-1697. Fakultas Teknik UNDIP Semarang.
Budi, T.A.W., Rahmawati, M. & Dayawati, R.N., Romadhony, A. 2009. Proses Up-Scaling Citra Digital Pada Domain Frekuensi Dengan Menggunakan metode Discrete Wavelet Transform. Konferensi Nasional Sistem Dan Informatika 2009; Bali, November 14, 2009. Fakultas Informatika Institut Teknologi Telkom, Bandung.
Kesiman, M, W, A. 2013.Segmentasi Area Teks Aksara Bali pada Citra Lontar Kuno Bali Berdasarkan Peta Nilai Lacunarity. Seminar Nasional Aplikasi Teknologi Informasi (SNATI) 2013 Yogyakarta, 15 Juni 2013.
Kusban, Muhammad. 2013. Deteksi Tepi Bidang Kedokteran Dalam Kawasan AlihgramPowerlaw Proceeding.Seminar Nasional Teknik & Manajemen Industri 2013. T. Elektro Universitas Muhammadiyah Surakarta.
Kusumanto, RD., Tompunu & Alan N. 2011. Pengolahan Citra Digital Untuk Mendeteksi Obyek Menggunakan Pengolahan Warna Model Normalisasi RGB. Seminar Nasional Teknologi Informasi & Komunikasi Terapan 2011 (Semantik 2011). Jurusan Teknik Komputer, Politeknik Negeri Sriwijaya, Palembang.
Murinto, Putra.,W.P. & Handayaningsih, S. 2008. Analisis perbandingan Histogram Equalization dan Model Logarithmic Image Processing(LIP) untukImage Enhancement. JURNAL INFORMATIKAVol 2, No. 2, Juli 2008.
Pujiyono, W., Murinto & Adam I., 2009. Perbandingan Kinerja Metode Gradient
Berdasarkan OperatorSobelDanPrewittImplementasi Pada Deteksi Sidik Jari. Jurnal Informatika Vol 3, No. 1, Januari 2009.
47
Sutoyo. T. 2009.Teori Pengolahan Citra Digital, Yogyakarta: Penerbit ANDI.
Pujiyono, W., Murinto & Adam I., 2009. Perbandingan Kinerja Metode Gradient
Berdasarkan OperatorSobelDanPrewittImplementasi Pada Deteksi Sidik Jari. Jurnal Informatika Vol 3, No. 1, Januari 2009
T.Sutojo & Wicaksono M.H. 2009. Perbandingan Sensitivitas Filter Deteksi Tepi Sobel Dengan Filter Deteksi Tepi Prewitt Untuk Citra Yang Mengandung Noise Gaussian. Jurnal Techno.Com, Vol. 8 No. 1, Mei 2009. UDINUS Semarang.
LISTING PROGRAM
1. Menu
Public Class frmMenu
Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem.Click
frmHelp.Show() End Sub
Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuitToolStripMenuItem.Click
End End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
frmAbt.Show() End Sub
Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
frmEdges1.Show() End Sub
End Class
2. EdgeDetect
Public Class frmEdges1
Dim bmap As Bitmap 'deklarasi gambar/image dengan tipe Bitmap Dim PicAda As Boolean
Dim NmFIle As String Dim nmFILE1 As String Private displayBM As Bitmap
Private Sub cmdLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLoad.Click
OpenFileDialog1.Filter = "Images|*.JPG;*.BMP" OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName = "" Then Exit Sub PicAda = True
Pic1.Image = Image.FromFile(OpenFileDialog1.FileName)
Pic1.Width = Pic1.Height * Pic1.Image.Width / Pic1.Image.Height NmFIle = OpenFileDialog1.FileName
lblNmFile.Text = NmFIle
Dim fileDetails As System.IO.FileInfo = New System.IO.FileInfo(NmFIle) lblSize.Text = fileDetails.Length.ToString
cmdProses.Enabled = True End Sub
Private Sub cmdProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdProses.Click
cmdLoad.Enabled = False cmdProses.Enabled = False If PicAda = False Then
MsgBox("Pilih dulu gambar yang akan diproses", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Error Proses")
LAMPIRAN A-2
bmap = New Bitmap(Pic1.Image) 'Gambar asli dijadikan gambar Bitmap Pic2.Image = bmap
Dim tempbmp As New Bitmap(Pic2.Image) 'deklarasi gambar Bitmap dari gambar asli untuk diproses
Dim DX As Integer Dim DY As Integer
Dim Red, Green, Blue, Grey As Integer Dim X, Y As Integer ProgressBar1.Width = Pic2.Width ProgressBar1.Show() With tempbmp For X = DX To .Height - DX - 1 For Y = DY To .Width - DY - 1 Red = CInt(.GetPixel(Y, X).R) Green = CInt(.GetPixel(Y, X).G) Blue = CInt(.GetPixel(Y, X).B) Grey = (Red + Green + Blue) / 3
Dim clr As Color = bmap.GetPixel(Y, X) If (Grey < 128) Then Red = 0 Green = 0 Blue = 0 Else Red = 255 Blue = 255 Green = 255 End If
bmap.SetPixel(Y, X, Color.FromArgb(Red, Green, Blue)) Next
If X Mod 10 = 0 Then Pic2.Invalidate()
Me.Text = "Progres Proses Biner : " & Int(100 * X / _ (Pic2.Image.Height - 2)).ToString & "%"
ProgressBar1.Value = Int(100 * X / (Pic2.Image.Height - 2)) Pic2.Refresh() End If Next End With ProgressBar1.Hide() Pic2.Refresh()
Me.Text = "Pengolahan Citra : Proses Biner berhasil" Call SobelH()
Call SobelV() End Sub
Sub SobelH()
If PicAda = False Then
MsgBox("Pilih dulu gambar yang akan diproses", _
MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Error Proses") Exit Sub End If Dim MF(2, 2) As Double MF(0, 0) = -1 'a MF(0, 1) = -2 'b MF(0, 2) = -1 'c MF(1, 0) = 0 'd MF(1, 1) = 0 'e MF(1, 2) = 0 'f MF(2, 0) = 1 'g MF(2, 1) = 2 'h MF(2, 2) = 1 'i
bmap = New Bitmap(Pic2.Image) Pic3.Image = bmap
Dim tempbmp As New Bitmap(Pic3.Image) Dim DX As Integer = 1
Dim DY As Integer = 1
Dim Red As Integer, Green As Integer, Blue As Integer Dim i As Integer, j As Integer
Dim k As Integer, l As Integer 'untuk mask border ProgressBar1.Width = Pic3.Width
ProgressBar1.Show() With bmap
For i = DX To .Height - DX - 1 For j = DY To .Width - DY - 1
'proses matriks filter
'point(j,i)*e --> titik tengah
Red = CInt(.GetPixel(j, i).R) * MF(1, 1) Green = CInt(.GetPixel(j, i).G) * MF(1, 1) Blue = CInt(.GetPixel(j, i).B) * MF(1, 1) 'proses titik tetangga
'point(j-1,i-1)*a--> MF(0,0)--> titik kiri atas If j - 1 < 1 And i - 1 < 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(0, 0)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(0, 0)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 0)) Else
Red = Red + (CInt(.GetPixel(j - 1, i - 1).R) * _ MF(0, 0))
Green = Green + (CInt(.GetPixel(j - 1, i - 1).G) * _ MF(0, 0))
Blue = Blue + (CInt(.GetPixel(j - 1, i - 1).B) * _ MF(0, 0))
End If
If i - 1 < 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(0, 1)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(0, 1)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 1)) Else
Red = Red + (CInt(.GetPixel(j, i - 1).R) * MF(0, 1)) Green = Green + (CInt(.GetPixel(j, i - 1).G) * _ MF(0, 1))
Blue = Blue + (CInt(.GetPixel(j, i - 1).B) * MF(0, 1)) End If
If j + 1 > .Width - DY - 1 And i - 1 > 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(0, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(0, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i - 1).R) * _ MF(0, 2))
Green = Green + (CInt(.GetPixel(j + 1, i - 1).G) * _ MF(0, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i - 1).B) * _ MF(0, 2))
End If
If j - 1 < 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(1, 0)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(1, 0)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(1, 0))
LAMPIRAN A-4
Green = Green + (CInt(.GetPixel(j - 1, i).G) * _ MF(1, 0))
Blue = Blue + (CInt(.GetPixel(j - 1, i).B) * MF(1, 0)) End If
If j + 1 > .Width - DY - 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(1, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(1, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(1, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i).R) * MF(1, 2)) Green = Green + (CInt(.GetPixel(j + 1, i).G) * _
MF(1, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i).B) * MF(1, 2)) End If
If j - 1 < 1 And i + 1 > .Height - DX - 1 Then Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 0)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 0)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 0)) Else
Red = Red + (CInt(.GetPixel(j - 1, i + 1).R) * _ MF(2, 0))
Green = Green + (CInt(.GetPixel(j - 1, i + 1).G) * _ MF(2, 0))
Blue = Blue + (CInt(.GetPixel(j - 1, i + 1).B) * _ MF(2, 0))
End If
If i + 1 > .Height - DX - 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 1)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 1)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 1)) Else
Red = Red + (CInt(.GetPixel(j, i + 1).R) * MF(2, 1)) Green = Green + (CInt(.GetPixel(j, i + 1).G) * _
MF(2, 1))
Blue = Blue + (CInt(.GetPixel(j, i + 1).B) * MF(2, 1)) End If
If j + 1 > .Width - DY - 1 And i + 1 > .Height - DX 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i + 1).R) * _ MF(2, 2))
Green = Green + (CInt(.GetPixel(j + 1, i + 1).G) _ * MF(2, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i + 1).B) * _ MF(2, 2)) End If If Red < 0 Then Red = 0 Else If Red > 255 Then Red = 255 End If End If If Green < 0 Then Green = 0 Else If Green > 255 Then Green = 255
End If End If If Blue < 0 Then Blue = 0 Else If Blue > 255 Then Blue = 255 End If End If
bmap.SetPixel(j, i, Color.FromArgb(Red, Green, Blue)) Next
If i Mod 10 = 0 Then Pic3.Invalidate()
Me.Text = Int(100 * i / (Pic3.Image.Height - 2))_ .ToString & "%"
ProgressBar1.Value = Int(100 * i / (Pic3.Image.Height - 2)) Pic3.Refresh() End If Next End With ProgressBar1.Hide() Pic3.Refresh() End Sub Sub SobelV()
If PicAda = False Then
MsgBox("Pilih dulu gambar yang akan diproses", _
MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Error Proses") Exit Sub End If Dim MF(2, 2) As Double MF(0, 0) = 1 'a MF(0, 1) = 0 'b MF(0, 2) = -1 'c MF(1, 0) = 2 'd MF(1, 1) = 0 'e MF(1, 2) = -2 'f MF(2, 0) = 1 'g MF(2, 1) = 0 'h MF(2, 2) = -1 'i
bmap = New Bitmap(Pic2.Image) Pic4.Image = bmap
Dim tempbmp As New Bitmap(Pic4.Image) Dim DX As Integer = 1
Dim DY As Integer = 1
Dim Red As Integer, Green As Integer, Blue As Integer Dim i As Integer, j As Integer
Dim k As Integer, l As Integer 'untuk kernel border ProgressBar1.Width = Pic4.Width
ProgressBar1.Show() With bmap
For i = DX To .Height - DX - 1 For j = DY To .Width - DY - 1
Red = CInt(.GetPixel(j, i).R) * MF(1, 1) Green = CInt(.GetPixel(j, i).G) * MF(1, 1) Blue = CInt(.GetPixel(j, i).B) * MF(1, 1) If j - 1 < 1 And i - 1 < 1 Then
LAMPIRAN A-6
Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 0)) Else
Red = Red + (CInt(.GetPixel(j - 1, i - 1).R) * _ MF(0, 0))
Green = Green + (CInt(.GetPixel(j - 1, i - 1).G) * _ MF(0, 0))
Blue = Blue + (CInt(.GetPixel(j - 1, i - 1).B) * _ MF(0, 0))
End If
If i - 1 < 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(0, 1)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(0, 1)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 1)) Else
Red = Red + (CInt(.GetPixel(j, i - 1).R) * MF(0, 1)) Green = Green + (CInt(.GetPixel(j, i - 1).G) * _
MF(0, 1))
Blue = Blue + (CInt(.GetPixel(j, i - 1).B) * MF(0, 1)) End If
If j + 1 > .Width - DY - 1 And i - 1 > 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(0, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(0, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(0, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i - 1).R) * _ MF(0, 2))
Green = Green + (CInt(.GetPixel(j + 1, i - 1).G) * _ MF(0, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i - 1).B) * _ MF(0, 2))
End If
If j - 1 < 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(1, 0)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(1, 0)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(1, 0)) Else
Red = Red + (CInt(.GetPixel(j - 1, i).R) * MF(1, 0)) Green = Green + (CInt(.GetPixel(j - 1, i).G) * _
MF(1, 0))
Blue = Blue + (CInt(.GetPixel(j - 1, i).B) * MF(1, 0)) End If
If j + 1 > .Width - DY - 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(1, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(1, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(1, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i).R) * MF(1, 2)) Green = Green + (CInt(.GetPixel(j + 1, i).G) * _
MF(1, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i).B) * MF(1, 2)) End If
If j - 1 < 1 And i + 1 > .Height - DX - 1 Then Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 0)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 0)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 0)) Else
Red = Red + (CInt(.GetPixel(j - 1, i + 1).R) * _ MF(2, 0))
Green = Green + (CInt(.GetPixel(j - 1, i + 1).G) _ * MF(2, 0))
MF(2, 0)) End If
If i + 1 > .Height - DX - 1 Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 1)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 1)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 1)) Else
Red = Red + (CInt(.GetPixel(j, i + 1).R) * MF(2, 1)) Green = Green + (CInt(.GetPixel(j, i + 1).G) * _
MF(2, 1))
Blue = Blue + (CInt(.GetPixel(j, i + 1).B) * MF(2, 1)) End If
If j + 1 > .Width - DY - 1 And i + 1 > .Height - DX 1 _ Then
Red = Red + (CInt(.GetPixel(j, i).R) * MF(2, 2)) Green = Green + (CInt(.GetPixel(j, i).G) * MF(2, 2)) Blue = Blue + (CInt(.GetPixel(j, i).B) * MF(2, 2)) Else
Red = Red + (CInt(.GetPixel(j + 1, i + 1).R) * _ MF(2, 2))
Green = Green + (CInt(.GetPixel(j + 1, i + 1).G) _ * MF(2, 2))
Blue = Blue + (CInt(.GetPixel(j + 1, i + 1).B) * _ MF(2, 2)) End If If Red < 0 Then Red = 0 Else If Red > 255 Then Red = 255 End If End If If Green < 0 Then Green = 0 Else If Green > 255 Then Green = 255 End If End If If Blue < 0 Then Blue = 0 Else If Blue > 255 Then Blue = 255 End If End If
bmap.SetPixel(j, i, Color.FromArgb(Red, Green, Blue)) Next
If i Mod 10 = 0 Then Pic4.Invalidate()
Me.Text = Int(100 * i / (Pic4.Image.Height - 2)).ToString_ & "%"
ProgressBar1.Value = Int(100 * i / (Pic4.Image.Height - 2)) Pic4.Refresh() End If Next End With ProgressBar1.Hide() Pic4.Refresh()
LAMPIRAN A-8
Private Sub cmdKeluar_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles cmdKeluar.Click
Close() End Sub
Private Sub cmdBersih_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles cmdBersih.Click Pic1.Image = Nothing Pic2.Image = Nothing Pic3.Image = Nothing Pic4.Image = Nothing lblNmFile.Text = "" lblNmFile1.Text = "" lblSize.Text = "" lblSize1.Text = "" cmdSimpan.Enabled = False cmdLoad.Enabled = True End Sub
Private Sub cmdSimpan_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles cmdSimpan.Click
cmdSimpan.Enabled = False Dim i As Integer
Dim str As String For i = 1 To 1000
If i < 10 Then str = "Picture_00" & i.ToString & ".jpg"
If i > 9 And i < 100 Then str = "Picture_0" & i.ToString & ".jpg" If i > 99 Then str = "Picture_" & i.ToString & ".jpg"
If i > 900 Then MsgBox("err")
If Not System.IO.File.Exists(str) Then Try
Pic3.Image.Save(str, _
System.Drawing.Imaging.ImageFormat.Jpeg) System.Drawing.Imaging.ImageFormat.Png)
lblNmFile1.Text = Application.StartupPath & "\" & str Catch Ex As Exception MsgBox("Gagal") End Try Exit For End If Next
Dim fileDetails As System.IO.FileInfo = New _ System.IO.FileInfo(lblNmFile1.Text) lblSize1.Text = fileDetails.Length.ToString
MsgBox("Gambar berhasil di simpan ...", MsgBoxStyle.OkOnly, _ "Save Sukses")
cmdLoad.Enabled = True End Sub
Private Sub frmEdges1_Load(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Load
cmdProses.Enabled = False cmdSimpan.Enabled = False cmdLoad.Focus()
End Sub End Class