小编ste*_*osn的帖子

你如何在python中读取32位TIFF图像?

我想用python读取32位浮点图像文件来做一些图像分析。

我试过了

import matplotlib.pyplot as plt

im = plt.imread('path_to_file.tif')
Run Code Online (Sandbox Code Playgroud)

但是,这只会将数据读取为 8 位整数值。有没有办法为 imread() 提供正确的数据类型?

-- 好吧,它以前可以使用 16 位 TIFF 文件开箱即用,但不适用于 32 位浮点数。

python 32-bit tiff image-processing matplotlib

4
推荐指数
3
解决办法
7487
查看次数

如何在 matplotlib 图像图中实现斐济“HiLo”颜色图,以标记曝光不足和曝光过度的像素

Matplotlib 的颜色图不提供图像的 HiLo 颜色图,这通常在显微镜中使用。HiLo 显示从低值到高值的灰度梯度,但低端的值显示为蓝色,上端的值显示为红色。

如何获得 matplotlib 图像的颜色图?

matplotlib imagej python-3.x colormap fiji

2
推荐指数
1
解决办法
492
查看次数

如何使用configparser从配置文件中读取大写字母的密钥?

使用python configparser包读取配置文件时,所有键名都是小写字符串.有人知道如何读取保留大写和大写单词的字符串吗?

例如:

$cat config.cfg 
[DEFAULT]
Key_1 = SomeWord
KEY_2 = Another Word

$ python3
>>> from configparser import ConfigParser
>>> cf = ConfigParser()
>>> cf.read('./config.cfg')
['./config.cfg']
>>> print(cf.defaults())
OrderedDict([('key_1', 'SomeWord'), ('key_2', 'Another Word')])
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

python configparser python-3.x

0
推荐指数
1
解决办法
851
查看次数