logo

set_window 裁剪图像预处理出现拖影

2021-03-09 16:18
X
goe2
aae60f79-c481-4c06-854b-f5ceab854192.png
# Untitled - By: WeiLiuKong - 周二 3月 9 2021

import sensor, image, time, utime

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.WQXGA2)   # 2592x1944
sensor.set_windowing((1138, 722, 622, 1088)) #取中间的640*80区域

sensor.set_auto_gain(False,gain_db=14.8)
sensor.set_auto_whitebal(False)
sensor.set_auto_exposure(False, exposure_us=10200)  # 10200
sensor.skip_frames(time = 300)



while(True):
    img = sensor.snapshot()
    img.histeq(adaptive=True, clip_limit=9)
    img.mean(2)
    img.median(1, percentile=0.9)

采用原始图做直方图处理就没问题,加了set_window, 就会产生拖影

原始图如下

62022a96-0e44-4f9b-b82e-465f421e91f0.png
2021-03-10 17:04
I
网红小智智 星瞳科技

应该是histeq这个直方图均衡算法导致的。adaptive=True后对比非常明显。

你用histeq的目的是什么?