导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. vysq
    V
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 帖子
    • 楼层
    • 最佳
    • 群组

    vysq

    @vysq

    0
    声望
    4
    楼层
    397
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    vysq 关注

    vysq 发布的帖子

    • RE: 为什么此代码设置RGB模式不能正确识别数字?

      能不能使用RGB模式来识别?

      发布在 OpenMV Cam
      V
      vysq
    • 为什么此代码设置RGB模式不能正确识别数字?
      # Hello World Example
      #
      # Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!
      
      import sensor, image, time,nn
      
      sensor.reset()                      # Reset and initialize the sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
      sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
      sensor.skip_frames(time = 100)     # Wait for settings take effect.
      net = nn.load('/lenet.network')
      labels = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
      
      clock = time.clock()                # 创建一个时钟对象来跟踪FPS帧率。
      while(True):
          clock.tick()                    # 更新FPS帧率时钟。
          img = sensor.snapshot()         # 拍一张照片并返回图像。
          out = net.forward(img.copy().binary([(150, 255)], invert=True))
          max_idx = out.index(max(out))
          score = int(out[max_idx]*100)
          if (score < 70):
             score_str = "??:??"
          else:
             score_str = "%s:%d%% "%(labels[max_idx], score)
          img.draw_string(0, 0, score_str,color=(0,0,0))
      
          print(score)
          # 注意: 当连接电脑后,OpenMV会变成一半的速度。当不连接电脑,帧率会增加。
          #打印当前的帧率。
      
      

      此代码的作用是识别数字,但是为什么我在识别数字的时候必须设置成灰度GRAYSCALE,不能用RGB565的模式输出,设置成RGB模式 的时候无法正确识别数字,只有设置成灰度的时候才能识别数字

      发布在 OpenMV Cam
      V
      vysq
    • 关于识别数字里面的lenet.network模型文件是怎么编写,有教程嘛?因为我自己想重新弄个模型

      0_163953305300g

      发布在 OpenMV Cam
      V
      vysq
    • 为什么会出现错误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

      发布在 OpenMV Cam
      V
      vysq