如何使用MATLAB提取图像元数据?

问题描述 投票:1回答:2

如何使用MATLAB提取曝光,宽度,高度或位深度等图像元数据?

直到最近我才使用exifread,但最新的MATLAB版本中不再存在此功能。

另一个功能是imfinfo,但它无法读取“曝光数据”图像。

如何阅读“曝光”图像?

image matlab metadata exif
2个回答
1
投票

exifread()在9年前被弃用了。它已被imfinfo取代

info = imfinfo(filename)将返回您想要的所有信息。

来自Matlab reference

某些文件格式返回的其他字段:

仅限JPEG和TIFF - 如果文件名包含可交换图像文件格式(EXIF)标记,则info还可能包含“DigitalCamera”或“GPSInfo”(全球定位系统信息)字段。

info.Widthinfo.Heightinfo.BitDepth。曝光时间以及所有其他相机参数都存储在1x1 struct info.DigitalCamera

这是一个例子

https://de.mathworks.com/matlabcentral/answers/146651-missing-functionality-when-using-imfinfo-instead-of-exifread

>> info = imfinfo('img_1771.jpg')
info = 
            Filename: 'C:\Users\fhempel\Desktop\tmp\img_1771.jpg'
         FileModDate: '07-Aug-2014 12:09:45'
            FileSize: 32764
              Format: 'jpg'
       FormatVersion: ''
               Width: 480
              Height: 360
            BitDepth: 24
           ColorType: 'truecolor'
     FormatSignature: ''
     NumberOfSamples: 3
        CodingMethod: 'Huffman'
       CodingProcess: 'Sequential'
             Comment: {}
                Make: 'Canon'
               Model: 'Canon PowerShot S40'
         Orientation: 1
         XResolution: 180
         YResolution: 180
      ResolutionUnit: 'Inch'
            DateTime: '2003:12:14 12:01:44'
    YCbCrPositioning: 'Centered'
       DigitalCamera: [1x1 struct]
       ExifThumbnail: [1x1 struct]


>> info.DigitalCamera
ans = 
                ExposureTime: 0.0020
                     FNumber: 4.9000
                 ExifVersion: [48 50 50 48]
            DateTimeOriginal: '2003:12:14 12:01:44'
           DateTimeDigitized: '2003:12:14 12:01:44'
     ComponentsConfiguration: 'YCbCr'
      CompressedBitsPerPixel: 5
           ShutterSpeedValue: 8.9688
               ApertureValue: 4.6563
           ExposureBiasValue: 0
            MaxApertureValue: 2.9709
                MeteringMode: 'CenterWeightedAverage'
                       Flash: 'Flash did not fire, no strobe return detection function, auto flash mode, f...'
                 FocalLength: 21.3125
                   MakerNote: [1x450 double]
                 UserComment: [1x264 double]
             FlashpixVersion: [48 49 48 48]
                  ColorSpace: 'sRGB'
            CPixelXDimension: 2272
            CPixelYDimension: 1704
         InteroperabilityIFD: [1x1 struct]
       FocalPlaneXResolution: 8.1143e+03
       FocalPlaneYResolution: 8.1143e+03
    FocalPlaneResolutionUnit: 2
               SensingMethod: 'One-chip color area sensor'
                  FileSource: 'DSC'
              CustomRendered: 'Normal process'
                ExposureMode: 'Auto exposure'
                WhiteBalance: 'Auto white balance'
            DigitalZoomRatio: 1
            SceneCaptureType: 'Standard'

0
投票

您认为缺少的所有信息都存储在iminfo中,只是区别对待。您想要的大多数参数(包括曝光数据)都在

info=iminfo(fname);
info.DigitalCamera
© www.soinside.com 2019 - 2024. All rights reserved.