图像灰度化 Image Grayscale
本文的图像灰度化实现主要基于:
- Data-driven Color Manifolds [Nguyen et al. 2015].
- Color-to-gray conversion using ISOMAP [Cui et al. 2010].
- 一种快速映射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
Metadata
Release files for SOMGraySclae 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SOMGraySclae-1.0.1.tar.gz | 12.8 kB | Without provenance | Details for SOMGraySclae-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SOMGraySclae-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for SOMGraySclae-1.0.1-py3-none-any.whl |
Total release size: 29.8 kB
Release files / SOMGraySclae-1.0.1.tar.gz
| Download URL | SOMGraySclae-1.0.1.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a444010971e3d3dfe5ef708256c4c1747e4a345278df2041b091aeb6c2829742
|
|
BLAKE2b-256 checksum How to use checksums |
5a05d9b898ebac16c07424b7b400f2aeac71b403a0eb9372f2f808ba302667d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4
|
Release files / SOMGraySclae-1.0.1-py3-none-any.whl
| Download URL | SOMGraySclae-1.0.1-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33d878bbb0cfe68f27f46053768dcb0e53f4a02e7810a651f58dddef60a14731
|
|
BLAKE2b-256 checksum How to use checksums |
b4b5ad2c31e36f8cd52ffd54bb927c4488d833f69d8139c5dfb847145addd23f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4
|
Security for SOMGraySclae 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.