pull/1246/head
Piero Toffanin 2021-03-24 11:25:11 -04:00
rodzic 8bf66b35cb
commit 42f544f561
2 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -534,12 +534,15 @@ def to_8bit(image, force_normalize=False):
# Convert to 8bit
try:
data_range = np.iinfo(image.dtype)
min_value = 0
value_range = float(data_range.max) - float(data_range.min)
except ValueError:
# For floats use the actual range of the image values
value_range = float(image.max()) - float(image.min())
min_value = float(image.min())
value_range = float(image.max()) - min_value
image = image.astype(np.float32)
image -= min_value
image *= 255.0 / value_range
np.around(image, out=image)
image[image > 255] = 255

Wyświetl plik

@ -14,7 +14,7 @@ def resize_to_match(image, match_photo = None):
image = cv2.resize(image, None,
fx=match_photo.width/w,
fy=match_photo.height/h,
interpolation=cv2.INTER_AREA)
interpolation=cv2.INTER_LANCZOS4)
return image
def dn_to_temperature(photo, image):