Skip to main content

Using mainifest to improve a grayscale method based on Color-to-gray conversion using ISOMAP [Cui et al. 2010]

Project description

图像灰度化 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)    

灰度化结果

输入图像:

获取灰度图,输出图像:

*

for debug:

所有结果:

感谢

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

License

The MIT License 2017 (c) tody

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for SOMGraySclae, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size SOMGraySclae-1.0.1-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size SOMGraySclae-1.0.1.tar.gz (12.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page