Add and use showImageWithMatplotlib
This commit is contained in:
parent
8575da5b1d
commit
044d25cbaa
@ -32,16 +32,20 @@ allImages = np.max([np.max(prnus) + np.max(images)])
|
||||
def toPilImage(npArray):
|
||||
return Image.fromarray(npArray)
|
||||
|
||||
def showImage(npArray):
|
||||
def showImageWithPil(npArray):
|
||||
npArray -= npArray.min()
|
||||
npArray = (npArray / npArray.max()) * 255
|
||||
Image.fromarray(npArray).show()
|
||||
|
||||
def showImageWithMatplotlib(npArray):
|
||||
plt.imshow(npArray)
|
||||
plt.show()
|
||||
|
||||
prnusPil = [toPilImage(prnu) for prnu in prnus]
|
||||
#showImage(prnus[0])
|
||||
#showImageWithMatplotlib(prnus[0])
|
||||
|
||||
imagesPil = [[toPilImage(image) for image in images[phoneIndex]] for phoneIndex in range(NUMBER_OF_PHONES)]
|
||||
#showImage(images[0][0])
|
||||
#showImageWithMatplotlib(images[0][0])
|
||||
|
||||
# Compute CAI of phone images.
|
||||
caiImages = [[contextAdaptiveInterpolator(image.load(), image) for image in imagesPil[phoneIndex]] for phoneIndex in tqdm(range(NUMBER_OF_PHONES))]
|
||||
|
Loading…
Reference in New Issue
Block a user