Use np.clip
This commit is contained in:
parent
98426db9dd
commit
3a4100b779
@ -34,9 +34,8 @@ SPLIT_N_X_N_S = [1, 2, 4]
|
||||
fig, axes = plt.subplots(2, 4)
|
||||
fig.suptitle('PRNU estimation with different number of images having Gaussian noise and Gaussian noised PRNU')
|
||||
|
||||
def axisImShow(axis, im, vExtremes = [None, None]):
|
||||
vMin, vMax = vExtremes
|
||||
imShow = axis.imshow(im, vmin = vMin, vmax = vMax)
|
||||
def axisImShow(axis, im):
|
||||
imShow = axis.imshow(im)
|
||||
plt.colorbar(imShow, label = 'Intensity', ax = axis, orientation = 'horizontal')
|
||||
|
||||
for splitNXNIndex, splitNXN in enumerate(SPLIT_N_X_N_S):
|
||||
@ -82,7 +81,7 @@ for splitNXNIndex, splitNXN in enumerate(SPLIT_N_X_N_S):
|
||||
axisImShow(axis[2], np.clip(imageWithoutPrnuNpArray + imageNoise, 0, 255))
|
||||
|
||||
axis[3].set_title('Actual Gaussian noised PRNU\nClipped between -1 and 1')
|
||||
axisImShow(axis[3], prnuNpArray, [-1, 1])
|
||||
axisImShow(axis[3], np.clip(prnuNpArray, -1, 1))
|
||||
|
||||
axes[1][0].set_title('First image with Gaussian noise and PRNU\nClipped between 0 and 255')
|
||||
axisImShow(axes[1][0], np.clip(imageWithoutPrnuNpArray + prnuNpArray + imageNoise, 0, 255))
|
||||
|
Loading…
Reference in New Issue
Block a user