【发布时间】:2014-09-10 08:25:30
【问题描述】:
我有一张医疗 16 未签名 jpeg 图像,我需要在 python 中读取它。 对于我的项目,这些图像只能用 mathlab 读取我需要读取它的实际像素值,并且需要对这些值进行一些数学运算。 您可以在以下链接中找到图片
https://drive.google.com/file/d/0B4l5GiM7kBXraDEyMXdseENfUlE/edit?usp=sharing
当我被要求在 mathlab 中获取图像信息时,会出现以下描述。
i = imfinfo('di.jpg')
i =
Filename: [1x56 char]
FileModDate: '14-Jul-2014 15:22:13'
FileSize: 1044064
Format: 'jpg'
FormatVersion: ''
Width: 1024
Height: 1024
BitDepth: 16
ColorType: 'grayscale'
FormatSignature: ''
NumberOfSamples: 1
CodingMethod: 'Huffman'
CodingProcess: 'Lossless'
Comment: {'Created by AccuSoft Corp.'}
我已经使用 matplotlib、opencv、scikitImage、scipy、medpy、PIL 库在 python 中读取这个图像。 我无法阅读这些类型的图片。
当我在 python 中使用时,出现以下错误 代码: 导入图片 img = Image.open('di.jpg') 打印(图片)
raise IOError("cannot identify image file")
IOError: cannot identify image file
请帮忙解决我的问题
【问题讨论】:
-
为什么不用matlab把它写成.mat文件,用scipy读取这个文件?
-
我正在开发一个需要读写和计算值的项目,该项目将在基于服务器的环境中运行。所以请给我一个方法而不是数学实验室
-
我不熟悉这类数据,但也许你应该看看
GDCM,看看你能不能用那个工具解决你的问题。好像有python wrapper,不过没仔细看。
标签: python image opencv matplotlib