diff --git a/color_calibration/requirements.txt b/color_calibration/requirements.txt index 711d080..a305b5a 100644 --- a/color_calibration/requirements.txt +++ b/color_calibration/requirements.txt @@ -1,2 +1,2 @@ -numpy==1.20.2 +numpy==1.22.0 tensorflow==2.4.1 diff --git a/hti/server/api/stacking_api.py b/hti/server/api/stacking_api.py index 9dbfda2..3cd3581 100644 --- a/hti/server/api/stacking_api.py +++ b/hti/server/api/stacking_api.py @@ -51,7 +51,7 @@ def post(self): Frame.interpolate_angles(frames) image_stacker = get_image_stacker() - image_stacker.light_frames = frames[:10] + image_stacker.light_frames = frames[:10] # TODO use all frames, provide a range option image_stacker.stack_image() # Update hash in app state so FE can react by reloading the preview @@ -69,7 +69,10 @@ class StackedImagePreviewApi(Resource): def get(self, stacked_image_hash): image_stacker = get_image_stacker() if image_stacker.get_stacked_image_hash() == stacked_image_hash: - image_data_png = image_stacker.get_stacked_image(format='png') + image_data_png = image_stacker.get_stacked_image( + format='png', + scale_factor=2 + ) return send_file(image_data_png, mimetype='image/png') # TODO hash is outdated - maybe update it with whatever is new? diff --git a/hti/server/stacking/image_stacker.py b/hti/server/stacking/image_stacker.py index 59fd58a..b5a217d 100644 --- a/hti/server/stacking/image_stacker.py +++ b/hti/server/stacking/image_stacker.py @@ -27,14 +27,17 @@ def __init__(self): def get_stacked_image_hash(self) -> str: """ Get a hash of all the parameters that went into stacked_image - so we can be smart about re-stacking only if settings change. + so we can be smart about re-stacking and fetching the updated + result only if any settings changed. """ # TODO crazy stupid hashing return str(len(self.light_frames)) @staticmethod def normalize_image(image): - + """ + Fit dynamic range found in the given image into [0;1]. + """ normalized_image = np.zeros(image.shape, dtype=image.dtype) for channel in range(image.shape[2]):