|
|
|
DiMAGE 5/7 RAW Format DiscoveryHeader
Description (as far as known), for those who like to write a program or play
around with it.
Two-byte integers have MSB first, LSB next order. In the table below locations and data are in HEX or else, when representing
strings, in ASCII. I'd like to thank Patrick for checking the information in the table below and
reporting some errors, which have been corrected by now.
Corrections made:
Reading Pixel ValuesThe data
from the D7 RAW file contains a picture of 2568 x 1928 pixels. Where:
The value of the pixel can be extracted: The pixel values range from 0 to 3965 (0000 to 0F7D). Somehow this value has been clipped at a maximum (white) of 3965 and so does not reach the maximum of the 12 bit value (0FFF = 4095).
Pixel ColorYou can
image having a memory buffer holding the complete raw file. Out of here we
calculated the offset where the image data starts. We may like to point into
that image data using two "indexing" variables, being the X-position and
Y-position. For determining the color that was captured at any location, the least significant bits of the values of the X and Y position where the pixel data is being peeked can be tested (see Bayer Pattern more below):
Bayer PatternThe Bayer pattern has a
red pixel in the far top-left of the image on the CCD. 2568 x 1928 pixels for a D7
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
0 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
|
0 |
R |
G |
R |
G |
R |
G |
R |
G |
|
1 |
G |
B |
G |
B |
G |
B |
G |
B |
|
0 |
R |
G |
R |
G |
R |
G |
R |
G |
|
1 |
G |
B |
G |
B |
G |
B |
G |
B |
|
0 |
R |
G |
R |
G |
R |
G |
R |
G |
|
1 |
G |
B |
G |
B |
G |
B |
G |
B |
|
0 |
R |
G |
R |
G |
R |
G |
R |
G |
|
1 |
G |
B |
G |
B |
G |
B |
G |
B |
The Bayer
pattern and coordinate lsb's.
The
interpolation of a Bayer pattern can be done using several methods. Usually, the
better the method, the more processor intensive the algorithm will be. The
internal processors of digital cameras should process images as quick as
possible. Therefore the used processing may not result in the best possible
image quality. A powerful PC can allow for a lot more processing power and time
to process an image. This will probably result in an outstanding quality of the
processed image.
Processing can be done in two ways: Web pages
for Bayer Pattern interpolation
This is an quick and dirty method, very good for previewing
a raw file.
This is an more extensive method, which is slower but takes
decisions depending on information from pixels in the neighborhood. There are a
number of know algorithms, each with their own advantages. I for myself,
preferred the "Variable number of gradients" method which is most slow. I
modified it so that more detail was obtained from an image. This was
accomplished by a "variable weight" of the measured pixels.
On the next web pages, more information can be found:
|
|
|
|
|
|
The zoom
value indicated on the lens is the 35mm equivalent.
The DIVU returns the
real value. This value range from 7.2 to 50.8 instead of from 28 to 200.
This is about a factor of four difference. (sqrt((24^2)+(36^2)) / 11 =
3.93333)
So be careful interpreting the calculated zoom value!
In macro
you will find approx. 50mm in the EXIF, while the lens indicates 200mm.
Compare the two pictures below.
The zoom value
indicated on the lens ranges from 7.2 to 50.8.
This is what the DIVU reports
too.