logo

为什么运行这个程序,IDE没有报错,但是却自动断开连接

2019-07-01 19:27
A
bfcd
import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE) # or RGB565.
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must be turned off for color tracking
sensor.set_auto_whitebal(False) # must be turned off for color tracking
clock = time.clock()

#threshold =[42, 66, -29, 7, 3, 38]

while(True):
    clock.tick()
    img = sensor.snapshot()
    histogram = img.get_histogram()#得到直方图
    Thresholds = histogram.get_threshold()#得到最佳阈值
    l = Thresholds.l_value()
    a = Thresholds.a_value()
    b = Thresholds.b_value()
    print(Thresholds)
A
bfcd

也就是这个程序没有报错,但却不能正常运行:worried_face:

2019-07-02 15:37
I
网红小智智 星瞳科技

我运行这个代码,没有错误。

请提供硬件版本,固件版本,IDE版本。