Skip to content
Snippets Groups Projects
Commit 537b9b0d authored by Stephan Hilb's avatar Stephan Hilb
Browse files

fix noise generation

parent ace38b58
No related branches found
No related tags found
No related merge requests found
...@@ -894,7 +894,7 @@ function add_noise(img; noise_sigma, noise_p) ...@@ -894,7 +894,7 @@ function add_noise(img; noise_sigma, noise_p)
img_noisy = img .+ noise_sigma * randn(rng, Float64, size(img)) img_noisy = img .+ noise_sigma * randn(rng, Float64, size(img))
for i in eachindex(img) for i in eachindex(img)
if rand(rng) < noise_p if rand(rng) < noise_p
img_noisy[i] = rand(Bool) ? 1. : 0. img_noisy[i] = rand(rng, Bool) ? 1. : 0.
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment