Sony IMX sensors in machine vision camera

Hello everybody, We use machine vision camera's for taking automated photo's and want to use the raw image (rather than the JPEG) to increase picture quality. The camera's using sensors like Sony IMX304 and other models. Not the sort of sensors that are used in photo camera's. What is the best reoute to use LibRaw? Thanks in advance.
Regards Pim


if your image is 'raw dump'

if your image is 'raw dump' (so just bytes from sensor), LibRaw::open_bayer is for you.

It is not well documented, use samples/openbayer_sample.cpp and Changelog.txt as a reference

-- Alex Tutubalin @LibRaw LLC

If, on top of this, you also

If, on top of this, you also need accurate color reproduction, an alternative approach would be to construct a DNG from your raw bytestream, e.g. in 2 steps:
1) see e.g. rawtopgm from netpbm tools, or use ImageMagick/GraphicsMagick raw 'GRAY' format to convert to a widely known and simple PGM
2) use (adjust metadata accordingly in the source or using e.g. exiftool afterwards); see also

However, you'd need some (not so trivial) sensor characterization work to be able to fill the DNG metadata (basically build your own DCP). LibRaw would need this information anyway even if you went with the open_bayer() route and want more accurate color reproduction. The upside of the DNG route is that you can use many more processors/libraries in the future.