Skip to content

hyunwoongko/low-saturation-image-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Low-Saturation-Image-Classifier

Use the K Means algorithm, one of the machine learning techniques, to classify whether the image has low saturation or not. Set the value of k to 3 to extract the three colors representing the whole image. Then, compare the RGB values of the three colors. If the RGB values are similar, they are classified as a grayscale image.


1. Gray Factor

Gray Factor is the basis of comparison. Add the absolute values ​​of R-G, R-B and G-B in all three colors representing the image. There are 3 values ​​per color and 9 values ​​are output. When all these values ​​are added, if it is over 125, it is classified as a color image. If it is lower than 125, it is classified as a grayscale.


2. Test

2-1. Color Image


grayfactor is 470.433684348195
this image is color image


grayfactor is 220.00078428233624
this image is color image


grayfactor is 361.9403200650253
this image is color image


grayfactor is 394.7566669657726
this image is color image


grayfactor is 657.9671760918529
this image is color image


grayfactor is 206.07376379585685
this image is color image


grayfactor is 175.778811114855
this image is color image


grayfactor is 219.33294774865516
this image is color image


grayfactor is 120.08708814516638
this image is grayscale image


grayfactor is 166.23216016614876
this image is color image


2-2. Low Saturation Image


grayfactor is 74.21911310513414
this image is grayscale image


grayfactor is 16.921373829598963
this image is grayscale image


grayfactor is 74.8569993561774
this image is grayscale image


grayfactor is 21.336244560550085
this image is grayscale image


grayfactor is 39.46925756428328
this image is grayscale image


grayfactor is 83.9590711276494
this image is grayscale image


grayfactor is 50.64524879463909
this image is grayscale image


grayfactor is 29.222783415229628
this image is grayscale image


grayfactor is 44.29888605893774
this image is grayscale image


grayfactor is 30.120887800532955
this image is grayscale image

2-3. Test Accuracy

The test resulted in 19 images classification is correct out of a total of 20 images. An accuracy of 95% indicates that this classifier works correctly.

About

Classifier whether the image has low saturation or not

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages