Compare commits
2 Commits
3f7b6bf21a
...
1a910d2e2c
Author | SHA1 | Date | |
---|---|---|---|
|
1a910d2e2c | ||
|
6ed57bc477 |
@ -96,8 +96,7 @@ returnSingleColorChannelImage = lambda singleColorChannelImage, _minColor, _maxC
|
||||
# - the second one is about estimating better and better the PRNU of each camera, as consider more and more training images and measuring the resulting attribution of cameras
|
||||
for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else []) + [False], 'Compute extremes'):
|
||||
rescaleIfNeeded = returnSingleColorChannelImage if computeExtremes else rescaleRawImageForDenoiser
|
||||
# As the second loop firstly compute noises of testing images.
|
||||
# What about `MEAN` denoiser condition?
|
||||
# As the second loop firstly if the denoiser is not `MEAN` or if `MEAN` predicts only on the whole training set, then compute noises of testing images.
|
||||
if not computeExtremes:
|
||||
print(f'{minColor=} {maxColor=}')
|
||||
if DENOISER != Denoiser.MEAN or PREDICT_ONLY_ON_WHOLE_TRAINING_SET:
|
||||
@ -139,7 +138,8 @@ for computeExtremes in tqdm(([True] if minColor is None or maxColor is None else
|
||||
#plt.imsave(f'{escapeFilePath(actualCamera)}_{cameraTestingImageIndex}.png', cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex])
|
||||
# Loop over each camera to compute closeness between the considered testing image noise and the estimated PRNUs of the various cameras.
|
||||
for camera in IMAGES_CAMERAS_FOLDER:
|
||||
distance = rmsDiffNumpy(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex], camerasIterativeMean[camera].mean)
|
||||
distance = abs(np.corrcoef(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex].flatten(), camerasIterativeMean[camera].mean.flatten()) - 1)
|
||||
#distance = rmsDiffNumpy(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex], camerasIterativeMean[camera].mean)
|
||||
print(f'{cameraTestingImageIndex=} {camera=} {actualCamera=} {distance=}')
|
||||
if minimalDistance is None or distance < minimalDistance:
|
||||
minimalDistance = distance
|
||||
|
Loading…
Reference in New Issue
Block a user