【问题标题】:How to extract image metadata using MATLAB?如何使用 MATLAB 提取图像元数据?
【发布时间】:2019-04-02 09:09:38
【问题描述】:

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

直到最近我还在使用exifread,但这个函数在最新的 MATLAB 版本中不再存在。

另一个函数是imfinfo,但它无法读取'EXPOSURE DATA'图像。

如何读取“曝光”图像?

【问题讨论】:

    标签: image matlab metadata exif


    【解决方案1】:

    exifread() 9 年前已弃用。已替换为imfinfo

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

    来自Matlab reference

    某些文件格式返回的附加字段:

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

    info.Widthinfo.Heightinfo.BitDepth。 曝光时间以及所有其他相机参数都存储在 1x1 结构 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'
    

    【讨论】:

      【解决方案2】:

      您认为自己丢失的所有信息都存储在iminfo 中,只是有所不同。你想要的大部分参数(包括曝光数据)都在

      info=iminfo(fname);
      info.DigitalCamera
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-24
        • 2011-08-04
        相关资源
        最近更新 更多