IMPLEMENTATION OF K-NEAREST NEIGHBOR FOR COLOR CLASSIFICATION
IMPLEMENTASI K-NEAREST NEIGHBOR UNTUK KLASIFIKASI WARNA
DOI:
https://doi.org/10.59134/jisni.v4i2.124Keywords:
computer vision, color detection, euclidean distance, openCV, phytonAbstract
The human eye's ability to identify colors has subjective limitations and is influenced by fatigue and ambient lighting conditions. This study aims to design and test a computer vision-based automatic color detection system using the Python programming language and the OpenCV library. The research method used was a laboratory experiment with a quantitative approach. The system was developed using the Euclidean distance algorithm to calculate the proximity input Red, Green, and Blue (RGB) pixel values to a reference database containing 865 standard color names. Testing was carried out using a dataset under various lighting conditions.The test results showed high effectiveness, with an average Macro Average Precision of 97.12%, Recall of 97.11%, and Total System Accuracy of 97.11%. The conclusion of this study is that the Python-based color detection system with the using the Euclidean distance algorithm is valid and effective for standardizing color identification, with the note that optimization or normalization of lighting in dim environments is necessary.
References
[1] D. N. Fajar Paksi, “Warna Dalam Dunia Visual,” IMAJI Film Fotogr. Telev. Media Baru, vol. 12, no. 2, pp. 90–97, Jul. 2021, doi: 10.52290/i.v12i2.49.
[2] R. Arista, “POTENSI BLOOMING ALGA PADA AIR SUNGAI DI DESA JUMENENG KECAMATAN MOJOANYAR KABUPATEN MOJOKERTO,” vol. 1, no. 1, 2025.
[3] L. Farokhah, “Implementasi K-Nearest Neighbor untuk Klasifikasi Bunga Dengan Ekstraksi Fitur Warna RGB,” J. Teknol. Inf. Dan Ilmu Komput., vol. 7, no. 6, pp. 1129–1136, Dec. 2020, doi: 10.25126/jtiik.2020722608.
[4] D. Irfansyah, N. Ruseno, and A. Yani, “PENERAPAN COMPUTER VISION DALAM SISTEM KEAMANAN BERBASIS ARTIFICIAL INTELLIGENCE (AI), ROBOTIK, DAN OTOMATISASI,” vol. 1, no. 1, 2025.
[5] N. Puspitasari, A. Septiarini, and A. R. Aliudin, “METODE K-NEAREST NEIGHBOR DAN FITUR WARNA UNTUK KLASIFIKASI DAUN SIRIH BERDASARKAN CITRA DIGITAL,” PROSISKO J. Pengemb. Ris. Dan Obs. Sist. Komput., vol. 10, no. 2, pp. 165–172, Aug. 2023, doi: 10.30656/prosisko.v10i2.6924.
[6] R. Helilintar, “K-Nears Neigbours”.
[7] W. McKinney, Python for data analysis: data wrangling with pandas, NumPy, and Jupyter, Third edition. Beijing Boston Farnham Sebastopol Tokyo: O’Reilly, 2022.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Riama Sibarani, Muhamad Saefudin, Sukarno Bahat Nauli

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.



