Robust_image_source_identif.../datasets/raise
Benjamin Loison 7af96d6bf6
Add iterativeMean to utils
Verified with:

```py
myIterativeMean = iterativeMean()
print(myIterativeMean.mean)
myIterativeMean.addElement(2)
print(myIterativeMean.mean)
myIterativeMean.addElement(3)
print(myIterativeMean.mean)
```

Note that cannot simplify as follows in the general case of using images as
`element`s for instance:

```diff
diff --git a/datasets/raise/utils.py b/datasets/raise/utils.py
index fba5523..a116edb 100644
--- a/datasets/raise/utils.py
+++ b/datasets/raise/utils.py
@@ -27,12 +27,9 @@ def denoise(imageNpArray, denoiserName):
     return imageDenoisedNpArray

 class iterativeMean():
-    mean = None
+    mean = 0
     numberOfElementsInMean = 0

     def addElement(self, element):
-        if self.mean is None:
-            self.mean = element
-        else:
-            self.mean = ((self.mean * self.numberOfElementsInMean) + element) / (self.numberOfElementsInMean + 1)
+        self.mean = ((self.mean * self.numberOfElementsInMean) + element) / (self.numberOfElementsInMean + 1)
         self.numberOfElementsInMean += 1
\ No newline at end of file
```
2024-04-26 14:16:35 +02:00
..
website Move webpage articles to datasets/raise/website/ 2024-04-02 18:31:27 +02:00
analyze_bayer_filter_mean_denoiser.py Remove commented code from analyze_bayer_filter_mean_denoiser.py 2024-04-26 04:13:08 +02:00
extract_noise.py Move denoise from extract_noise.py to utils.py 2024-04-26 13:57:18 +02:00
flat-field_pointer.py Improve yticks of boxplot in flat-field_pointer.py 2024-04-26 04:10:41 +02:00
generate_histogram.py Add commented code to crop image 2024-04-25 14:37:08 +02:00
merge_single_color_channel_images_according_to_bayer_filter.py Remove already used previous temporary analysis commit code 2024-04-26 13:49:31 +02:00
show_mean_noise.py Restore other than raw images support 2024-04-25 18:12:36 +02:00
split_and_compare_prnus_of_subgroups.py Remove unused imports in split_and_compare_prnus_of_subgroups.py 2024-04-26 13:58:19 +02:00
utils.py Add iterativeMean to utils 2024-04-26 14:16:35 +02:00