Matlab:原始图像DNG BitsPerSample 10不支持

时间:2015-03-19 16:11:35

标签: matlab tiff dng

正如Steve Eddin在http://blogs.mathworks.com/steve/2011/03/08/tips-for-reading-a-camera-raw-file-into-matlab/中发表的那样,我跟随并复制了下面的代码,在MATLAB 2014b中运行。结果,我收到以下错误。"不支持读取BitsPerSample为10的图像"。我检查了info和info.SubIFDs {1},我在INFOS中得到了以下结果。我在谷歌上搜索了这个问题,但没有足够的信息。因此,我在这里发布了这个问题,并希望有人给我解决方案。

CODE ::

warning off MATLAB:tifflib:TIFFReadDirectory:libraryWarning
t = Tiff('Non-Invasive DNGs/WP_20150311_15_03_14_Raw__highres.dng','r');
offsets = getTag(t,'SubIFD');
setSubDirectory(t,offsets(1));
cfa = read(t);
close(t);

ERROR ::

Error using Tiff.constructBlankOutputImage (line 2448)
Reading images with a BitsPerSample of 10 is not supported.

Error in Tiff/readAllStrips (line 2046)
            imageData = obj.constructBlankOutputImage(imageSize,bps,sampleFormat);

Error in Tiff/read (line 1507)
                [varargout{:}] = obj.readAllStrips();

Error in readDNG (line 11)
cfa = read(t);

INFOS_1 ::

                     FileSize: 43676288
                       Format: 'tif'
                FormatVersion: []
                        Width: 960
                       Height: 544
                     BitDepth: 24
                    ColorType: 'truecolor'
              FormatSignature: [73 73 42 0]
                    ByteOrder: 'little-endian'
               NewSubFileType: 1
                BitsPerSample: [8 8 8]
                  Compression: 'Uncompressed'
    PhotometricInterpretation: 'RGB'
                 StripOffsets: 69248
              SamplesPerPixel: 3
                 RowsPerStrip: 544
              StripByteCounts: 1566720
                  XResolution: []
                  YResolution: []
               ResolutionUnit: 'Inch'
                     Colormap: []
          PlanarConfiguration: 'Chunky'
                    TileWidth: []
                   TileLength: []
                  TileOffsets: []
               TileByteCounts: []
                  Orientation: 1
                    FillOrder: 1
             GrayResponseUnit: 0.0100
               MaxSampleValue: [255 255 255]
               MinSampleValue: [0 0 0]
                 Thresholding: 1
                       Offset: 8
                         Make: 'Nokia'
                        Model: 'Lumia 1020'
                     Software: 'Nokia RAW-to-DNG converter v01.00.06'
                     DateTime: '2015:03:11 15:03:11'
                      SubIFDs: {[1x1 struct]}
                DigitalCamera: [1x1 struct]
                   DNGVersion: [1 3 0 0]
           DNGBackwardVersion: [1 3 0 0]
            UniqueCameraModel: 'Nokia Lumia 1020'
                 ColorMatrix1: [1.6183 -0.7414 0.1000 -0.2665 1.1286 0.3664 0.1114 0.0951 0.8522]
                 ColorMatrix2: [0.9390 -0.1511 -0.0964 -0.3983 1.2153 0.1384 -0.0880 0.4120 0.5662]
           CameraCalibration1: [1.0361 0 0 0 1 0 0 0 0.9688]
           CameraCalibration2: [0.9851 0 0 0 0.9926 0 0 0 0.9763]
                AnalogBalance: [1 1 1]
                AsShotNeutral: [0.8476 1 0.6481]
             BaselineExposure: -1
                BaselineNoise: 1
            BaselineSharpness: 1
           LinearResponseUnit: 0.9999
                  ShadowScale: 1
               DNGPrivateData: [1x1246 double]
              MakerNoteSafety: 1
       CalibrationIlluminant1: 17
       CalibrationIlluminant2: 21
           AliasLayerMetadata: [58 48 51 58 49 49 32 49 53 58 48 51 58 49 49 0]
                  UnknownTags: [7x1 struct]

INFOS_2 :: SubIFDs {1}

                 FileSize: 43676288
                   Format: 'tif'
            FormatVersion: []
                    Width: 7728
                   Height: 4352
                 BitDepth: 10
                ColorType: 'CFA'
          FormatSignature: [73 73 42 0]
                ByteOrder: 'little-endian'
           NewSubFileType: 0
            BitsPerSample: 10
              Compression: 'Uncompressed'
PhotometricInterpretation: 'CFA'
             StripOffsets: 1635968
          SamplesPerPixel: 1
             RowsPerStrip: 4352
          StripByteCounts: 42040320
              XResolution: []
              YResolution: []
           ResolutionUnit: 'Inch'
                 Colormap: []
      PlanarConfiguration: 'Chunky'
                TileWidth: []
               TileLength: []
              TileOffsets: []
           TileByteCounts: []
              Orientation: 1
                FillOrder: 1
         GrayResponseUnit: 0.0100
           MaxSampleValue: 1023
           MinSampleValue: 0
             Thresholding: 1
                   Offset: 56578
            CFAPlaneColor: [0 1 2]
                CFALayout: 1
      BlackLevelRepeatDim: [2 2]
               BlackLevel: [0 0 0 0]
               WhiteLevel: 1023
             DefaultScale: [1 1]
        DefaultCropOrigin: [0 0]
          DefaultCropSize: [7728 4352]
          BayerGreenSplit: 1
        AntiAliasStrength: 1
         BestQualityScale: 1
              UnknownTags: [4x1 struct]

0 个答案:

没有答案