Routine explanation -04-sharpen_filter Image sharpening

This routine is 04-image-Filters-sharpen_filter.py\ The purpose of this routine is to morph the image, so that the image to achieve sharpening effect.

# 图像锐化例程:
#
# 这个例子演示了如何使用morph变换来锐化图像

import sensor, image, time

sensor.reset() # 初始化sensor

sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565
#设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种

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() # 拍一张照片,返回图像

    # Run the kernel on every pixel of the image.
    # 在图像的每个像素上运行核
    img.laplacian(1, sharpen=True)

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

original image:

After image sharpening:

Singtown Technology OpenMV official Chinese document function explanation:

results matching ""

    No results matching ""