怎样把t[1]存在一个变量中?
for roi in rois:
for t in templates:
template = image.Image(t)
img.draw_rectangle(roi, thickness=1)
r = img.find_template(template, 0.70,roi, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r:
img.draw_rectangle(r, thickness=2)
img.draw_string(roi[0]+16,100, t[1],scale = 2,color=(255,0,0), mono_space = False)#打印到屏幕
print(t)我不懂你是要做什么。
直接
a = 0
for roi in rois:
for t in templates:
a = t[1]
template = image.Image(t)
img.draw_rectangle(roi, thickness=1)
r = img.find_template(template, 0.70,roi, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r:
img.draw_rectangle(r, thickness=2)
img.draw_string(roi[0]+16,100, t[1],scale = 2,color=(255,0,0), mono_space = False)#打印到屏幕
print(t)但是每次循环都会覆盖a,我不明白你要做什么。
对5位数字 每位分开识别,再组合出原来的数