模板匹配(插了内存卡) MmemoryError:Out of fast Frame Buffer Stack
-
![0_1570763155002_微信截图_20191011110325.png](https://fcdn.singtown.com/255f19ca-35d0-
import sensor, image, time from image import SEARCH_EX, SEARCH_DS # Set sensor settings #sensor.set_contrast(1) #sensor.set_gainceiling(16) sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) # Load template. # Template should be a small (eg. 32x32 pixels) grayscale image. template = image.Image("/template.pgm") clock = time.clock() while(True): clock.tick() img = sensor.snapshot() if img.format() != sensor.GRAYSCALE: imge = img.to_grayscale() #默认False , True内存溢出 r = imge.find_template(template, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60)) if r: img.draw_rectangle(r,color = (0, 0, 0), thickness = 1, fill = False) else: ROI_X=50 ROI_Y=13 ROI_W=60 ROI_H=80 ROI=(ROI_X,ROI_Y,ROI_W ,ROI_H) img.draw_rectangle(ROI,color = (0, 0, 0), thickness = 1, fill = False) print(clock.fps())
4c49-bfb2-4d9b7fe2e12d.png)
-
-