elerac / polanalyser

Polarization image analysis tool. Demosaicing, Stokes vector, Mueller matrix.
MIT License
149 stars 26 forks source link

Update mueller.py for calibration matrix #6

Closed WillisAllen closed 1 year ago

WillisAllen commented 1 year ago

Code implementation of the paper https://doi.org/10.1364/AO.46.008533 modified for Meuller matrices. Not sure if the number of singular values is correct, the paper uses 4 for calibrating a Stokes polarimeter, I used 9 or 16 depending if the matrix is (3,3) or (4,4). Also not sure how to save the W calibration matrix after it's calculated. This code is untested.

WillisAllen commented 1 year ago

I've added example code and an explanation for how to produce a calibration matrix and save it to a file then load and use it to calculate the Mueller matrix. Also fixed some errors in the formatting and added in the methods to save and load a calibration file. Not sure how to save json files so I implemented it using a csv.

WillisAllen commented 1 year ago

The calibration file I added should allow for calibration of Mueller matrices and Stokes vectors with the use of reference samples. Code is untested.