导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. 搜索

    高级搜索

    搜索子版块
    保存设置 清除设置
    共 499 条结果匹配 "sensor",(耗时 0.03 秒)

    总是第一个for循环报错,我运行的时候总会提示快速帧缓冲堆内存不足,降低图像分辨率调整算法来绕过这个问题?

    # Edge Impulse - OpenMV Image Classification Example
    
    import sensor, image, time, os, tf
    
    sensor.reset()                         # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240))       # Set 240x240 window.
    sensor.skip_frames(time=2000)          # Let the camera adjust.
    
    net = "trained.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]
    
    clock = time.clock()
    while(True):
        clock.tick()
    
        img = sensor.snapshot()
    
        # default settings just do one detection... change them to search the image...
       for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
            print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
            img.draw_rectangle(obj.rect())
            # This combines the labels and confidence values into a list of tuples
            predictions_list = list(zip(labels, obj.output()))
    
            for i in range(len(predictions_list)):
                print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
        print(clock.fps(), "fps")
    ![0_1628934731145_IMG_20210814_173652.jpg](正在上传 85%) 
    

    ![0_1628934761673_IMG_20210814_173652.jpg](正在上传 73%) ![0_1628934773831_IMG_20210814_173652.jpg](正在上传 99%)

    L
    发布在 OpenMV Cam

    MemoryError: Out of fast Frame Buffer Stack Memory!

    0_1636007362106_9QSRGOJ0)O`ZY3VX%PNDPOI.png

    # Edge Impulse - OpenMV Image Classification Example
    
    import sensor, image, time, os, tf
    
    sensor.reset()                         # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240))       # Set 240x240 window.
    sensor.skip_frames(time=2000)          # Let the camera adjust.
    
    net = "trained.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]
    
    clock = time.clock()
    while(True):
        clock.tick()
    
        img = sensor.snapshot()
    
        # default settings just do one detection... change them to search the image...
        for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
            print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
            img.draw_rectangle(obj.rect())
            # This combines the labels and confidence values into a list of tuples
            predictions_list = list(zip(labels, obj.output()))
    
            for i in range(len(predictions_list)):
                print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
        print(clock.fps(), "fps")
    

    R
    发布在 OpenMV Cam

    识别数字时出现OSError

    0_1636024535749_1234.png

    代码:# Edge Impulse - OpenMV Image Classification Example

    import sensor, image, time, os, tf

    sensor.reset() # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240)) # Set 240x240 window.
    sensor.skip_frames(time=2000) # Let the camera adjust.

    net = "trained.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]

    clock = time.clock()
    while(True):
    clock.tick()

    img = sensor.snapshot()
    
    # default settings just do one detection... change them to search the image...
    for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
        print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
        img.draw_rectangle(obj.rect())
        # This combines the labels and confidence values into a list of tuples
        predictions_list = list(zip(labels, obj.output()))
    
        for i in range(len(predictions_list)):
            print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
    print(clock.fps(), "fps")

    N
    发布在 OpenMV Cam

    MemoryError: Out of fast Frame Buffer Stack Memory!

    0_1636092513979_d1d92331-51bb-45bd-9797-7b4bfa3b7efa-1636092492(1).png

    # Edge Impulse - OpenMV Image Classification Example
    
    import sensor, image, time, os, tf
    import gc
    gc.threshold(100000)
    sensor.reset()                         # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QQVGA)      # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240))       # Set 240x240 window.
    sensor.skip_frames(time=2000)          # Let the camera adjust.
    
    net = "trained.tflite"#模型文件
    labels = [line.rstrip('\n') for line in open("labels.txt")]
    #1 -
    clock = time.clock()
    while(True):
        clock.tick()
        gc.collect()
        img = sensor.snapshot()
    
        # default settings just do one detection... change them to search the image...
        for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
            print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
            img.draw_rectangle(obj.rect())
            # This combines the labels and confidence values into a list of tuples
            predictions_list = list(zip(labels, obj.output()))
    
            for i in range(len(predictions_list)):
                print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
        print(clock.fps(), "fps")
    
    

    E
    发布在 OpenMV Cam

    为什么会出现错误OSError:0,是我代码错了还是买到盗版openmv了,我都是按着视频操作来的

    Edge Impulse - OpenMV Image Classification Example

    import sensor, image, time, os, tf

    sensor.reset() # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240)) # Set 240x240 window.
    sensor.skip_frames(time=2000) # Let the camera adjust.

    net = "trained.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]

    clock = time.clock()
    while(True):
    clock.tick()

    img = sensor.snapshot()
    
    # default settings just do one detection... change them to search the image...
    for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
        print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
        img.draw_rectangle(obj.rect())
        # This combines the labels and confidence values into a list of tuples
        predictions_list = list(zip(labels, obj.output()))
    
        for i in range(len(predictions_list)):
            print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
    print(clock.fps(), "fps")
    

    0_163946578729png 0_1639465826093_0SDM}5UG1%GL}8~JA5A3IL6.png

    V
    发布在 OpenMV Cam

    部署自己训练的神经网络模型后出现问题,带SD卡会自动断开连接,不带SD卡运行模型自带程序后也会断开连接。为什么?

    # Edge Impulse - OpenMV Image Classification Example
    
    import sensor, image, time, os, tf
    
    sensor.reset()                         # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240))       # Set 240x240 window.
    sensor.skip_frames(time=2000)          # Let the camera adjust.
    
    net = "something.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]
    
    clock = time.clock()
    while(True):
        clock.tick()
    
        img = sensor.snapshot()
    
        # default settings just do one detection... change them to search the image...
        for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
            print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
            img.draw_rectangle(obj.rect())
            # This combines the labels and confidence values into a list of tuples
            predictions_list = list(zip(labels, obj.output()))
    
            for i in range(len(predictions_list)):
                print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
        print(clock.fps(), "fps")
    
    

    0_1644133266882_屏幕截图 2022-02-06 154050.png

    C
    发布在 OpenMV Cam

    神经网络训练模型问题

    Edge Impulse - OpenMV Image Classification Example

    import sensor, image, time, os, tf, uos, gc

    sensor.reset() # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240)) # Set 240x240 window.
    sensor.skip_frames(time=2000) # Let the camera adjust.

    net = None
    labels = None

    try:
    # Load built in model
    labels, net = tf.load_builtin_model('trained')
    except Exception as e:
    raise Exception(e)

    clock = time.clock()
    while(True):
    clock.tick()

    img = sensor.snapshot()
    
    # default settings just do one detection... change them to search the image...
    for obj in net.classify(img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
        print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
        img.draw_rectangle(obj.rect())
        # This combines the labels and confidence values into a list of tuples
        predictions_list = list(zip(labels, obj.output()))
    
        for i in range(len(predictions_list)):
            print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
    print(clock.fps(), "fps")
    

    这是模型里跑出来的代码

    L
    发布在 OpenMV Cam

    报错AttributeError:'str'object has no attribute'classify'如何解决?

    @kidswong999 报错:AttributeError: 'str' object has no attribute'classify'
    代码如下:

    # Edge Impulse - OpenMV Image Classification Example
    
    import sensor, image, time, os, tf, uos, gc
    
    sensor.reset()                         # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
    sensor.set_windowing((240, 240))       # Set 240x240 window.
    sensor.skip_frames(time=2000)          # Let the camera adjust.
    
    net = "trained.tflite"
    labels = [line.rstrip('\n') for line in open("labels.txt")]
    
    
    clock = time.clock()
    while(True):
        clock.tick()
    
        img = sensor.snapshot()
    
        # default settings just do one detection... change them to search the image...
        for obj in net.classify(img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
            print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
            img.draw_rectangle(obj.rect())
            # This combines the labels and confidence values into a list of tuples
            predictions_list = list(zip(labels, obj.output()))
    
            for i in range(len(predictions_list)):
                print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
    
        print(clock.fps(), "fps")
    
    

    4
    发布在 OpenMV Cam

    如何只对一张图片进行二值化处理

    我要做什么:
    我想采集一张图片就停下来,然后对它做后续各种处理比如二值化。

    我遇到的问题:
    只操作一张图片进行二值化framebuffer里面没有反应。

    我想得到什么帮助:
    如何只对一张图片进行二值化,而不是循环采集

    import sensor, image, time     
    
    
    sensor.reset()                      # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
    sensor.skip_frames(time = 2000)     # Wait for settings take effect.
    
    
    # 获得一帧图像
    img = sensor.snapshot()
    
    threshold = (0,100,   -128,127,	20,50)#二值化的分割阈值
    
    img.binary([threshold])
    
    
    

    0_1666490251563_2c21660d-ba38-4978-b713-2da9b31ea4cf-image.png

    C
    发布在 OpenMV Cam

    在LED等下拍照频闪

    你这不可能是LED,LED频率很快的,不会影响OpenMV,估计是荧光灯。

    暂时的办法:
    运行下面的代码:先改exposure_us,直到不频闪,注意画面亮度会改变。然后再增加gain_db把画面亮度变大。

    import sensor, image, time
    
    sensor.reset()                      # Reset and initialize the sensor.
    sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
    sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
    sensor.set_auto_exposure(False, \
        exposure_us = 100000)
    sensor.set_auto_gain(False, gain_db=1)
    sensor.skip_frames(time = 2000)     # Wait for settings take effect.
    clock = time.clock()                # Create a clock object to track the FPS.
    while(True):
        clock.tick()                    # Update the FPS clock.
        img = sensor.snapshot()         # Take a picture and return the image.
        print(clock.fps())
    

    如果有条件,建议换个灯,或者加一个补光灯。https://singtown.com/product/50776/openmv-light-shield/

    发布在 OpenMV Cam
    • 1
    • 2
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 47 / 50