Skip to content

Commit 496741a

Browse files
author
arch
committed
fix param reset in opencv ui
1 parent a400d92 commit 496741a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

funscript_editor/ui/opencvui.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,12 @@ def get_video_projection_config(self, image :np.ndarray, projection: str) -> dic
647647

648648
if pressed_key == "'0'":
649649
config = copy.deepcopy(PROJECTION[projection])
650+
if config['parameter']['height'] == -1:
651+
scaling = config['parameter']['width'] / float(w)
652+
config['parameter']['height'] = round(h * scaling)
653+
elif config[projection]['parameter']['width'] == -1:
654+
scaling = config['parameter']['height'] / float(h)
655+
config['parameter']['width'] = round(w * scaling)
650656
parameter_changed = True
651657
break
652658

0 commit comments

Comments
 (0)