zoukankan      html  css  js  c++  java
  • 目标提取——背景均匀、目标与背景相似

    套路:滤波模糊化——动态阈值分割

    halcon中案例:surface_scratch.hdev,划痕与背景相似,背景均匀

    read_image (Image, 'surface_scratch')
    get_image_size (Image, Width, Height)
    
    mean_image (Image, ImageMean, 7, 7) //用7×7的窗口对图像进行均值滤波,获得参考图像
    //动态阈值分割
    dyn_threshold (Image, ImageMean, DarkPixels, 5, 'dark') //与参考图像对比,灰度差距5以内可接受,凸显暗色 connection (DarkPixels, ConnectedRegions) //区域拆分 select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10, 1000) union1 (SelectedRegions, RegionUnion) //区域合并,connection的逆过程 dilation_circle (RegionUnion, RegionDilation, 3.5) //圆形膨胀,临近区域联通 skeleton (RegionDilation, Skeleton) //骨架抽取 connection (Skeleton, Errors) select_shape (Errors, Scratches, 'area', 'and', 50, 10000) select_shape (Errors, Dots, 'area', 'and', 1, 50)

    套路:剔除亮色物——滤波模糊化——动态阈值分割 

    halcon中案例:particle.hdev,分析在液体中的颗粒(低亮),目标与背景相似,背景均匀(剔除亮色物后)

    read_image (Image, 'particle')
    threshold (Image, Large, 110, 255)
    dilation_circle (Large, LargeDilation, 7.5)
    complement (LargeDilation, NotLarge) //补充,即反色
    reduce_domain (Image, NotLarge, ParticlesRed) //缩减预,即二值图转灰度图
    mean_image (ParticlesRed, Mean, 31, 31) //均值滤波,模糊化
    dyn_threshold (ParticlesRed, Mean, SmallRaw, 3, 'light') //动态阈值分割,取亮色目标
    opening_circle (SmallRaw, Small, 2.5)
  • 相关阅读:
    LeetCode 189. Rotate Array
    LeetCode 965. Univalued Binary Tree
    LeetCode 111. Minimum Depth of Binary Tree
    LeetCode 104. Maximum Depth of Binary Tree
    Windows下MySQL的安装与配置
    LeetCode 58. Length of Last Word
    LeetCode 41. First Missing Positive
    LeetCode 283. Move Zeroes
    《蚂蚁金服11.11:支付宝和蚂蚁花呗的技术架构及实践》读后感
    删除docker下的镜像
  • 原文地址:https://www.cnblogs.com/xixixing/p/10732752.html
Copyright © 2011-2022 走看看