Skip to content

liuhuang31/simple_mainColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image main color extraction, iterative realization in k-means hsv

Installation Environment

pip install -r requirements.txt

Usage

come into PrimaryColor.py, then change the image path to yours, and run the code.

Results show

image image

main steps, details see the blog

Blog url (Chinese language) https://blog.csdn.net/lhh31/article/details/52015500

  1. Obtain image RGB
  2. Convert RGB to HSV spatial values
  3. K-means iteration in HSV space (the initial point is randomly selected based on the pixel range of the image)
  4. Display image (convert the clustered HSV values to RGB for display)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages