Closed pulga10 closed 1 year ago
You're right. If you want a physically correct simulation, you can simply do
noised_pipeline = expected_photons_per_pixel >> np.random.poisson
where expected_photons_per_pixel
can be calculated as simply as
expected_photons_per_pixel = optics(particles) * A + b
. b is ~100 for cmos, and A depends on your illumination.
The implementation of dt.Poisson
is a remnant from when deeptrack
was more focused on getting qualitatively reasonable results. The focus was on achieving reasonable results without knowing all the physical parameters of the system.
you can simply do
noised_pipeline = expected_photons_per_pixel >> np.random.poisson
Great, thanks for pointing me to the solution!
expected_photons_per_pixel = optics(particles) * A + b. b is ~100 for cmos, and A depends on your illumination.
What is b here and why is it ~100 for a CMOS?
It's the number of spurious detection your camera will make per frame, in the absence of any light. Differs from camera to camera. 100 I've found to be pretty reasonable for standard microscopy cameras, but you can tune it to your system of course!
Ah, I see. Read noise & dark current of modern CMOS is typically way beyond 10 electrons per pixel, so to me that's completely irrelevant. Thank you!
Could you elaborate a bit on the way you're adding Poisson noise to the simulated images? I think in principle it should be enough to just multiply
image
(centered around 1 with contrast deviations in percent) by the expected background level in photoelectrons and then pass it as argument tonp.random.poisson()
. I don't understand how to achieve this usingsnr
andbackground
as well as the concept behind your implementation.This is how it's implemented in the version I have installed: