logo

RGB图像二值化后不是真正的二值化图

2019-07-08 20:33
M
fry6
d7dc391e-3efd-4e80-8b70-dcafd82c8517.jpg
# Color Binary Filter Example
#
# This script shows off the binary image filter. You may pass binary any
# number of thresholds to segment the image by.

import sensor, image, time

sensor.reset()
sensor.set_framesize(sensor.QVGA)
sensor.set_pixformat(sensor.RGB565)
sensor.skip_frames(time = 2000)
clock = time.clock()

# Use the Tools -> Machine Vision -> Threshold Edtor to pick better thresholds.
red_threshold = (23,45,   -6,2,   -1,8) # L A B


while(True):

    # Test red threshold
    for i in range(100):
        clock.tick()
        img = sensor.snapshot()
        img.binary([red_threshold])
        print(img.get_pixel(100,200))
2019-07-09 13:27
I
网红小智智 星瞳科技

升级到最新的固件。

3.4.1解决这个bug。

2019-07-10 09:07
M
fry6

好的:grinning_face_with_smiling_eyes:

2019-08-11 14:49
Y
klhc

@fry6 请问你解决了吗 我的是最新的 还是这样 灰度图像

2019-08-11 19:17
I
网红小智智 星瞳科技

@klhc 你要确定你的固件版本,目前最新的是3.4.1