Matrix-masking to balance nonuniform illumination in microscopy.
With a perfectly uniform illumination, the amount and concentration of fluorophores in any (biological) sample can be read directly from fluorescence micrographs. However, non-uniform illumination in optical micrographs is a common, yet avoidable artefact, often caused by the setup of the microscope, or by inherent properties caused by the nature of the sample. In this paper, we demonstrate simple matrix-based methods using the common computing environments MATLAB and Python to correct nonuniform illumination, using either a background image or extracting illumination information directly from the sample image, together with subsequent image processing. We compare the processes, algorithms, and results obtained from both MATLAB (commercially available) and Python (freeware). Additionally, we validate our method by evaluating commonly used alternative approaches, demonstrating that the best nonuniform illumination correction can be achieved when a separate background image is available.