Metadata-Version: 2.1
Name: SOMGraySclae
Version: 1.0.1
Summary: Using mainifest to improve a grayscale method based on Color-to-gray conversion using ISOMAP [Cui et al. 2010]
Home-page: https://github.com/freedomofme/Grayscale
Author: yelhuang
Author-email: xiegeixiong@gmail.com
License: UNKNOWN
Project-URL: Bug Reports, https://github.com/freedomofme/Grayscale/issues
Project-URL: Source, https://github.com/freedomofme/Grayscale
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: cycler (==0.10.0)
Requires-Dist: decorator (==4.4.1)
Requires-Dist: httplib2 (==0.14.0)
Requires-Dist: imageio (==2.6.1)
Requires-Dist: joblib (==0.14.0)
Requires-Dist: kiwisolver (==1.1.0)
Requires-Dist: matplotlib (==3.1.1)
Requires-Dist: networkx (==2.4)
Requires-Dist: nltk (==3.4.5)
Requires-Dist: numpy (==1.17.3)
Requires-Dist: opencv-python (==4.1.2.30)
Requires-Dist: pandas (==0.25.3)
Requires-Dist: Pillow (==6.2.1)
Requires-Dist: pyparsing (==2.4.4)
Requires-Dist: python-dateutil (==2.8.1)
Requires-Dist: pytz (==2019.3)
Requires-Dist: PyWavelets (==1.1.1)
Requires-Dist: scikit-image (==0.16.2)
Requires-Dist: scikit-learn (==0.21.3)
Requires-Dist: scipy (==1.3.1)
Requires-Dist: six (==1.13.0)
Requires-Dist: sklearn (==0.0)


图像灰度化  Image Grayscale
====

本文的图像灰度化实现主要基于：

1. Data-driven Color Manifolds [Nguyen et al. 2015].
2. Color-to-gray conversion using ISOMAP [Cui et al. 2010].
3. 一种快速映射Isomap算法 [圣少友 et al. 2009].

使用方法:
===

##### 获取灰度图
    gray, gray_reverse = som.get_gray_scal(os.path.dirname(__file__) + '/datasets/apple/apple_0.png')
    plt.imsave(os.path.dirname(__file__) + '/gray.png', gray, cmap='gray',vmin = 0, vmax = 1)
    plt.imsave(os.path.dirname(__file__) + '/gray_reverse.png', gray, cmap='gray', vmin=0, vmax=1)
##### 获取一维流形：
    som = SOMGraySclae()
    manifest_1d = som.get_1d_manifold(os.path.dirname(__file__) + '/datasets/apple/apple_0.png')
    plt.imsave(os.path.dirname(__file__) + '/manifest_1d.png', manifest_1d, cmap='gray', vmin=0, vmax=1)

##### 获取二维流形：
    som = SOMGraySclae()
    manifest_2d = som.get_2d_manifold(os.path.dirname(__file__) + '/datasets/apple/apple_0.png')
    plt.imsave(os.path.dirname(__file__) + '/manifest_2d.png', manifest_2d, cmap='gray', vmin=0, vmax=1)

##### 获取debug plt：
    som = SOMGraySclae()
    som.color_to_gray_debug(os.path.dirname(__file__) + '/datasets/apple/apple_0.png',
                       gray_name='gray', gray_reverse_name='gray_reverse', debug=True)    

灰度化结果
===

#### 输入图像：

![](https://raw.githubusercontent.com/freedomofme/Grayscale/master//som_cm/datasets/apple/apple_0.png)

#### 获取灰度图，输出图像：

*
![](https://raw.githubusercontent.com/freedomofme/Grayscale/master/som_cm/results/gray.png)
*
![](https://raw.githubusercontent.com/freedomofme/Grayscale/master/som_cm/results/gray_reverse.png)

#### for debug:
![](https://raw.githubusercontent.com/freedomofme/Grayscale/master/som_cm/results/gray_debug.png)

#### 所有结果：
![](https://raw.githubusercontent.com/freedomofme/Grayscale/master/som_cm/results/result_all.png)


感谢
===

项目中采用Nguyen等人的论文实现，基于以下开源项目：
[https://github.com/tody411/SOM-ColorManifolds](https://github.com/tody411/SOM-ColorManifolds)


## License

The MIT License 2017 (c) tody

