Robust_image_source_identif.../datasets
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
..
fake Apply Context-Adaptive Interpolator 2024-03-29 00:06:13 +01:00
noise_free_test_images Shorten figure titles 2024-04-02 11:03:47 +02:00
rafael/240424 Remove a commented print in plot_dates.py 2024-04-26 04:10:02 +02:00
raise Add iterativeMean to utils 2024-04-26 14:16:35 +02:00
vision Add datasets/fake/generate_dataset.py 2024-03-22 10:31:47 +01:00