Image segmentation using the k-means clustering method

Abstract

Ovaj rad istražuje primjenu algoritma k-srednjih vrijednosti u kontekstu segmentacije slika u HSV i RGB prostoru boja. Prvo poglavlje pruža teorijski pregled algoritma k-srednjih vrijednosti, objašnjavajući njegovo osnovno načelo i način rada. Nakon toga, rad se fokusira na praktičnu implementaciju algoritma u programskom jeziku C, što omogućava čitatelju dublje razumijevanje njegove primjene. Sljedeća dva poglavlja istražuju segmentaciju slika u HSV i RGB prostoru boja. HSV prostor boja često je bolji izbor za segmentaciju temeljenu na nijansama boja i svjetlini, dok je RGB prostor bolji za razdvajanje objekata sličnih boja (ne nužno istih), ali različitih svjetlina. Analizirane su prednosti i ograničenja ovih dvaju pristupa, uz naglasak na dobivene rezultate. Rezultati segmentacije pokazuju da je algoritam k-srednjih vrijednosti učinkovit alat za izdvajanje objekata na slikama, ali njegova uspješnost ovisi o različitim faktorima kao što su inicijalni centroidi i broj klastera. Također se ukazuje na potrebu za prilagodbom izbora prostora boja ovisno o konkretnoj primjeni. Konačno, zaključak rada sumira glavne nalaze i ističe važnost pažljivog odabira parametara i prostora boja prilikom primjene algoritma k-srednjih vrijednosti za segmentaciju slika. Naglašava se potreba za daljnjim istraživanjem i eksperimentiranjem kako bi se postigla optimizacija i poboljšanje ove metode za različite scenarije i primjene u budućnosti.This paper explores the usage of k-means algorithm for image segmentation in RGB and HSV colour space. In the first chapter, a theoretical overview of the algorithm is provided, explaining its basic principle and method of operation. Subsequently, the paper focuses on the practical implementation of the algorithm in C programming language. Practical implementation enables the reader to gain a deeper understanding of its real-world application. The following two chapters explore image segmentation in RGB and HSV colour spaces. HSV colour space is often the better choice for segmentation based on colour hues and brightness, while RGB space is a better choice for separating objects of similar colour (not necessarily of same colour) and different brightness. Advantages and limitations of the two approaches were analyzed, with an emphasis on the obtained results. The segmentation results demonstrate that the k-means clustering algorithm is an effective tool for extracting objects in images, but its success is greatly impacted by various factors such as initial centroids and the number of clusters. Additionally, there is an indication of the need to adapt the choice of color space depending on the specific application. In conclusion, the paper summarizes the main findings and highlights the importance of careful parameter and color space selection when applying the k-means clustering algorithm for image segmentation. There is an emphasis on the need for further research and experimentation to achieve optimization and improvement of this method for various scenarios and applications in the future

    Similar works