logo

MemoryError:Out of normal MicroPython Heap Memory!

2019-01-08 09:19
0
_17723174802
ae751af1-bce4-46cf-862a-b376519901cc.png

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)


templates = ["/ren.pgm", "/zhi.pgm", "/chu.pgm"]

clock = time.clock()

while (True):
    clock.tick()
    img = sensor.snapshot()

    for tem in templates:
        template = image.Image(tem)
        r = img.find_template(template, 0.70, step=4, search=SEARCH_EX)
        if r:
            img.draw_rectangle(r)
            print(tem)

    print(clock.fps())

求助大佬 谢谢

2019-01-08 12:22
I
网红小智智 星瞳科技

模版图像太大了,用小一点的模版

2019-11-19 14:01
A
cx2q

一般都是用多大的

2019-11-19 20:06
I
网红小智智 星瞳科技

https://singtown.com/learn/49598/