Skip to content

Commit 84a5482

Browse files
author
arch
committed
set action point at last max min point
1 parent 2a86d93 commit 84a5482

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

funscript_editor/algorithms/signalprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_local_max_and_min_idx(score :list, fps: int, shift_min :int = 0, shift_m
8080
for pos in range(len(score)):
8181
if score[pos] < avg[pos]:
8282
if tmp_min_idx < 0: tmp_min_idx = pos
83-
elif score[tmp_min_idx] > score[pos]: tmp_min_idx = pos
83+
elif score[tmp_min_idx] >= score[pos]: tmp_min_idx = pos
8484
elif tmp_min_idx >= 0:
8585
if tmp_min_idx >= -1*shift_min and tmp_min_idx + shift_min < len(score):
8686
result['min'].append(tmp_min_idx + shift_min)
@@ -90,7 +90,7 @@ def get_local_max_and_min_idx(score :list, fps: int, shift_min :int = 0, shift_m
9090

9191
if score[pos] > avg[pos]:
9292
if tmp_max_idx < 0: tmp_max_idx = pos
93-
elif score[tmp_max_idx] < score[pos]: tmp_max_idx = pos
93+
elif score[tmp_max_idx] <= score[pos]: tmp_max_idx = pos
9494
elif tmp_max_idx >= 0:
9595
if tmp_max_idx >= -1*shift_max and tmp_max_idx + shift_max < len(score):
9696
result['max'].append(tmp_max_idx + shift_max)

0 commit comments

Comments
 (0)