From c2862eaf439ae878193451dc3bdbf571506488e0 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Tue, 26 Mar 2024 01:55:08 +0100 Subject: [PATCH] #21: Incorrect mean, as it is a RMS mean, not a mean of images --- datasets/fake/generate_dataset.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/datasets/fake/generate_dataset.py b/datasets/fake/generate_dataset.py index 3233cce..30c7aa1 100644 --- a/datasets/fake/generate_dataset.py +++ b/datasets/fake/generate_dataset.py @@ -43,6 +43,20 @@ def showImageWithMatplotlib(npArray): plt.imshow(npArray) plt.show() +plt.title('RMS between actual PRNU and the mean of the first $N$ images with PRNU (i.e. estimated PRNU)') +plt.xlabel('$N$ first images with PRNU') +plt.ylabel('RMS') +rmss = [] +mean = 0 +for imageIndex in range(NUMBER_OF_IMAGES_PER_PHONE): + rms = rmsDiffNumpy(imagesWithPrnu[0][imageIndex], prnus[0]) + mean = ((mean * imageIndex) + rms) / (imageIndex + 1) + rmss += [mean] +plt.plot(rmss) +plt.show() + +## + NUMBER_OF_ROWS = 5 NUMBER_OF_COLUMNS = 3 fig, axes = plt.subplots(NUMBER_OF_ROWS, NUMBER_OF_COLUMNS)