logo

对一幅图像分别进行两种处理,为什么不能分别得到两幅图像?

2019-01-16 10:06
W
_6lev

对img2分别进行处理,为什么不能分别得到两幅图像?

import sensor, image, time, pyb,math
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
threshold=(200,255)
w=sensor.width()
h=sensor.height()
while(True):
    clock.tick()
    img1 = sensor.snapshot()
    img2 = img1.binary([threshold],invert=True)#图像转换成二值图像
    for i in range(0.5*w):
        for j in range(h):
            imgR=img2.set_pixel(i,j,0)#提取左边线和右边线
    for i in range(160,320):
        for j in range(240):
            imgL=img2.set_pixel(i,j,0)

    print(clock.fps())
8f37ef3c-d5ac-41e6-b227-75f0ec2eaa94.png
2019-01-16 11:15
I
网红小智智 星瞳科技

OpenMV的内存不够,只有一个frambuffer,不能存两张图片。