• 安装星瞳实验室APP,快速收到回复。扫描二维码或者点击 https://singtown.com/app/
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • 一个提问,一个帖子,标题为问题的介绍
  • 请贴出具体的代码,与报错提示。
  • 代码一定要让别人可以运行的文本,不要贴图片
  • 为什么图像会泛红色



    • 0_1533183105553_QQ图片20180802120813.png
      如图墙壁是白色,摄像头拍出来就泛红色了



    • 你用的是什么代码?

      请运行hello world



    • @kidswong999
      运行hello world是正常的,我的代码如下

      thresholds = [
                    (30, 100, 15, 127, 15, 127), # generic_red_thresholds
                    (30, 100, -64, -8, -32, 32), # generic_green_thresholds
                    (0, 30, 0, 64, -128, 0)] # generic_blue_thresholds
      
      sensor.reset()
      sensor.set_pixformat(sensor.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()
      uart = UART(3, 115200)
      # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
      # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
      # camera resolution. "merge=True" merges all overlapping blobs in the image.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          blobs = img.find_blobs([thresholds[threshold_index]], pixels_threshold=6000, area_threshold=7000, merge=True)
          if blobs:
              for blob in blobs:
                  img.draw_rectangle(blob.rect())
                  img.draw_cross(blob.cx(), blob.cy())
                  #print(clock.fps())
              if blob.cx()>=150:
                  output_str="%d" % (blob.cx())
                  print('you send:',output_str)
                  uart.write(output_str+'\r\n')
                  pyb.delay(300)
                  uart = UART(3, 115200, timeout_char=1000)
                  pyb.delay(4000)
              pyb.delay(300)
          else:
              #output_str="0"
              #print('you send:',output_str)
              #uart.write(output_str+'\r\n')
              pyb.delay(300)
      
      
      


    • 有没有接其他电路?OpenMV是如何供电的,供电接的哪个引脚?



    • @yuan 7号引脚用于输出高低电平,用USB接口或是Vin、gnd供电,每次用hello world的示例就会复原,但运行我的程序长了就会泛红,现在泛红越来越频繁了



    • vin gnd供电,是多少伏电压?