How to get Raw data from CR2 format. page4 - MakerNote and SensorInfo

since:Aug 31,2014
last update:Sep 6,2014
previous page : next page

> > >



3.5 MakerNote and SensorInfo

Below is the partial result of parsing MakerNote by exiftool (command option -v3)
In this section the important data is SensorInfo (TAG 0x00E0).


  | | + [MakerNotes directory with 39 entries]
  | | | 0)  CanonCameraSettings (SubDirectory) -->
  | | |     - Tag 0x0001 (98 bytes, int16u[49] read as undef[98]):

*SNIP*

  | | | 22) ColorSpace = 1
  | | |     - Tag 0x00b4 (2 bytes, int16u[1]):
  | | |         04ea: 01 00                                           [..]
  | | | 23) VRDOffset = 0
  | | |     - Tag 0x00d0 (4 bytes, int32u[1]):
  | | |         04f6: 00 00 00 00                                     [....]
  | | | 24) SensorInfo (SubDirectory) -->
  | | |     - Tag 0x00e0 (34 bytes, int16u[17] read as undef[34]):
  | | |         1526: 22 00 e0 14 bc 0d 01 00 01 00 98 00 38 00 d7 14 ["...........8...]
  | | |         1536: b7 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         1546: 00 00                                           [..]
  | | | + [BinaryData directory, 34 bytes]
  | | | | SensorWidth = 5344
  | | | | - Tag 0x0001 (2 bytes, int16s[1]):
  | | | |     1528: e0 14                                           [..]
  | | | | SensorHeight = 3516
  | | | | - Tag 0x0002 (2 bytes, int16s[1]):
  | | | |     152a: bc 0d                                           [..]
  | | | | SensorLeftBorder = 152
  | | | | - Tag 0x0005 (2 bytes, int16s[1]):
  | | | |     1530: 98 00                                           [..]
  | | | | SensorTopBorder = 56
  | | | | - Tag 0x0006 (2 bytes, int16s[1]):
  | | | |     1532: 38 00                                           [8.]
  | | | | SensorRightBorder = 5335
  | | | | - Tag 0x0007 (2 bytes, int16s[1]):
  | | | |     1534: d7 14                                           [..]
  | | | | SensorBottomBorder = 3511
  | | | | - Tag 0x0008 (2 bytes, int16s[1]):
  | | | |     1536: b7 0d                                           [..]
  | | | | BlackMaskLeftBorder = 0
  | | | | - Tag 0x0009 (2 bytes, int16s[1]):
  | | | |     1538: 00 00                                           [..]
  | | | | BlackMaskTopBorder = 0
  | | | | - Tag 0x000a (2 bytes, int16s[1]):
  | | | |     153a: 00 00                                           [..]
  | | | | BlackMaskRightBorder = 0
  | | | | - Tag 0x000b (2 bytes, int16s[1]):
  | | | |     153c: 00 00                                           [..]
  | | | | BlackMaskBottomBorder = 0
  | | | | - Tag 0x000c (2 bytes, int16s[1]):
  | | | |     153e: 00 00                                           [..]
*SNIP*


In the sample, SensorInfo exists at address0x0000 1526 and this length is 0x22 byte.


In "Understanding What is stored in a Canon RAW .CR2 file, How and Why", this is the structure which consists of 17 SHORT type data as following table.

SensorInfo
Offset(byte)namenote
0x02sensorWidth
0x04sensorHeight
0x0AsensorLeftBorder
0x0CsensorTopBorder
0x0EsensorRightBorder
0x10sensorBottomBorder
0x12blackMaskLeftBorderNot in use (Kiss X5/600D/REBEL T3i)
0x14blackMaskTopBorderNot in use (Kiss X5/600D/REBEL T3i)
0x16blackMaskRightBorderNot in use (Kiss X5/600D/REBEL T3i)
0x18blackMaskBottomBorderNot in use (Kiss X5/600D/REBEL T3i)

In the sample, sensorWidth is 0x14E0(=5344), sensorHeight is 0x0DBC(=3516). So the sensor size is 5344x3516 (width x height).

And sensorLeftBorder is 0x0098, sensorRightBorder is 0x14D7. The effective image width is 0x1440=5184px.

And sensorTopBorder is 0x0038, sensorBottomBorder is 0x0DB7. The effective image height is 0xD80=3456px.

This size (5184x3456)is same as Raw image size in catalog specification of EOS Kiss X5/600D/REBEL T3i.

By the way, real effective size is wider than catalog specification. Actually, an active area size of DNG file converted from this CR2 file is 5202x3466.
However, I don't know yet how to get this information only from CR2 file.

If you would like to get only raw data, it is enough to get SensorInfo data. But if you would like to develope raw data into viewable image, you should also get other data such as color balance (TAG 0x4001) etc in this section.


next page : IFD1 and IFD2

previous page [1] [2] [3] [4] [5] [6] [7] [8] [9] next page