Clean find_consecutive_most_similar_images.py

This commit is contained in:
Benjamin Loison 2024-05-31 12:12:14 +02:00
parent 0dd21ad34d
commit 4eb8841ebf
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -4,8 +4,6 @@ from tqdm import tqdm
folder = 'flat-field/NEF'
# Could focus on a given crop.
# Section I. of *Determining Image Origin and Integrity Using Sensor Noise*.
def dotProduct(X, Y):
return np.multiply(X, Y).sum()
@ -27,7 +25,6 @@ highestCorrelation = None
highestCorrelationFile = None
for file in tqdm(sorted(os.listdir(folder)), 'File'):
#print(file)
colorChannels = {}
for color in Color:
colorChannel = getColorChannel(f'{folder}/{file}', color)
@ -36,8 +33,6 @@ for file in tqdm(sorted(os.listdir(folder)), 'File'):
mergedSingleColorChannelImage = mergeSingleColorChannelImagesAccordingToBayerFilter(colorChannels)
if lastMergedSingleColorChannelImage is not None:
correlation = corr(mergedSingleColorChannelImage, lastMergedSingleColorChannelImage)
#print(correlation)
#break
if highestCorrelation is None or correlation > highestCorrelation:
highestCorrelation = correlation