在模板匹配里怎么设置roi大小啊?
-
import time, sensor, image from image import SEARCH_EX, SEARCH_DS sensor.reset() sensor.set_contrast(1) sensor.set_gainceiling(16) sensor.set_framesize(sensor.QQVGA) sensor.set_pixformat(sensor.GRAYSCALE) template = image.Image("/11.pgm") clock = time.clock() while (True): clock.tick() img = sensor.snapshot() r = img.find_template(template, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60)) if r: img.draw_rectangle(r) print(clock.fps())
-
img.find_template(template, 0.70, roi=(你的参数) step=4, search=SEARCH_EX)