You will probably want to record a separate background image where you are certain that no photons are present, which you can subtract from all other images so as not to overlap several measurements in one picture.
Let's take one of your subtracted images
SetDirectory[NotebookDirectory[]];
image = Import["im5Nx9y.png"]
There is noise as well as signal on this image. The noise is higher frequency than signal, which is good. To smooth out the noise, we can blur this image to some extent, but the pixel radius of the blur should be small enough as to not blur out the higher wavelength signal. After a bit of trial and error it seems that blurring with a radius of 25
pixels is most convenient:
blurred = Blur[image, 25]
Finally, we can take the mean and the standard deviation of all pixel values. Then we apply a transformation that sets all pixels in the range mean-5*stddev < pixel < mean+5*stddev
to be equal to the mean
, so that any features that are not dominant enough are completely flattened out:
data = ImageData[blurred];
mean = Mean[data // Flatten];
stddev = StandardDeviation[data // Flatten];
newdata =
Table[
data[[i, j]] /. pixel_ :> If[(mean - 5 stddev < pixel < mean + 5 stddev), mean, pixel]
, {i, 1, Length[data]}, {j, 1, Length[Transpose[data]]}];
newimage = Image[newdata]
This keeps only very prominent features, as desired.