导航

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

    goe2

    @goe2

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

    goe2 关注

    goe2 发布的帖子

    • set_window 裁剪图像预处理出现拖影

      0_1615277689746_44a5330f-e962-4d29-b185-a225c490596a-image.png

      # Untitled - By: WeiLiuKong - 周二 3月 9 2021
      
      import sensor, image, time, utime
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.WQXGA2)   # 2592x1944
      sensor.set_windowing((1138, 722, 622, 1088)) #取中间的640*80区域
      
      sensor.set_auto_gain(False,gain_db=14.8)
      sensor.set_auto_whitebal(False)
      sensor.set_auto_exposure(False, exposure_us=10200)  # 10200
      sensor.skip_frames(time = 300)
      
      
      
      while(True):
          img = sensor.snapshot()
          img.histeq(adaptive=True, clip_limit=9)
          img.mean(2)
          img.median(1, percentile=0.9)
      

      采用原始图做直方图处理就没问题,加了set_window, 就会产生拖影

      原始图如下
      0_1615277848619_1531b692-61a3-41d3-bc25-e65e4d53de71-image.png

      发布在 OpenMV Cam
      G
      goe2
    • 对字典采用两种方式进行排序,但是最后结果不对?

      采用两种字典排序方式,但是结果都不对,求大佬指导-----

      # Untitled - By: PC - 周五 9月 11 2020
      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      
      
      while(True):
          img = sensor.snapshot()
          # one method   排序
          c = {3: 56, 5: 87, 2: 889, 1: 0}
          sorted(c.items(),key = lambda x:x[0], reverse = False)
          print("c: ", c)
          print("sor after: ", c)
          
          # two method   排序
          newDict = {}
          for i in sorted(c):
              newDict[i] = c[i]
              print("i: ", i, newDict[i])
          print("new: ", newDict)    
              
      ![0_1599786333727_1111111.png](https://fcdn.singtown.com/d6d90144-c6d2-4fd5-b9e6-a1cc1c17b25b.png) 
      
      发布在 OpenMV Cam
      G
      goe2
    • 出现 OSError: Reset Failed ,这是什么原因造成的?

      0_1599552455483_11.png

      # Untitled - By: DianlongYang - 周二 9月 8 2020
      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7)
      sensor.set_framesize(sensor.QQVGA) # 320 * 240
      sensor.set_auto_gain(False,gain_db=20) #设置增益值(自动增益模式下的典型值为9)
      sensor.set_auto_whitebal(False) #如果开启自动白平衡,设备会自动调整(不同颜色通道的)增益
      sensor.set_auto_exposure(False, exposure_us=37966) #设置曝光时长(自动模式下的典型值是5845us)
      sensor.skip_frames(time = 2000)
      
      
      ROI_X = 87  #56  59
      ROI_Y= 25  #2   10
      ROI_W = 38  #40  38
      ROI_H= 70 #75  70
      ROI = (ROI_X,ROI_Y,ROI_W ,ROI_H)
      
      while(True):
          init12 = time.ticks()
          img = sensor.snapshot()
          img.draw_rectangle(ROI,color = (0, 0, 0), thickness = 1, fill = False)
          # 5分条
          img.draw_line((ROI_X+9, 82, ROI_X+9 + 20, 82), color = (255, 0, 0),thickness=1)
          img.draw_line((ROI_X+9, 50, ROI_X+9 + 20, 50), color = (255, 0, 0),thickness=1)
          init32 = time.ticks()
          print(init32 - init12)
          
          
          
          
      
      
      发布在 OpenMV Cam
      G
      goe2
    • RE: OSError:ROI does not overlap on the image

      +1 这为啥会出现这个问题?

      发布在 OpenMV Cam
      G
      goe2
    • 摄像头出厂一个像素点多少毫米?

      摄像头出厂一个像素点多少毫米?

      发布在 OpenMV Cam
      G
      goe2
    • 如何将彩色图转换为灰度图

      把摄像头设置为RGB565模式之后,如何把得到的图像进行灰度化。(并不是

      一开始就设置为sensor.GRAYSCALE)

      查了文档发现好像没有将彩色图转换为灰度图的函数?

      发布在 OpenMV Cam
      G
      goe2
    • 统计数据对象 类 Statistics

      统计数据对象 类 Statistics 中的求均值函数(statistics.mean())返回值为 int 型,请

      问有没有类似的函数返回值为 浮点型的?(本人现在想精确计算一段区域的灰度均

      值,希望数值精确到小数点)

      发布在 OpenMV Cam
      G
      goe2
    • RE: 模板匹配(插了内存卡) MmemoryError:Out of fast Frame Buffer Stack

      0_1570763278834_微信截图_20191011110325.png

      发布在 OpenMV Cam
      G
      goe2
    • 模板匹配(插了内存卡) MmemoryError:Out of fast Frame Buffer Stack

      ![0_1570763155002_微信截图_20191011110325.png](https://fcdn.singtown.com/255f19ca-35d0-

      import sensor, image, time
      from image import SEARCH_EX, SEARCH_DS
      
      
      # Set sensor settings
      #sensor.set_contrast(1)
      #sensor.set_gainceiling(16)
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      
      
      
      
      # Load template.
      # Template should be a small (eg. 32x32 pixels) grayscale image.
      template = image.Image("/template.pgm")
      
      
      
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          
          if img.format() != sensor.GRAYSCALE:
              imge = img.to_grayscale()  #默认False , True内存溢出
              r = imge.find_template(template, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
              if r:
                  img.draw_rectangle(r,color = (0, 0, 0), thickness = 1, fill = False)
              else:
                  ROI_X=50
                  ROI_Y=13
                  ROI_W=60
                  ROI_H=80 
                  ROI=(ROI_X,ROI_Y,ROI_W ,ROI_H) 
                  img.draw_rectangle(ROI,color = (0, 0, 0), thickness = 1, fill = False)
              
          print(clock.fps())
      

      4c49-bfb2-4d9b7fe2e12d.png)

      发布在 OpenMV Cam
      G
      goe2