scriptorron / indi_pylibcamera

INDI libcamera driver made in Python
MIT License
13 stars 4 forks source link

incorrect camera information #7

Closed scriptorron closed 1 year ago

scriptorron commented 1 year ago

Pixel size, resolution, binning and focal length are needed by client software to calculate angle of view. Many tools (for instance PHD2, plate solver) will not work wihout correct values.

Libcamera reports UnitCellSize: (1550, 1550) and different raw modes for the HQ camera. For instance there is a raw mode:

 {'bit_depth': 12,
  'crop_limits': (0, 0, 4056, 3040),
  'exposure_limits': (114, 694422939, None),
  'format': SRGGB12_CSI2P,
  'fps': 10.0,
  'size': (4056, 3040),
  'unpacked': 'SRGGB12'}

This raw mode meets the features of the sensor chip: it has 4056 x 3040 pixel, each 1.55µm x 1.55µm.

But it also reports a second raw mode:

 {'bit_depth': 12,
  'crop_limits': (0, 0, 4056, 3040),
  'exposure_limits': (60, 674181621, None),
  'format': SRGGB12_CSI2P,
  'fps': 40.01,
  'size': (2028, 1520),
  'unpacked': 'SRGGB12'}

Resolution is half of the physical size (2028 x 1520 pixel). When comparing pictures of these two raw modes you can see that field of view is the same. This second raw mode must be a 2x subsampling or a 2x binning! When selecting this raw mode the driver must tell the client either binning: 2 or pixelsize: 3.1µm x 3.1µm (both would have same effect for angle of view). But how can the driver know that this raw mode is not a subframe? The information provided by libcamera does not tell this!

Workaround: When using the second raw mode manually configure the client software to use a pixel size of 3.1µm x 3.1µm or set focal length to half of the real value.