Color polarization reconstruction
In Polanalyser, pa.raw2stokes() uses this model to jointly demosaic and denoise a Sony IMX250MYR RAW mosaic and reconstruct a color Stokes vector per pixel.
Use
Pass a float32 mosaic of shape (H,W) in native orientation, scaled to [0,1] by the delivered sensor white code. H and W must each be at least four. The top-left pixel must have canonical sensor phase (red, 90 degrees). Keep the recorded black level and capture white balance. For a region of interest, align both origin coordinates to multiples of four.
The ONNX input is named raw. The float32 output stokes has shape (H,W,3,3), BGR color order, and S0/S1/S2 on the final axis. The output preserves capture white balance and has no display transformation. This model was developed for color polarization mosaics. Monochrome cameras require a different reconstruction method.
Model artifacts
raw2stokes-fp32.onnxuses FP32.raw2stokes-mixed_fp16.onnxuses half precision for convolutional features and keeps local averaging and Stokes conversion in FP32.
Example RAW images
Download street-sign.tiff to try the model, or browse all three example captures. Each TIFF contains a single right-aligned 12-bit mosaic in a uint16 channel. Normalize by 4095 before inference.
Licenses
The two ONNX models are licensed under the Apache License 2.0. The three sample TIFFs in examples/imx250myr/ are licensed under CC BY 4.0. When sharing the sample images, credit the Polanalyser project, link to the source and license, and indicate any changes.