logo

IDE提示“find_displacement”object not iterable

2018-07-03 23:30
6
_797506

IDE提示“find_displacement”object not iterable IDE版本1.90,固件版本1.93,主控是F765,使用光流例程的的时候IDE会报错,怎么解决:crying_face: 是对象不可迭代的意思吗?还是我没搞懂这个函数的用法:crying_face:

2018-07-04 11:53
I
网红小智智 星瞳科技

请提供报错的代码。

2018-07-07 15:44
6
_797506

find_displacement”object not iterable

I
网红小智智 星瞳科技

是可以运行,并出现问题的代码。

如果你不提供代码,我怎么知道你代码有什么错误呢?

2018-07-07 17:08
6
_797506

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()

[delta_x, delta_y, response] = old.find_displacement(img) #这句报的错

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()))

大佬:smiling_face_with_open_mouth_cold_sweat:

2018-07-13 20:16
X
Yuan

光流例程已更新,见下面链接。

例程讲解22-Optical-Flow->absolute_rotation_scale 绝对旋转变换 (http://book.openmv.cc/example/22-Optical-Flow/absolute-rotation-scale.html)