openMV 关于find_displacement的问题,不可迭代是怎么回事?
-
import sensor, image, time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.B64X64) # or B40x30 or B64x64 clock = time.clock() # Tracks FPS. old = sensor.snapshot() #先获取一张图片 while(True): clock.tick() # Track elapsed milliseconds between snapshots(). img = sensor.snapshot() # Take a picture and return the image. [delta_x, delta_y, response] = old.find_displacement(img) #delta_x delta_y分别表示 x y 方向上,这一帧图像相比上帧图像移动的像素数目。 old = img.copy() print("%0.1f X\t%0.1f Y\t%0.2f QoR\t%0.2f FPS" % \ (delta_x, delta_y, response, clock.fps()))
-
-
@kidswong999 链接文本我在这个网站看到的,不是你写的吗?