Skip to content

Commit cf0434f

Browse files
committed
rename main.py to main.pyw to suppress console window
1 parent 6621519 commit cf0434f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

main.py renamed to main.pyw

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def __init__(self):
2525

2626
self.initDPIAware()
2727

28+
# set tesseract path
29+
pytesseract.pytesseract.tesseract_cmd = r'./tesseract/tesseract.exe'
30+
2831
# Get list of all opened windows
2932
# WindowCapture.list_window_names()
3033
# exit()
@@ -51,8 +54,8 @@ def __init__(self):
5154

5255
# print(enhance_equipment_text)
5356

54-
cv.imshow('Enhance equipment region', enhance_equipment_region)
55-
cv.imshow('Enhance equipment bw', enhance_equipment_bw)
57+
# cv.imshow('Enhance equipment region', enhance_equipment_region)
58+
# cv.imshow('Enhance equipment bw', enhance_equipment_bw)
5659

5760
if enhance_equipment_text == 'Enhance Equipment' or enhance_equipment_text == 'Substat Modification':
5861
enhance_page_detector.update_value(True)
@@ -93,22 +96,22 @@ def __init__(self):
9396
gear_enhance_region = screengrabber.crop_image_around(screenshot, "gear enhance")
9497
gear_type_region = screengrabber.crop_image_around(screenshot, "gear type")
9598

96-
gear_level_bw = screengrabber.transform_image_bw(gear_level_region, 175)
99+
gear_level_bw = screengrabber.transform_image_bw(gear_level_region, 150)
97100
gear_enhance_bw = screengrabber.transform_image_bw(gear_enhance_region, 200)
98101
gear_type_bw = screengrabber.transform_image_bw(gear_type_region, 30)
99102

100103

101104

102-
cv.imshow('Computer Vision', screenshot)
103-
cv.imshow('CV substat roll region bw', substat_roll_region_bw)
104-
cv.imshow('CV black and white substat region', substat_text_region_bw)
105-
cv.imshow('CV gear level bw', gear_level_bw)
106-
cv.imshow('CV gear enhance bw', gear_enhance_bw)
107-
cv.imshow('CV gear type', gear_type_bw)
105+
# cv.imshow('Computer Vision', screenshot)
106+
# cv.imshow('CV substat roll region bw', substat_roll_region_bw)
107+
# cv.imshow('CV black and white substat region', substat_text_region_bw)
108+
# cv.imshow('CV gear level bw', gear_level_bw)
109+
# cv.imshow('CV gear enhance bw', gear_enhance_bw)
110+
# cv.imshow('CV gear type', gear_type_bw)
108111

109112
# debug the loop rate
110-
print('FPS {}'.format(1 / (time.time() - loop_time)))
111-
loop_time = time.time()
113+
# print('FPS {}'.format(1 / (time.time() - loop_time)))
114+
# loop_time = time.time()
112115

113116
# tesseract ocr code
114117
substat_text_config = r"--psm 6 --oem 3"
@@ -124,7 +127,7 @@ def __init__(self):
124127
substat_roll = pytesseract.image_to_string(substat_roll_region_bw, config=substat_roll_config, output_type=pytesseract.Output.STRING)
125128
# print(substat_roll)
126129
gear_level_text = pytesseract.image_to_string(gear_level_bw, config=gear_level_config, output_type=pytesseract.Output.STRING)
127-
# print(gear_level_text)
130+
print(gear_level_text)
128131
gear_enhance_text = pytesseract.image_to_string(gear_enhance_bw, config=gear_enhance_config, output_type=pytesseract.Output.STRING)
129132
# print(gear_enhance_text)
130133
gear_type_text = pytesseract.image_to_string(gear_type_bw, config=gear_type_config, output_type=pytesseract.Output.STRING)

0 commit comments

Comments
 (0)