#66: Add Distance Enum to choose between ROOT_MEAN_SQUARE and PEARSON_CORRELATION
This commit is contained in:
@@ -33,6 +33,19 @@ class Denoiser(Enum):
|
||||
def __str__(self):
|
||||
return self.name.lower()
|
||||
|
||||
class Distance(Enum)
|
||||
ROOT_MEAN_SQUARE = auto()
|
||||
PEARSON_CORRELATION = auto()
|
||||
|
||||
def __str__(self):
|
||||
return self.name.lower()
|
||||
|
||||
def getEndUserName(self):
|
||||
return self.name.replace('_', '').title()
|
||||
|
||||
def getPearsonCorrelation(firstImage, secondImage):
|
||||
return abs(scipy.stats.pearsonr(firstImage.flatten(), secondImage.flatten()).statistic - 1)
|
||||
|
||||
# Source: https://stackoverflow.com/a/43346070
|
||||
def getGaussianKernel(size, sigma):
|
||||
axis = np.linspace(-(size - 1) / 2., (size - 1) / 2., size)
|
||||
|
||||
Reference in New Issue
Block a user