@kidswong999 我是将template.bmp保存到内存卡里面,然后再调用的,运行到images.difference时提示OSError: images not equal!
3
3gxu
@3gxu
0
声望
3
楼层
361
资料浏览
0
粉丝
0
关注
3gxu 发布的帖子
-
RE: 调用difference函数问题
-
RE: 调用difference函数问题
@kidswong999 格式全是RGB565时是可以的,只是效果不太好!格式全都是灰度图时且大小相同,出现错误,大小和图像格式都是相同的!
-
调用difference函数问题
import sensor, image, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QQVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. sensor.set_auto_whitebal(False) clock = time.clock() # Create a clock object to track the FPS. clock.tick()# Update the FPS clock. img = sensor.snapshot().mean(1) template = image.Image("/template.bmp") sensor.skip_frames(time = 2000) diff = img.difference(template)
在RGB565格式时是可以用的