Repository navigation
Release notes
Polanalyser 3.1.0 introduces pa.raw2stokes(), a new function for joint demosaicing and denoising of Sony IMX250MYR RAW images. Across a wide range of capture conditions, it delivers higher-quality reconstructions than existing demosaicing methods.
Install the inference extra for your device. The model downloads on first use.
pip install "polanalyser[inference]" # CPU or Apple Silicon
# OR
pip install "polanalyser[inference-cuda]" # NVIDIA CUDAimport cv2
import numpy as np
import polanalyser as pa
raw = cv2.imread("street-sign.tiff", cv2.IMREAD_UNCHANGED)
raw = raw.astype(np.float32) / 4095.0 # Normalize right-aligned 12-bit RAW
stokes = pa.raw2stokes(raw)This release requires Python 3.10 or later.
Reconstruction examples
We compare Bilinear (pa.demosaicing()), PIDSR [1], and our method (pa.raw2stokes()) on the same RAW images captured with a Sony IMX250MYR sensor at 2448 × 2048 pixels. These results demonstrate the applicability of pa.raw2stokes() to real RAW reconstruction across different scenes and acquisition conditions.
You can try it yourself by downloading the original RAW images for all three comparisons.
Reference
[1] Zhou et al. PIDSR: Complementary Polarized Image Demosaicing and Super-Resolution. CVPR 2025.


