Benjamin Loison
fd6a9868fe
Add mean
DENOISER
support
2024-05-03 02:47:43 +02:00
Benjamin Loison
9d33abcea3
Add necessary denoiser
argument
2024-05-03 02:45:27 +02:00
Benjamin Loison
82b14a8724
Uppercase constants
2024-05-03 02:43:56 +02:00
Benjamin Loison
4bea5e3a97
Move getImageNpArray
to utils.py
2024-05-03 02:32:05 +02:00
Benjamin Loison
790c0d6da4
Add and use getImageFilePath
2024-05-03 02:27:07 +02:00
Benjamin Loison
514413e1dd
Add and use getColorMeans
2024-05-03 02:21:01 +02:00
Benjamin Loison
01d18a4943
Rename means
to colorMeans
...
To be clearer for future `attribute_source_camera.py` usage.
2024-05-03 02:13:53 +02:00
Benjamin Loison
d8c7b8b0ef
Add and use getImagePrnuEstimatedNpArray
2024-05-03 02:03:59 +02:00
Benjamin Loison
878cff9aa2
Add and use getSingleColorChannelImages
2024-05-03 02:01:37 +02:00
Benjamin Loison
77b0b6dc6e
Make getMultipleColorsImage
also return singleColorChannelImages
2024-05-03 01:59:39 +02:00
Benjamin Loison
591d7dc74a
Make getImageFilePath
call implicit
2024-05-03 01:56:05 +02:00
Benjamin Loison
d696edeb3f
Add and use getMultipleColorsImage
2024-05-03 01:54:17 +02:00
Benjamin Loison
fcbccb3b5c
Add and use getImageFilePath
2024-05-03 01:49:54 +02:00
Benjamin Loison
b5b0cc4a7c
Remove no more meaningful progress
optional argument
2024-05-02 13:07:03 +02:00
Benjamin Loison
53c3935bab
Clean some debugging
2024-04-30 06:48:17 +02:00
Benjamin Loison
7a807b91d8
#63 : Add debugging
2024-04-30 06:45:28 +02:00
Benjamin Loison
a8725e5e88
Move denoising testing images to work even if provide minColor
and maxColor
( #63 )
2024-04-30 05:36:28 +02:00
Benjamin Loison
3c403dbed3
WIP ( #63 )
2024-04-30 05:31:14 +02:00
Benjamin Loison
b6425b426e
#63 : WIP
2024-04-30 05:01:05 +02:00
Benjamin Loison
319ca8fb60
Add attribute_source_camera.py
...
It is a modified copy of `split_and_compare_prnus_of_subgroups.py`.
2024-04-30 04:48:02 +02:00
Benjamin Loison
aa9f73e8a0
Fix random seed to improve reproducibility
2024-04-30 03:49:45 +02:00
Benjamin Loison
22fc4ce46b
Remove rescale for plt.imsave
as do not seem necessary anymore
2024-04-30 03:36:37 +02:00
Benjamin Loison
20fcb247c6
Simplify loops
...
The idea was initially in the context of #62 to optimize execution
speed.
2024-04-30 03:36:04 +02:00
Benjamin Loison
ad5aa22ae6
Add missing import
for saveNpArray
and add a missing f
-string
2024-04-30 03:35:30 +02:00
Benjamin Loison
c2a2dea2c7
Add a missing argument to getColorChannel
in extract_noise.py
2024-04-30 03:22:03 +02:00
Benjamin Loison
31b979edb3
Override print
to also print current time
2024-04-30 03:21:32 +02:00
Benjamin Loison
c9f75286bf
Make merge_single_color_channel_images_according_to_bayer_filter.py
...
virtual environment friendly
2024-04-30 03:20:44 +02:00
Benjamin Loison
ab9466c738
#62 : Optimize significantly mergeSingleColorChannelImagesAccordingToBayerFilter
2024-04-30 03:17:19 +02:00
Benjamin Loison
2d67c2bca1
Add and use rescaleRawImageForDenoiser
and updateExtremes
( #59 )
2024-04-30 02:04:17 +02:00
Benjamin Loison
671a692114
#59 : Save rmss
for futher investigations
...
For instance to plot a fair comparison, see [issues/59#issuecomment-1732](#59 (comment) ).
2024-04-30 01:04:33 +02:00
5647ab4019
#59 : Should make split_and_compare_prnus_of_subgroups.py
compatible with RAW images
2024-04-27 23:13:48 +02:00
9b2f2281e4
Make merge_single_color_channel_images_according_to_bayer_filter.py
more general
2024-04-27 22:57:29 +02:00
5ea0a862c0
Add and use getColorChannel
2024-04-27 21:49:32 +02:00
561ec9d1e0
Add and use escapeFilePath
2024-04-27 21:48:07 +02:00
b50f013234
Add and use isARawImage
2024-04-27 21:46:40 +02:00
a0fc38d023
Add and use getRawColorChannel
to utils.py
2024-04-27 20:47:33 +02:00
Benjamin Loison
80a33428d6
Make split_and_compare_prnus_of_subgroups.py
execution compatible with chaining shell commands
...
Otherwise it is stuck on `plt.show` until it is closed but we want to
chain with a notification command, so the notification is not
interesting in this case.
2024-04-27 19:36:45 +02:00
Benjamin Loison
9d8e5ddbec
Make split_and_compare_prnus_of_subgroups.py
only use 2 images of RAM
...
quantity
2024-04-27 19:24:12 +02:00
Benjamin Loison
4ac75448a6
Correct in theory the range of color values
2024-04-27 17:54:16 +02:00
Benjamin Loison
643fee9f4a
Make split_and_compare_prnus_of_subgroups.py
executable from terminal
...
Used to be only executable from Pyzo.
2024-04-27 16:55:03 +02:00
c8fe71444f
#59 : Leverage iterativeMean
to not suffer of RAM quantity issue
2024-04-27 16:49:06 +02:00
Benjamin Loison
6f6721da8d
Make merge_single_color_channel_images_according_to_bayer_filter.py
executable from terminal
...
Used to only run in Pyzo.
2024-04-27 16:20:02 +02:00
b0fa01c6c4
Remove potential chronological bias
2024-04-27 16:10:20 +02:00
e9dc28dc2a
Simplify and clean split_and_compare_prnus_of_subgroups.py
2024-04-27 16:06:47 +02:00
Benjamin Loison
ee7353cfde
Correct iterativeMean
implementation for images
...
Otherwise get:
```
Traceback (most recent call last):
File "/home/benjamin/robust_image_source_identification_on_modern_smartphones/datasets/raise/./extract_noise.py", line 148, in <module>
treatImage(imageFileName, color = color)
File "/home/benjamin/robust_image_source_identification_on_modern_smartphones/datasets/raise/./extract_noise.py", line 114, in treatImage
estimatedPrnuIterativeMean.add(imageNoiseNpArray)
File "/home/benjamin/robust_image_source_identification_on_modern_smartphones/datasets/raise/utils.py", line 34, in add
self.mean = ((self.mean * self.numberOfElementsInMean) + element) / (self.numberOfElementsInMean + 1)
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
```
2024-04-27 15:58:29 +02:00
5baabae99d
Make mean
initialization more general in iterativeMean
2024-04-26 15:56:10 +02:00
1ea1bde910
Leverage iterativeMean
in extract_noise.py
2024-04-26 14:25:08 +02:00
674f87d480
Remove unnecessary iterativeMean
parentheses and rename addElement
to add
2024-04-26 14:22:59 +02:00
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
7684e1408d
Remove unused import
s in split_and_compare_prnus_of_subgroups.py
2024-04-26 13:58:19 +02:00