import sensor, image, time, pyb
from pyb import UART
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
#波特率460800
uart = UART(3, 460800)
#对图像进行矫正
enable_lens_corr = True
led1 = pyb.LED(1) # Red LED = 1, Green LED = 2, Blue LED = 3, IR LEDs = 4.
led2 = pyb.LED(2)
while(True):
imgsrc = sensor.snapshot()
img = imgsrc.copy(roi=(0,0,imgsrc.height(), imgsrc.width()),copy_to_fb=True)最后结果会提示OSError:Cannot copy to fb!
imgsrc已经是在framebuffer里面了,不能再拷贝进去。
不能同时有两个图片。
那如果我想创建一个imgsrc的副本怎么办呢?
如果图像小的话,copy_to_fb=False
如果图像大的话,OpenMV放不下两张图片。
https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.copy