fixed to get enough blink to recover
This commit is contained in:
niart120 2022-01-09 02:09:23 +09:00
parent 06340c0d24
commit 404a89533c
3 changed files with 10 additions and 9 deletions

View File

@ -45,12 +45,11 @@ def getS_munchlax(intervals):
t = getTrans() t = getTrans()
t_ = getTrans() t_ = getTrans()
s = np.zeros((128,128),"uint8") s = np.zeros((144,128),"uint8")
safe_intervals = [] safe_intervals = []
for i in range(32): for i in range(36):
#intervals[-1]を挿入した際のインデックスが奇数だと危険な値の可能性がある #intervals[-1]を挿入した際のインデックスが奇数だと危険な値の可能性がある
is_carriable = bisect(section,intervals[-1])%2==1 is_carriable = bisect(section,intervals[-1])%2==1
while is_carriable: while is_carriable:
#スキップする #スキップする
t = t@t_%2 t = t@t_%2
@ -86,6 +85,7 @@ def gauss_jordan(mat,observed:list):
res[j],res[pivot] = res[pivot],res[j] res[j],res[pivot] = res[pivot],res[j]
if isfound: if isfound:
pivot += 1 pivot += 1
for i in range(c): for i in range(c):
check = 1<<(c-i-1) check = 1<<(c-i-1)
assert bitmat[i]&check>0 assert bitmat[i]&check>0

View File

@ -33,7 +33,7 @@ def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40)->Tuple[
state = IDLE state = IDLE
blinks = [] blinks = []
intervals = [] intervals = []
prev_time = 0 prev_time = time.perf_counter()
prev_roi = None prev_roi = None
debug_txt = "" debug_txt = ""
@ -115,7 +115,8 @@ def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60)->Tuple[List[
if (roi==prev_roi).all(): if (roi==prev_roi).all():
continue continue
prev_roi = roi prev_roi = roi
cv2.imshow("",roi)
cv2.waitKey(1)
res = cv2.matchTemplate(roi,eye,cv2.TM_CCOEFF_NORMED) res = cv2.matchTemplate(roi,eye,cv2.TM_CCOEFF_NORMED)
_, match, _, _ = cv2.minMaxLoc(res) _, match, _, _ = cv2.minMaxLoc(res)

View File

@ -29,7 +29,7 @@ def expr():
if munch_eye is None: if munch_eye is None:
print("path is wrong") print("path is wrong")
return return
gombe_intervals = rngtool.tracking_poke_blink(munch_eye, 730, 670, 50, 60) gombe_intervals = rngtool.tracking_poke_blink(munch_eye, 730, 670, 50, 60, 64)
interval_prng = rngtool.recovByMunchlax(gombe_intervals) interval_prng = rngtool.recovByMunchlax(gombe_intervals)
state = interval_prng.getState() state = interval_prng.getState()
@ -38,14 +38,14 @@ def expr():
#timecounter reset #timecounter reset
advances = 0 advances = 0
id_prng = Xorshift(*interval_prng.getState()) id_prng = Xorshift(*interval_prng.getState())
id_prng.getNextRandSequence(1) id_prng.next()
waituntil = time.perf_counter() waituntil = time.perf_counter()
#ID予測開始 #ID予測開始
while True: while True:
advances += 1 advances += 1
r = interval_prng.next() interval = interval_prng.rangefloat(3.0,12.0) + 0.285
interval = randrange(r, 100, 370)/30 - 0.048 #interval = interval_prng.range(3.0,12.0) + 0.285
waituntil += interval waituntil += interval
id_r = id_prng.next() id_r = id_prng.next()