IMPLEMENTATION OF K-NEAREST NEIGHBOR FOR COLOR CLASSIFICATION: IMPLEMENTASI K-NEAREST NEIGHBOR UNTUK KLASIFIKASI WARNA - Riama Sibarani; Muhamad Saefudin; Sukarno Bahat Nauli (Jurnal Ilmiah Universitas Satya Negara Indonesia, 2026)
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.