Real-Time Object Color Detection Using the HSV Method in Python
DOI:
https://doi.org/10.64803/ikosstemi.v1.32Kata Kunci:
Color Detection, HSV, pythonAbstrak
This study discusses real-time object color detection using the HSV (Hue, Saturation, Value) method in the Python programming language. A common problem in RGB-based color recognition is its high sensitivity to changes in light intensity, resulting in unstable detection results. Therefore, the HSV color space is used, which better aligns with human perception of color and is able to separate color (hue) information from lighting (value). By utilizing the HSV color space, the system can distinguish colors based on hue angles without being significantly affected by lighting levels. This approach is important because in real conditions, environmental lighting often changes, such as indoors or outdoors during the day and evening. The use of Python and the OpenCV library also facilitates the implementation of color detection algorithms with efficient computation time and interactive visualization results in real time. The research method was conducted experimentally using a laptop camera as video input, then each image frame was converted to the HSV color space. Next, a masking process was performed by determining the lower and upper limits of certain colors so that colored objects could be recognized. This stage is important to ensure that the system can recognize specific areas in the image that contain the target color. By creating an HSV range (threshold) for each color, the system will only display areas that match those criteria. This technique is often used in object tracking and color segmentation applications in the field of computer vision. The results of the study show that the system is able to accurately detect red, green, and blue objects with a success rate above 90% under normal lighting conditions. This system can be applied in robotics, surveillance systems, and computer vision-based industrial applications. This success demonstrates the great potential of the HSV method in various fields. In robotics, for example, color detection is used for autonomous navigation or path tracking. In surveillance systems, color can be an indicator of certain things, such as identifying dangerous objects. Meanwhile, in industry, this system can be used to separate products based on color in automated production lines.
Referensi
Pratama, A., & Nugroho, S. (2019). Application of HSV Color Space for Color Detection in Line Follower Robot Applications. Journal of Computer Technology and Systems, 7(3), 221–227.
Lestari, N., Utami, R., & Hidayat, D. (2020). Comparative Analysis of RGB and HSV Color Detection in Robotic Vision Systems. Informatics Journal, 14(2), 65–73.
Aulia, D., & Rahman, H. (2021). Implementation of Color Detection Using Python-Based OpenCV. Journal of Computer Science, 10(1), 33–40.
Alfarizi, F., & Nugraha, P. (2023). HSV Integration and Segmentation for Automatic Color Detection. Journal of Information Technology, 8(4), 142–150.
Mulyono, S. (2022). Application of HSV in Industrial Product Color Monitoring System. Journal of Systems Engineering, 6(2), 118–125.
Handoko, R., & Syahrial, M. (2020). Real-Time Object Tracking Using HSV Color Segmentation. International Journal of Computer Vision, 12(3), 201–210.
Wijaya, A., & Putra, Y. (2019). Color Detection Algorithm Based on HSV Model. Procedia Computer Science, 157, 350–358.
Siregar, R., & Lubis, T. (2021). Digital Image Analysis for HSV-Based Color Recognition. Journal of Technology and Computers, 5(1), 11–19.
Kim, J., & Lee, H. (2022). Improved Real-Time Color Recognition Using Adaptive HSV Thresholding. Journal of Visual Communication, 78, 233–240.
Ouchra, H., Belangour, A., & Erraissi, A. (2024). Supervised Machine Learning Algorithms for Color Classification in Computer Vision. Ingénierie Des Systèmes D'Information, 29(1), 377–387.
Unduhan
Diterbitkan
Terbitan
Bagian
Lisensi
Hak Cipta (c) 2025 Muhammad Farhan, Syahada Mawarda Hutagalung, Muhammad Alfariz Rasyid, Dafa Ikhwanu Shafa, Supiyandi (Author)

Artikel ini berlisensi Creative Commons Attribution 4.0 International License.






