Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pelletier/color_som

Self-Organizing Map Python implementation for images
https://github.com/pelletier/color_som

Last synced: about 1 month ago
JSON representation

Self-Organizing Map Python implementation for images

Awesome Lists containing this project

README

        

# SOM in Python for images

This is a very simple Python implementation of a
[Self-Organizing Map](http://en.wikipedia.org/wiki/Self-organizing_map)
for colors classification in a given image.

## Dependencies

* [Python 3](http://python.org/)
* [Pillow](http://pillow.readthedocs.org/en/latest/)

## Run

python som.py input_image.png output_image.png

## Example

### Input

![Lenna](lenna.png?raw=true)

### Output

![Result](result.png?raw=true)

## Warnings

* This was hacked together in about an hour.
* Only accepts square images.
* Quite slow.

## Improvement ideas

* Parallelize.
* Better weights initialization (for a cleaner output).
* Stop after convergence.
* Writer cleaner code / split into modules.
* Support non square images.

## License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2014 Thomas Pelletier

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.