logo

追踪色块程序关掉白平衡后,开盖启动程序时随机出现三种不同的色调

2020-12-13 20:18
C
syxh
import sensor, image, time

color_lab=[(4, 27, -13, 9, -8, 11)]#black

sensor.reset()
sensor.set_pixformat(sensor.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().lens_corr(strengh=1.8,zoom=1.0)
    for blob in img.find_blobs(color_lab,merge=True,area_threshold=200,pixel_threshold=1000):
        img.draw_rectangle(blob.rect())#draw a rectangle
        img.draw_cross(blob.cx(),blob.cy())
        print(blob.code())
91550271-b7eb-48da-bc64-98921d98e819.png
82b52091-50b7-4ce0-ae33-c2e1f5bf63bd.png
0941b2a3-ff5a-4fe3-83a8-d5d7fbec83b2.png
C
syxh
003e9314-5e80-440e-bd54-b87c41b3415c.png
C
syxh
1e7207eb-47f5-43c6-a0d2-9d14742b57d3.png
C
syxh
44df3420-6198-4346-998e-08f0a696eef7.png
2020-12-14 18:28
I
网红小智智 星瞳科技

sensor.set_auto_whitebal(False),要添加第二个参数的。

代码:https://book.openmv.cc/example/21-Sensor-Control/sensor-manual-whitebal-control.html

同理,sensor.set_auto_gain你也得改。