首页 > 解决方案 > 在 Matlab 中读取 DNG 文件

问题描述

我正在尝试从 iphoneX 读取 dng 文件。我阅读了链接https://blogs.mathworks.com/steve/2011/03/08/tips-for-reading-a-camera-raw-file-into-matlab/ 但错误消息是“参考非现有字段“SubIFDs”。

info=imfinfo(dng_file_path);
info.SubIFDs{1} %where the error pop up
tiffHandle=Tiff((dng_file_path),'r');
offsets=TiffHandle.getTag('SubIFD');
setSubDirectory(TiffHandle,offsets(1));
CFA=double(read(TiffHandle));

标签: matlabdng

解决方案


来自 iphone 的 DNG 文件似乎被压缩(无损 jpeg 压缩)。尝试通过 DNG Converter 运行文件,并将首选项设置为未压缩。然后在 Matlab 中尝试。


推荐阅读