Content text MODUL WORKSHOP.pdf
DAFTAR ISI DAFTAR ISI ....................................................................................................................2 DAFTAR GAMBAR........................................................................................................3 DAFTAR TABEL.............................................................................................................5 1. PEMROSESAN CITRA MENGGUNAKAN GOOGLE COLABORATORY ..6 1.1. Pengenalan Library .............................................................................................6 1.2. Menggunakan Google Colaboratory...................................................................6 2. DASAR PEMROSESAN CITRA ...........................................................................7 2.1. Gambar Digital ...................................................................................................7 2.2. Operasi Membaca dan Menampilkan Gambar di Google Colaboratory ............8 3. MATERI 1 : SEGMENTASI CITRA .....................................................................9 3.1. Image Thresholding ............................................................................................9 3.2. Edge Detection..................................................................................................12 4. MATERI 2 : MORFOLOGI..................................................................................12 4.1. Transformasi Dilasi...........................................................................................13 4.2. Transformasi Erosi............................................................................................16 4.3. Transformasi Pembukaan (Opening) ................................................................19 4.4. Transformasi Penutupan (Closing) ...................................................................20 4.5. Transformasi Top-Hat .......................................................................................21 4.6. Transformasi Black-Hat....................................................................................22 5. MATERI 3 : KONTUR..........................................................................................23 5.1. Ekstraksi Kontur ...............................................................................................23 5.2. Penghampiran Kurva Poligon...........................................................................24 5.3. Perimeter dan Luas ...........................................................................................25 5.4. Kotak Pembatas ................................................................................................26 5.5. Lingkaran Pembatas..........................................................................................28 5.6. Fitur Pembentuk Suatu Objek...........................................................................29 5.7. Momen ..............................................................................................................31 5.8. Momen Hu ........................................................................................................37 5.9. Perbandingan Bentuk Objek .............................................................................38 6. MATERI 4 : OPTICAL CHARACTER RECOGNITION (OCR)....................40 6.1. Two-pass Text Recognition................................................................................40 7. KEGIATAN PASCA PELATIHAN ......................................................................42
DAFTAR GAMBAR Gambar 1. 1 Syntax Memanggil File dari Google Drive ................................................ 6 Gambar 1. 2 Syntax Menggunakan Path File dari Google Drive ................................... 7 Gambar 1. 3 Syntax Memanggil Library OpenCV dan Python ...................................... 7 Gambar 2. 1 Citra Biner.................................................................................................. 7 Gambar 2. 2 Representasi Warna pada Skala Keabuan .................................................. 7 Gambar 2. 3 Citra RGB................................................................................................... 8 Gambar 2. 4 Ruang Warna HSV ..................................................................................... 8 Gambar 2. 5 Syntax Pembacaan Citra ............................................................................ 8 Gambar 2. 6 Syntax Menampilkan Citra ........................................................................ 8 Gambar 3. 1 Perubahan Citra Grayscale Menjadi Citra Biner........................................ 9 Gambar 3. 2 Tampilan Hasil Pemrosesan Citra Menggunakan Mode Threshold Binary, Binary Inverse, Trunc, Tozero, dan Tozero Inverse........................................................ 10 Gambar 3. 3 Tampilan Hasil Pemrosesan pada Adaptive Thresholding ........................11 Gambar 3. 4 Tampilan Hasil Canny Edge Detection .................................................... 12 Gambar 4. 1 Proses Pelebaran Piksel Melalui Dilasi.................................................... 13 Gambar 4. 2 Contoh Pelebaran Objek Melalui Dilasi .................................................. 13 Gambar 4. 3 Efek Pelebaran Tulisan Melalui Dilasi..................................................... 14 Gambar 4. 4 Contoh Penyambungan Dua Bagian Terputus Melalui Dilasi ................. 14 Gambar 4. 5 Hasil Pembesaran Tulisan Dengan Dilasi ................................................ 15 Gambar 4. 6 Pembesaran Sebanyak 3 Kali Melalui Iterations = 3 ............................... 16 Gambar 4. 7 Efek Erosi................................................................................................. 16 Gambar 4. 8 Hasil Pengikisan Citra Menggunakan Erosi ............................................ 17 Gambar 4. 9 (a) Gambar asli sebelum diproses, (b) Gambar setelah dilakukan proses thresholding, (c) Gambar setelah diproses erosi menggunakan kernel 4x4, (d) Gambar setelah diproses erosi menggunakan kernel 4x4 ............................................................ 19 Gambar 4. 10 Transformasi Erosi (Atas) dan Penghalusan Pembukaan Pada Citra Struktur (Bawah) ............................................................................................................ 20 Gambar 4. 11 Hasil Penutupan Menggunakan Transformasi Penutupan...................... 21 Gambar 4. 12 Hasil Transformasi Top-Hat Pada Citra ................................................. 22 Gambar 4. 13 Hasil Transformasi Black-Hat Pada Citra .............................................. 23 Gambar 5. 1 Hasil Ekstraksi Kontur Pada Citra ........................................................... 24 Gambar 5. 2 Hasil Penghampiran Kurva Poligon Pada Citra ....................................... 25 Gambar 5. 3 Hasil Perimeter dan Luas Pada Citra ....................................................... 26 Gambar 5. 4 Perbedaan Bounding Box Citra dan Bounding Box Objek...................... 27 Gambar 5. 5 Hasil Kotak Pembatas Pada Citra ............................................................ 28
Gambar 5. 6 Hasil Lingkaran Pembatas Pada Citra...................................................... 28 Gambar 5. 7 Hasil Oval Pembatas Pada Citra .............................................................. 29 Gambar 5. 8 Hasil Perbandingan Kebulatan Pada Citra ............................................... 30 Gambar 5. 9 Hasil Perbandingan Rasio Aspek Pada Citra ........................................... 31 Gambar 5. 10 Matriks Citra Biner 4x4 ......................................................................... 32 Gambar 5. 11 Visualisasi Perhitungan Momen Spasial Untuk Citra Biner 4x4 ........... 32 Gambar 5. 12 Visualisasi Hasil Perhitungan M10/M00 Pada Citra Biner 4x4 ............... 34 Gambar 5. 13 Hasil Pemrosesan Momen Centroid Pada Citra ..................................... 35 Gambar 5. 14 Hasil Pemrosesan Momen Ternormalisasi Pada Citra ........................... 36 Gambar 5. 15 Hasil Pemrosesan Momen Hu Pada Citra .............................................. 38 Gambar 5. 16 Hasil Perbandingan Bentuk Objek Pada Citra ....................................... 39 Gambar 6. 1 Diagram Alir Pada Algoritma TESSERACT ........................................... 41 Gambar 6. 2 Hasil Optical Character Recognition Menggunakan TESSERACT Pada Citra ................................................................................................................................ 41