taniaReyesM / color_cloth

color_cloth gets the main colors and its proportions from a cloth image ignoring the background, it uses the EM algorithm from OpenCV library, the algorithm needs an image with an item in the center of the picture.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

color_cloth

color_cloth gets the main colors and its proportions from a cloth image using the EM algorithm from OpenCV library, it assumes that the item is in the center of the image.

Prerequisites

  • numpy: pip install numpy
  • openCV: pip install opencv

e.g.

Image clustering with GMM...
$ python color_cloth.py <path/to/image>

Some examples...
$ python color_cloth.py images/29.jpg
Estampado

$ python color_cloth.py images/8.jpg
sombra

$ python color_cloth.py images/azul.jpg
prenda lisa

Some images with complex background, the algorithm ignores the colors and shadows in the background and shows only the color of the cloth:

$ python color_cloth.py images/22.jpg
Chamarra piel

$ python color_cloth.py images/v.jpg
Blusa verde

About

color_cloth gets the main colors and its proportions from a cloth image ignoring the background, it uses the EM algorithm from OpenCV library, the algorithm needs an image with an item in the center of the picture.


Languages

Language:Python 100.0%