Get Pixel dimensions

Hello,
I'm coming with another question about the data structure.
Is there a way to get the sensor pixel dimensions? Maybe through a indirect way, using some useful parameters?

Forums: 

imgdata.sizes.raw_width/raw

imgdata.sizes.raw_width/raw_height are not enough?

-- Alex Tutubalin @LibRaw LLC

For many (but not all)

For many (but not all) cameras LibRaw parses sensor physical size type (full frame, APS-C) into imgdata.lens.makernotes.CameraFormat

You may use this field and pixel dimensions (raw_width, raw_height) to estimate pixel pitch.

-- Alex Tutubalin @LibRaw LLC

Thanks Alex.

Thanks Alex.
I will try this way.

Where I can find the

Where I can find the explanation of the field ? ==1 (Canon APS-C?), == 2 (FF ?)

EDIT: I found it.
enum LibRaw_camera_formats
{
LIBRAW_FORMAT_APSC = 1,
LIBRAW_FORMAT_FF = 2,
LIBRAW_FORMAT_MF = 3,
LIBRAW_FORMAT_APSH = 4,
LIBRAW_FORMAT_1INCH = 5,
LIBRAW_FORMAT_FT = 8
};

The resolution value, given

The resolution value, given in the link I gave you don't match with any field of libraw: width, iwidth nor raw_width.

I would expect that the

I would expect that the Sensor resolution width would match the raw_width, or the width value.
But I may be wrong.

For example
For Canon EOS 200D:
Sensor resolution width = 6026 pixels
Libraw:
width: 6022
raw_width: 6288

For Sony Alpha 7S:
Sensor resolution width = 4278 pixels
Libraw:
width: 4256
raw_width: 4288

Single pixel size error in

Single pixel size error in raw_width will result in distorted picture (like synchro loss on old analog TV), so raw_width/raw_height values are indeed right in LibRaw.

Visible (non masked) area is a matter of taste: LibRaw specifies 'as much as possible' (full visible area), while in-camera JPEGs (and, so, vendor advertized image size) may be slightly less than full area.

-- Alex Tutubalin @LibRaw LLC

OK, Thanks for the

OK, Thanks for the explanation.
If you would write the formula to compute (estimate) the pixel pitch then, would you use raw_width or width ?
raw_width seems to be more the good one but for canon it gives result pretty far from the vendor value:

pitch = 22.3/6288 * 1000 = 3.55 (while it is given to be 3.7)
At the opposite, for the Sony it gives better result.

Not that easy :).

I don't see any practical

I don't see any practical sense in getting the exact pixel pitch value. Any approximated value is good enough

-- Alex Tutubalin @LibRaw LLC

The only way to get the

The only way to get the accurate number for that is to look it up in the sensor data sheet. Raw file may contain virtual pixels, and may not contain all the physical pixels.

--
Iliah Borg

Mhhh ok.

Mhhh ok.
So I will keep my estimation using sizes.width I guess.