From 715b5296c9b702829e51d93d33a890043b52642a Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Tue, 11 Jun 2024 17:54:29 +0200 Subject: [PATCH] Compare PRNUs --- datasets/raise/fft/verify_dots.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/datasets/raise/fft/verify_dots.py b/datasets/raise/fft/verify_dots.py index bb4c40a..db1f468 100644 --- a/datasets/raise/fft/verify_dots.py +++ b/datasets/raise/fft/verify_dots.py @@ -6,7 +6,7 @@ import sys sys.path.insert(0, '../') -from utils import isARawImage, Color, getColorChannel, mergeSingleColorChannelImagesAccordingToBayerFilter, iterativeMean +from utils import isARawImage, Color, getColorChannel, mergeSingleColorChannelImagesAccordingToBayerFilter, iterativeMean, getPearsonCorrelationDistance FOLDERS = { 'Rafael 23/04/24': '../rafael/230424', @@ -34,7 +34,15 @@ def getEstimatedPrnu(folder): estimatedPrnu.add(imageMergedColorChannels - meanImages.mean) return estimatedPrnu.mean -estimatedPrnu = getEstimatedPrnu(FOLDERS['Rafael 23/04/24']) +estimatedPrnus = {folderName: getEstimatedPrnu(folder) for folderName, folder in FOLDERS.items()} -plt.imshow(estimatedPrnu) +# TODO: largest common crop + +print(f'{corr(estimatedPrnus["Rafael 23/04/24"], estimatedPrnus["Rafael 23/04/24"])=}') +print(f'{corr(estimatedPrnus["Rafael 23/04/24"], estimatedPrnus["RAISE flat-field"])=}') +print(f'{corr(estimatedPrnus["RAISE flat-field"], estimatedPrnus["Rafael 23/04/24"])=}') +print(f'{corr(estimatedPrnus["Rafael 23/04/24"], estimatedPrnus["RAISE not flat-field"])=}') +print(f'{corr(estimatedPrnus["RAISE flat-field"], estimatedPrnus["RAISE not flat-field"])=}') + +plt.imshow(estimatedPrnus['RAISE flat-field']) plt.show() \ No newline at end of file