这个是什么错误呢???
-
TypeError: unsupported types for lt: 'int', 'bound_method'
-
如果涉及代码,需要报错提示与全部代码文本,请注意不要贴代码图片
-
这个是全部代码了,我只是想在矩形识别的基础上进行像素统计,进行颜色识别
import sensor, image, time
from pyb import UART
import json
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()while(True):
clock.tick()
img = sensor.snapshot()# `threshold` below should be set to a high enough value to filter out noise # rectangles detected in the image which have low edge magnitudes. Rectangles # have larger edge magnitudes the larger and more contrasty they are... blos= img.find_rects(threshold = 12000) if blos: print('sum') for r in blos: area=(r.x(),r.y(),r.w(),r.h()) img.draw_rectangle(r.rect(), color = (255, 0, 0)) statistics=img.get_statistics(roi=area) for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0)) if 0<statistics.l_mode<127 and 0<statistics.a_mode<127 and 0<statistics.b_mode<127: print(r) uart.write('red')
-
函数或者方法的话,需要用括号调用。
-
statistics.l_mode()
-
This post is deleted!
-
@dx1i 不同的问题,单独发帖子。