对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())
OpenMV的内存不够,只有一个frambuffer,不能存两张图片。