Example: 02-Image-Processing/02-Color-Tracking/image_statistics_info.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 图像统计信息示例
#
# 此脚本计算图像的统计信息并打印出来。

import sensor
import time

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)  # 或RGB565。
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time=2000)
sensor.set_auto_gain(False)  # 必须关闭以进行颜色跟踪
sensor.set_auto_whitebal(False)  # 必须关闭以进行颜色跟踪
clock = time.clock()

while True:
    clock.tick()
    img = sensor.snapshot()
    print(img.get_statistics())
    print(clock.fps())

# 您还可以传递 get_statistics() 一个 "roi=" 来获取该区域的统计信息。
# get_statistics() 允许您快速确定图像的颜色通道信息。
# 图像中的任何区域。

results matching ""

    No results matching ""