Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CHNZYX committed Oct 30, 2023
1 parent d983710 commit ee868db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gui/choose.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def start(_e):
int(config.debug_mode),
int(config.show_map_mode),
int(config.speed_mode),
1,
unlock = True,
bonus=config.bonus,
gui=1,
)
Expand Down
4 changes: 2 additions & 2 deletions states.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from utils.mylib import get_direc_only_minimap, ban, isrun

# 版本号
version = "v5.82 Omega"
version = "v5.9 Max"


class SimulatedUniverse(UniverseUtils):
Expand Down Expand Up @@ -301,7 +301,7 @@ def normal(self):
if res_up[1] == 2:
self.click(self.calc_point((0.5047, 0.5491), res_up[0]))
chose = 1
elif res_down[1] == 2 and (res_up[1] != 3 or self.fate != "毁灭"):
elif res_down[1] == 2:
self.click(self.calc_point((0.5042, 0.3204), res_down[0]))
chose = 1
if not chose:
Expand Down
18 changes: 6 additions & 12 deletions utils/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,25 @@ def split_and_find(self,key_list,img,mode=None,bless_skip=1):
rcx,rcy,find=-1,-1,0
res=''
text_res=''
ff=0
for c,contour in enumerate(contours):
x, y, w, h = cv.boundingRect(contour)
if h==binary_image.shape[0] or w<55:
continue
roi = enhance_image[y:y+h, x:x+w]
cx = x + w // 2
cy = y + h // 2
if c == 0 and len(self.text.strip()) > 1:
rcx,rcy,find = cx,cy,1
self.input(roi)
res+='|'+self.text
if len(contours)>1:
if (self.sim('回归不等式') and bless_skip) or self.sim_list(['大乐透','普通八卦','愚者面具']):
ff=1
continue
#cv.imwrite('tmp'+str(c)+'.jpg',roi)
if (self.sim('回归不等式') and bless_skip) or self.sim_list(['大乐透','普通八卦','愚者面具','机械齿轮']):
continue
for i,text in enumerate(key_list):
if (self.sim(text) and prior>i) or rcx==-1:
rcx,rcy,find=cx,cy,1+(self.sim(text) and prior>i)
if self.sim(text) and prior>i:
rcx,rcy,find=cx,cy,2
text_res=text
if find==2:
prior=i
if ff and find==1:
find=3
if find<2:
text_res=''
print('识别结果:',res+'|',' 识别到:',text_res)
return (rcx-img.shape[1]//2,rcy-img.shape[0]//2),find

Expand Down

0 comments on commit ee868db

Please sign in to comment.