Correct pearsonr import

This commit is contained in:
2024-06-11 17:53:34 +02:00
parent aa5c210539
commit c2cf139261

View File

@ -10,7 +10,7 @@ import builtins as __builtin__
from scipy.ndimage import gaussian_filter
import os
from skimage.restoration import estimate_sigma
from scipy import fftpack
from scipy import fftpack, stats
import imageio
class Color(Enum):
@ -44,7 +44,7 @@ class Distance(Enum):
return self.name.replace('_', '').title()
def getPearsonCorrelationDistance(firstImage, secondImage):
pearsonCorrelation = scipy.stats.pearsonr(firstImage.flatten(), secondImage.flatten()).statistic
pearsonCorrelation = stats.pearsonr(firstImage.flatten(), secondImage.flatten()).statistic
if pearsonCorrelation < 0:
print('Negative Pearson correlation, investigate further!')
exit(1)
@ -161,7 +161,6 @@ def getColorChannel(imageFilePath, color):
def escapeFilePath(filePath):
return filePath.replace('/', '_')
def getNewIndex(index, offset):
newIndex = (index - offset) * 2 + offset
return newIndex