Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
irp
HoloTomoToolbox
Commits
27f98c87
Commit
27f98c87
authored
Oct 09, 2019
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
functions/generators/addPoissonNoise.m
View file @
27f98c87
...
...
@@ -58,8 +58,15 @@ if nargin < 2
photonsPerPixel
=
10000
;
end
imNoisy
=
zeros
(
size
(
im
),
'like'
,
im
);
% imnoise needs double as input
if
~
isa
(
im
,
'double'
)
im
=
double
(
im
);
end
poissonFactor
=
1e-12
*
photonsPerPixel
;
imNoisy
=
(
1.
/
poissonFactor
)
*
imnoise
(
poissonFactor
*
im
,
'poisson'
);
imNoisy
(:)
=
(
1.
/
poissonFactor
)
*
imnoise
(
poissonFactor
*
im
,
'poisson'
);
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment