我使用如下函数,为什么得到的结果是这样的啊
使用前:
使用后:
代码如下:
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QQVGA) # Set frame size to QQVGA (160x120)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.
while(True):
clock.tick() # Update the FPS clock.
img = sensor.snapshot()
# img这里是彩色
img = img.to_grayscale()
# img这里是灰色
print(clock.fps())