Camera data

Hello,

first I'd like to say thanks for the great library.

I am creating a software tool for extracting the raw image data from Canon and Nikon cameras for further processing in scientific automation applications. I realized the sensor data extraction without problems. Now I would like to also extract all data that was stored by the camera. It is not so clear to me, what in the structure libraw_colordata_t was written by the camera and what is calculated by the library. Could you please give me some details on this for Canon and Nikon. Especially on cam_xyz, cam_mul, pre_mul, rgb_cam and curve.

Thanks

Forums: 

cam_mul is camera WB

cam_mul is camera WB multipliers. From camera.
cam_xyz, pre_mul and rgb_cam are from camera color profile, so from LibRaw.
curve is linear in Canon raws, and from camera for Nikon raws.

-- Alex Tutubalin

Thanks for the reply,

Thanks for the reply,
Is the camera color profile something static per model or is it something variable and an interpreter of the raw file needs?
Sorry, I am just providing a tool for data extraction. My knowledge about digital imaging is pretty limited..

D. Ackermann

For Canon/Nikon cameras,

For Canon/Nikon cameras, camera profile is static and defined in adobe_coeff() function (in internal/dcraw_common.cpp).
For some cameras (Olympus, Samsung, Phase One), and formats (DNG) camera profile is provided in RAW file (and enabled via params.use_camera_matrix=1)

-- Alex Tutubalin

I have one more question.

I have one more question.
I read the cam_mul from a cr2.
I got 1987 - 1253 - 2675 - 1253.
From what I read about White Balance Multipliers I was expecting Values in a range of 1.0 - 3.0.
Do I have to devide cam_mul by 1000?

D. Ackermann

Ah great!

Ah great!

One more thing I dont quite understand.
I read tone curve from a cr2. This is linear.
I read it from a NEF and it looks quite strange. It grows exponentially from 0 to about 770 and then continues a linear grow. Dos these values also have to undergo a calculation?

D. Ackermann

Raw tone curve is applied on

Raw tone curve is applied on LibRaw::unpack() (data extraction).
You may assume that data values are linear after unpack()

-- Alex Tutubalin

Are these the same white

Are these the same white balance multipliers that are used when setting:

RawProcessor.imgdata.params.use_camera_wb=1;

?

Yes (use_camera_wb fallbacks

Yes (use_camera_wb fallbacks to daylight if not camera wb present)

-- Alex Tutubalin