#63: use scipy.stats.pearsonr
This commit is contained in:
parent
1a910d2e2c
commit
5e6702e007
@ -7,6 +7,7 @@ from utils import denoise, iterativeMean, getColorChannel, escapeFilePath, Color
|
||||
import sys
|
||||
import os
|
||||
import random
|
||||
import scipy
|
||||
|
||||
sys.path.insert(0, '../../algorithms/distance/')
|
||||
|
||||
@ -138,8 +139,7 @@ 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 = abs(np.corrcoef(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex].flatten(), camerasIterativeMean[camera].mean.flatten()) - 1)
|
||||
#distance = rmsDiffNumpy(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex], camerasIterativeMean[camera].mean)
|
||||
distance = abs(scipy.stats.pearsonr(cameraTestingImagesNoise[actualCamera][cameraTestingImageIndex].flatten(), camerasIterativeMean[camera].mean.flatten()).statistic - 1)
|
||||
print(f'{cameraTestingImageIndex=} {camera=} {actualCamera=} {distance=}')
|
||||
if minimalDistance is None or distance < minimalDistance:
|
||||
minimalDistance = distance
|
||||
|
Loading…
x
Reference in New Issue
Block a user