Skip to content

Commit a5bf783

Browse files
committed
Fix: EVENT_SHOP_SCROLL tweaking
1 parent 2967243 commit a5bf783

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

module/shop_event/ui.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ def match_color(self, main):
2929
image = rgb2luma(image)
3030
cv2.bitwise_not(image, dst=image)
3131
image = image.flatten()
32-
wlen = area[2] - area[0]
32+
width = area[2] - area[0]
3333
parameters = {
34-
'height': (100, 200),
35-
'prominence': 35,
36-
# 'wlen': wlen,
37-
'width': 1
34+
'prominence': 60,
35+
'wlen': 2 * width + 1,
3836
}
3937
parameters.update(self.parameters)
4038
peaks, _ = signal.find_peaks(image, **parameters)
41-
peaks //= wlen
39+
peaks //= width
4240
self.length = len(peaks)
4341
mask = np.zeros((self.total,), dtype=np.bool_)
4442
mask[peaks] = 1
@@ -50,8 +48,6 @@ def match_color(self, main):
5048
background=2,
5149
name="EVENT_SHOP_SCROLL"
5250
)
53-
EVENT_SHOP_SCROLL.drag_threshold = 0.18
54-
EVENT_SHOP_SCROLL.edge_threshold = 0.18
5551

5652

5753
if server.server == 'tw':

0 commit comments

Comments
 (0)