• 免费好用的星瞳AI云服务上线!简单标注,云端训练,支持OpenMV H7和OpenMV H7 Plus。可以替代edge impulse。 https://forum.singtown.com/topic/9519
  • 我们只解决官方正版的OpenMV的问题(STM32),其他的分支有很多兼容问题,我们无法解决。
  • 如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修
  • 发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
  • 每一个新的提问,单独发一个新帖子
  • 帖子需要目的,你要做什么?
  • 如果涉及代码,需要报错提示全部代码文本,请注意不要贴代码图片
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • OpenMV4 plus脱机运行报错



    • 在IDE上正常运行,脱机运行后出现了ERROR_log文件
      报错内容是SDRAM failed testing!
      代码如下

      enable_lens_corr = False # turn on for straighter lines...
      
      import sensor, image, time
      from pyb import UART
      import ujson
      
      sensor.reset()
      sensor.set_contrast(3)
      sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      uart=UART(3,9600)
      
      # All line objects have a `theta()` method to get their rotation angle in degrees.
      # You can filter lines based on their rotation angle.
      
      min_degree = 0
      max_degree = 179
      
      rx1_l=[]
      rx2_l=[]
      ry1_l=[]
      ry2_l=[]
      
      rx1_r=[]
      rx2_r=[]
      ry1_r=[]
      ry2_r=[]
      
      # All lines also have `x1()`, `y1()`, `x2()`, and `y2()` methods to get their end-points
      # and a `line()` method to get all the above as one 4 value tuple for `draw_line()`.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          if enable_lens_corr: img.lens_corr(0.7) # for 2.8mm lens...
      
          # `threshold` controls how many lines in the image are found. Only lines with
          # edge difference magnitude sums greater than `threshold` are detected...
      
          # More about `threshold` - each pixel in the image contributes a magnitude value
          # to a line. The sum of all contributions is the magintude for that line. Then
          # when lines are merged their magnitudes are added togheter. Note that `threshold`
          # filters out lines with low magnitudes before merging. To see the magnitude of
          # un-merged lines set `theta_margin` and `rho_margin` to 0...
      
          # `theta_margin` and `rho_margin` control merging similar lines. If two lines
          # theta and rho value differences are less than the margins then they are merged.
      
          for l in img.find_lines(threshold = 2800, theta_margin = 35, rho_margin = 35):
              if (min_degree <= l.theta()) and (l.theta() <= max_degree):
                  img.draw_line(l.line(), color = (255, 0, 0))
                  # print(l)
                  #print("x1:",l.x1,"x2:",l.x2)
                  #print(l.theta())
                  #k=(l.y1()-l.y2())/(l.x1()-l.x2())
                  if(l.x1()<125 and l.theta()<45):
                      rx1_l.append(l.x1())
                      rx2_l.append(l.x2())
                      ry1_l.append(l.y1())
                      ry2_l.append(l.y2())
                      #print("left:",l.theta())
                      #print(l.x1(),l.y1(),l.x2(),l.y2())
                  if(l.x1()>125 and l.theta()>135):
                      rx1_r.append(l.x1())
                      rx2_r.append(l.x2())
                      ry1_r.append(l.y1())
                      ry2_r.append(l.y2())
                      #print(l.x1(),l.y1(),l.x2(),l.y2())
      
                  if rx1_l:
                      if rx1_r:
                          A_1=ry2_l[-1]-ry1_l[-1]
                          B_1=rx1_l[-1]-rx2_l[-1]
                          C_1=rx1_l[-1]*(ry1_l[-1]-ry2_l[-1])+ry1_l[-1]*(rx2_l[-1]-rx1_l[-1])
                          A_2=ry2_r[-1]-ry1_r[-1]
                          B_2=rx1_r[-1]-rx2_r[-1]
                          C_2=rx1_r[-1]*(ry1_r[-1]-ry2_r[-1])+ry1_r[-1]*(rx2_r[-1]-rx1_r[-1])
                          cross_x=(B_1*C_2-B_2*C_1)/(B_2*A_1-B_1*A_2)
                          if(cross_x>0 and cross_x<320):
                              rcx=cross_x-125
                              print(cross_x-125)
                              rxy={"rx":rcx,"ry":0}
                              uart.write(ujson.dumps(rxy)+'\r\n')
      
      
          #print("FPS %f" % clock.fps())
      
      # About negative rho values:
      #
      # A [theta+0:-rho] tuple is the same as [theta+180:+rho].
      
      


    • 另外还有一个问题,我又两个Openmv4 plusi,出现报错的这台插入SD卡后无法被电脑识别



    • 可以联系卖家维修。