Example explanation-03-blur_filter blur filtering

# 模糊滤波例程
import sensor, image, time

sensor.reset()                         # 初始化sensor

sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565
#设置图像色彩格式

sensor.set_framesize(sensor.QQVGA)     # or sensor.QVGA (or others)
#设置图像像素大小

sensor.skip_frames(time = 2000)        # 让新的设置生效
clock = time.clock()                   # 创建一个时钟对象来跟踪FPS帧率。

while(True):
    clock.tick() # 追踪两个snapshots()之间经过的毫秒数.
    img = sensor.snapshot() # 拍一张照片,返回图像

    # 在图像的每个像素上运行核。
    img.gaussian(1)

    print(clock.fps()) # 注意: 当连接电脑后,OpenMV会变成一半的速度。当不连接电脑,帧率会增加。

Original image:

The running effect is as shown in the figure:

Singtown Technology OpenMV official Chinese document function explanation:

results matching ""

    No results matching ""