导航

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

    bick 发布的帖子

    • 请问可以用openmv实现不同颜色分拣的功能吗?

      现在的思路是用openmv识别出所有的绿色和红色色块的坐标后,将坐标传给arduino,将物体移至某一位置,不知道是否可行?请问还需要什么学习什么内容?

      发布在 OpenMV Cam
      B
      bick
    • 使用定时器如何实现隔一段时间与Arduino通信的功能?程序提示memory error的原因?
      def set_outstr(timer):
          out_str ='['
          out_str +='(%d,%d)' %(x_error,y_error)
          out_str +=']'
          uart.write(out_str)   #向arduino传递out_str字符串
          print (out_str)
      
      while(True):
      
          clock.tick() # Track elapsed milliseconds between snapshots().
      
          img = sensor.snapshot() # Take a picture and return the image.
          
          blobs = img.find_blobs([green_threshold])
      
          tim=Timer(4,freq=5)
          if blobs:
      
              max_blob = find_max(blobs)
      
              x_error = max_blob[5]-img.width()/2                           #X方向偏差
      
              y_error = max_blob[6]-img.height()/2                          #y方向偏差
      
              
              print("x error: ", x_error)
              print("y_error: ", y_error)
              img.draw_rectangle(max_blob[0:4]) # rect
      
              img.draw_cross(max_blob[5], max_blob[6]) # cx, cy
             
              tim.callback(set_outstr)
      
      

      提示错误:uncaught exception in Timer(4) interrupt handler
      MemoryError:
      x error: -119.0
      y_error: -21.0

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问怎样得到画面中心坐标啊?
      img.draw_cross(int(img.width()/2),int(img.height()/2))
      

      转换为整型之后就可以了

      发布在 OpenMV Cam
      B
      bick
    • 请问可以设置openmv以一定的时间间隔发送数据吗?

      请问可以设置openmv以一定的时间间隔发送数据吗?希望可以实现arduino和openmv的实时通讯

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问颜色形状同时识别时可以只返回某一帧图像的大信息吗?

      @kidswong999 我想把检测到的圆心和半径传给Arduino,但是它每次发送这么多的数据,Arduino无法处理吧

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问颜色形状同时识别时可以只返回某一帧图像的大信息吗?

      @kidswong999 那我需要改什么参数吗?还是说我可以修改只读取它某一帧的参数吗

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问颜色形状同时识别时可以只返回某一帧图像的大信息吗?
      import sensor, image, time
      
      Thresholds = [(40, 74, 74, 18, -31, 42),     #修改后红色的阈值
                     (84, 94, -57, -22, -27, 40)] # 修改后的绿色的阈值
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)        #使用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()
      
      while(True):
          clock.tick()
          img = sensor.snapshot().lens_corr(1.8)
          ROI=(20,15,256,192)
      
          #for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,
                  #r_min = 2, r_max = 100, r_step = 2):
          for c in img.find_circles(roi=ROI,threshold = 6000, x_margin = 10, y_margin = 10,
                  r_margin = 10,r_min = 10, r_max = 30, r_step = 2):     #修改后识别圆形的参数
              area = (c.x()-c.r(), c.y()-c.r(), 2*c.r(), 2*c.r())
              #area为识别到的圆的区域,即圆的外接矩形框
              statistics = img.get_statistics(thresholds=Thresholds,roi=area)     #像素颜色统计,
              #print(statistics)           #不输出颜色的参数
              #(0,100,0,120,0,120)是红色的阈值,所以当区域内的众数(也就是最多的颜色),范围在这个阈值内,就说明是红色的圆。
              #l_mode(),a_mode(),b_mode()是L通道,A通道,B通道的众数。
              if 0<statistics.l_mode()<100 and 0<statistics.a_mode()<74 and -31<statistics.b_mode()<42:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的红色圆形用红色的圆框出来
                  red_strs=[c[0],c[1],c[2]]
                  #for index in range(len(c)):
                      #print c[index]
                  #for red_str in red_strs:
                      #print ('red_str:',red_str)
      
                  print (red_strs)
                  print (c)
              elif 30<statistics.l_mode()<100 and -64<statistics.a_mode()<-8 and -32<statistics.b_mode()<32: #识别绿色的圆
                   img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的绿色圆形用红色的圆框出来
              else:                                                        #识别红色或绿色
                  img.draw_rectangle(area, color = (255, 255, 255))
                  #将非红色的圆用白色的矩形框出来
          #print("FPS %f" % clock.fps())
      
      
      发布在 OpenMV Cam
      B
      bick
    • 请问颜色形状同时识别时可以只返回某一帧图像的大信息吗?

      运行的时候返回的串口数据一直变化,想要一个固定的数据怎样实现?

      发布在 OpenMV Cam
      B
      bick
    • 修改图像大小之后(将QQVGA改为QVGA),无法运行识别圆的程序是什么原因?

      0_1540983113774_捕获.PNG

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问图像左上角的坐标在实际空间中如何确定?

      @kidswong999 我看了这个教程。请问有可以得到特定颜色的物体的准确坐标的方法吗

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问图像左上角的坐标在实际空间中如何确定?

      @kidswong999 那就是说我不能在检测到物体的颜色之后知道这个物体的实际位置吗

      发布在 OpenMV Cam
      B
      bick
    • RE: 请问图像左上角的坐标在实际空间中如何确定?

      @kidswong999 那如果需要用到它的坐标,怎样转化成世界坐标系的呢

      发布在 OpenMV Cam
      B
      bick
    • 请问图像左上角的坐标在实际空间中如何确定?

      是否可以理解为摄像头的中心点?还是涉及到像素坐标系,相机坐标系,世界坐标系的转换?

      发布在 OpenMV Cam
      B
      bick