A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 101
Backtrace:
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Router::$uri is deprecated
Filename: core/Router.php
Line Number: 127
Backtrace:
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$benchmark is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$hooks is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$config is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$log is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$utf8 is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$uri is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$exceptions is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$router is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$output is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$security is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$input is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$lang is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$load is deprecated
Filename: core/Controller.php
Line Number: 78
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$db is deprecated
Filename: core/Loader.php
Line Number: 396
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated
Filename: database/DB_driver.php
Line Number: 371
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 132
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 292
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 166
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 235
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 315
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 356
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 282
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 289
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 304
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 314
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 315
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 316
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 317
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 375
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: drivers/Session_files_driver.php
Line Number: 108
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 110
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_start(): Session cannot be started after headers have already been sent
Filename: Session/Session.php
Line Number: 143
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$session is deprecated
Filename: core/Loader.php
Line Number: 1283
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$form_validation is deprecated
Filename: core/Loader.php
Line Number: 1283
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 8
Function: __construct
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Welcome::$m_data is deprecated
Filename: core/Loader.php
Line Number: 358
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 11
Function: model
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$benchmark is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$hooks is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$config is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$log is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$utf8 is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$uri is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$exceptions is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$router is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$output is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$security is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$input is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$lang is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$load is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$db is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$session is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$form_validation is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$m_data is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/alfe6346/public_html/application/controllers/Welcome.php
Line: 187
Function: view
File: /home/alfe6346/public_html/index.php
Line: 315
Function: require_once
alf-printing Digital-Printing dan Media Pembelajaran
Cepat, Berkualitas, dan Terjangkau
Indonesia
Perbaikan Kualitas Citra (Image Enhancement)
1. Pengantar: Apa Itu Perbaikan Kualitas Citra? Perbaikan kualitas citra (Image Enhancement ) adalah proses untuk meningkatkan tampilan visual citra tanpa mengubah makna informasinya. Teknik ini digunakan dalam berbagai bidang, seperti medis, pengawasan, dan visi komputer (computer vision ).
Salah satu bentuk perbaikan citra adalah dengan mengubah tingkat kecerahan (brightness ) dan kontras (contrast ), serta memanfaatkan distribusi intensitas piksel melalui histogram .
2. Operasi Piksel (Pixel Operation) Operasi piksel merupakan dasar dari pengolahan citra digital. Setiap piksel pada citra diubah berdasarkan nilainya sendiri atau dalam hubungan dengan piksel di sekitarnya. Persamaan umum operasi brightness dan contrast dapat ditulis sebagai:
I'(x,y) = α × I(x,y) + βα (alpha) → pengatur kontrasβ (beta) → pengatur kecerahanImplementasi Python OpenCV:
import cv2
def adjust_bc(img, alpha=1.2, beta=20):
return cv2.convertScaleAbs(img, alpha=alpha, beta=beta)
3. Histogram Citra Histogram citra adalah grafik yang menunjukkan distribusi frekuensi nilai intensitas piksel (0–255). Pada citra grayscale, histogram memiliki satu kanal, sedangkan pada citra berwarna (RGB) terdiri dari tiga histogram terpisah: merah (R), hijau (G), dan biru (B).
Secara matematis, histogram h didefinisikan sebagai:
h(g) = jumlah piksel dengan nilai intensitas gContoh visualisasi histogram RGB:
colors = ['r', 'g', 'b']
for i, c in enumerate(colors):
data = img[:, :, i].ravel()
plt.hist(data, bins=256, range=(0, 255), color=c, alpha=0.5, label=c.upper())
plt.legend()
4. Perataan Histogram (Histogram Equalization) Tujuan utama dari Histogram Equalization adalah meratakan penyebaran nilai intensitas agar kontras citra meningkat. Metode ini mengubah tingkat keabuan piksel berdasarkan fungsi kumulatif dari distribusi histogram.
import cv2
def equalize_histogram(img):
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
return cv2.equalizeHist(gray)
Secara teoritis, fungsi transformasi dari intensitas r ke s adalah:
s = T(r) = (L - 1) × Σ p(r_j)di mana p(r_j) adalah probabilitas intensitas r_j dan L adalah jumlah tingkat keabuan (biasanya 256).
5. Contoh Implementasi GUI (Tkinter + OpenCV) Kode Python berikut menggabungkan OpenCV dan Tkinter untuk menampilkan hasil operasi citra secara interaktif:
tk.Button(bc_frame, text="Terapkan B/C", command=self.op_bc_apply).pack()
def op_bc_apply(self):
alpha = float(self.alpha_var.get())
beta = int(self.beta_var.get())
out = adjust_bc(self.img_rgb, alpha=alpha, beta=beta)
self._render(out, title=f"Brightness/Contrast (α={alpha:.2f}, β={beta})")
Hasilnya divisualisasikan bersama histogram yang terus diperbarui setiap kali pengguna menerapkan perubahan pada citra.
6. Hubungan dengan Deep Learning Teknik Image Enhancement juga menjadi bagian penting dalam tahap preprocessing pada model Convolutional Neural Networks (CNN) . Dengan citra yang lebih jelas dan kontras yang optimal, akurasi model dalam deteksi objek dan klasifikasi gambar akan meningkat.
Object Detection Face Recognition Image Classification 7. Kesimpulan Perbaikan kualitas citra adalah langkah penting dalam pengolahan citra digital. Dengan memahami operasi piksel, histogram, dan equalization, kita dapat meningkatkan tampilan serta mempersiapkan citra untuk proses analisis lebih lanjut seperti deep learning.
Brightness & Contrast → operasi dasar berbasis piksel. Histogram → analisis distribusi intensitas. Histogram Equalization → peningkatan kontras otomatis. © 2025 Alimin, M.Kom — Pengolaan Citra Digital
TUGAS PROJECT PERTEMUAN 5 :
Deskripsi Singkat : Mahasiswa membangun aplikasi GUI untuk pengolahan citra dasar: brightness/contrast , grayscale , histogram (RGB & grayscale), dan histogram equalization . Sertakan dokumentasi dan tangkapan layar
Tujuan Pembelajaran :
Menerapkan operasi piksel untuk mengatur brightness (β) dan contrast (α). Membangun visualisasi histogram (RGB & grayscale) dan menganalisis distribusi intensitas. Menerapkan Histogram Equalization untuk peningkatan kontras otomatis. Mengintegrasikan teori ke dalam GUI interaktif menggunakan Tkinter. Menulis laporan singkat seputar efek dan evaluasi hasil. Spesifikasi Tugas :
Fitur Deskripsi Modul Buka Gambar Pilih gambar dari komputer untuk diolah. tkinter.filedialogGrayscale Konversi RGB → Grayscale. cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)Brightness/Contrast Atur α (kontras) dan β (kecerahan) via slider. cv2.convertScaleAbs(img, alpha, beta)Histogram Tampilkan histogram grayscale/RGB. matplotlibHistogram Equalization Peningkatan kontras otomatis (grayscale). cv2.equalizeHist()Simpan Hasil Simpan citra hasil pengolahan. cv2.imwrite()
Teori Ringkas
Operasi Piksel Linier I'(x,y) = α · I(x,y) + βα (alpha): mengubah kontras (kemiringan). β (beta): mengubah kecerahan (pergeseran). Histogram h(g) = jumlah piksel dengan intensitas g, g ∈ [0, 255]Histogram Equalization s_k = T(r_k) = (L - 1) · Σ_{j=0..k} p(r_j)L adalah jumlah aras keabuan (biasanya 256); p(r_j) adalah probabilitas intensitas r_j .
Contoh Kode (Potongan)
import cv2
def adjust_bc(img, alpha=1.2, beta=20):
return cv2.convertScaleAbs(img, alpha=alpha, beta=beta)
def equalize_hist(img):
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
return cv2.equalizeHist(gray)
Desain GUI yang Disarankan Tombol: Buka Gambar , Grayscale , Brightness/Contrast , Equalize , Histogram , Simpan . Dua panel tampilan: (1) citra asli/hasil, (2) histogram. Slider untuk α dan β. Output & Laporan Screenshot setiap fitur utama dan hasilnya. Penjelasan efek operasi (misal: perbedaan histogram sebelum–sesudah equalization). File kode (.py atau .ipynb) dan 2–3 gambar contoh. Kriteria Penilaian Aspek Bobot Indikator Implementasi fitur 30% Berjalan tanpa error; sesuai spesifikasi. GUI & interaktivitas 25% Tata letak jelas; responsif. Analisis & dokumentasi 25% Laporan ringkas, fokus pada perbandingan hasil & histogram. Kreativitas 10% Tambahan: gamma correction, blur, CLAHE, dsb. Kerapian & orisinalitas 10% Struktur modular, komentar jelas.
Tantangan Opsional Gamma Correction : s = c · r^γ (bandingkan dengan equalization).Tambahkan CLAHE (Contrast Limited Adaptive Histogram Equalization) untuk mencegah over-contrast. Bandingkan histogram sebelum–sesudah untuk 3 jenis gambar berbeda (gelap, sangat kontras, dan berisik). Pengumpulan Nama berkas: Nama_NIM_ImageEnhancement.zip Isi: kode, laporan PDF (maks 4 halaman), gambar uji, dan README. Batas waktu: 7 hari setelah pengumuman tugas. Referensi Gonzalez & Woods — Digital Image Processing (4th ed.). Materi “Perbaikan Kualitas Citra (Image Enhancement)”. Dokumentasi OpenCV.