Dear Gitlab Users, for our upcoming upgrade to Gitlab v14, Gitlab will be unavailable on Thursday, 05.08.2021 from 5:00 pm to approximately 7:00 pm. Note that with v14, certain breaking changes will be introduced (

Commit 27f98c87 authored by Leon Merten Lohse's avatar Leon Merten Lohse
Browse files

fix problem with addPoissonNoise

addPoissonNoise now correctly handles input that is not "double"
parent 05c6125a
Pipeline #110660 passed with stage
in 1 minute and 17 seconds
......@@ -58,8 +58,15 @@ if nargin < 2
photonsPerPixel = 10000;
imNoisy = zeros(size(im), 'like', im);
% imnoise needs double as input
if ~isa(im, 'double')
im = double(im);
poissonFactor = 1e-12*photonsPerPixel;
imNoisy = (1./poissonFactor) * imnoise(poissonFactor * im,'poisson');
imNoisy(:) = (1./poissonFactor) * imnoise(poissonFactor * im,'poisson');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment