Not satisfying due to zero offset

This commit is contained in:
Benjamin Loison 2024-03-22 11:42:47 +01:00
parent c287d5f0ef
commit 92ede944c7
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -16,10 +16,11 @@ def randomImage(scale):
prnu = randomImage(scale = 1)
images = [randomImage(scale = 10) + prnu for _ in range(10)]
allImages = [prnu] + images
def toPilImage(npArray):
nonNegativeArray = npArray - np.min(npArray)
nonNegativeArray = np.round(255 * nonNegativeArray / np.max(nonNegativeArray))
nonNegativeArray = npArray - np.min(allImages)
nonNegativeArray = np.round(255 * nonNegativeArray / np.max(allImages))
return Image.fromarray(np.uint8(nonNegativeArray))
toPilImage(prnu).show()