当前位置: 首页 > news >正文

Blob分析及形态学分析

目录

Blob分析的基本思想:

Blob分析主要流程:

Blob分析

分割: Binary Threshold

分割: Histogram

分割: 动态阈值

全局阈值与动态局部阈值的比较

形态学处理

连通区域 connetion

形态学算子

特征提取

提取特征 常用相关算子

区域特征: rectangularity


Blob分析的基本思想:

图像中相关联物体(前景)的像素可以通过其灰度值来标

Blob分析主要流程:

获取图像、分割图像、提取特征
一个简单的例子(非常理想的情况)
read_image (Image, ’particle’)
threshold (Image, BrightPixels, 120, 255)
connection (BrightPixels, Particles)
area_center (Particles, Area, Row, Column)

Blob分析

threshold 定义
threshold 算子 速度最快使用频率最高的分 割算法 如果目标体与背景之间存在灰度差,则 threshold 首先被 使用 如果环境稳定,阈值可在离线状态下一次确定

分割: Binary Threshold

自动地全局阈值的方法
多次平滑直方图
寻找峰值
峰谷作为阈值
bin_threshold (Image, Region)

分割: Histogram

自动地全局阈值的方法
统计直方图
寻找出现频率最高的灰度值
把比最高灰度值小一定灰阶值的灰度值作为阈值
gray_histo (Image, Image, AbsoluteHisto,
RelativeHisto)
PeakGray := sort_index(AbsoluteHisto)[255]
threshold (Image, Region, 0, PeakGray-25)

分割: 动态阈值

动态阈值分割
很多情况下由于背景不均一,无
法确定全局阈值
目标体经常表现为比背景局部亮
一些或暗一些
需要通过其邻域找到一个合适的
阈值进行分割
如何确定其邻域?
可以通过一些平滑滤波算子来确
定邻域,例如 mean_image
binomial_filter
动态阈值分割,其中S为平滑后的输入图像
 
x y R g x y s x y t

全局阈值与动态局部阈值的比较

动态局部阈值
通过均值滤波确定邻域
滤波器mask尺寸大于字符笔画的宽度
选择所有比其邻域暗的像素
mean_image (Image, ImageMean, 21, 21)
dyn_threshold (Image, ImageMean,
Region, 15, 'dark')
watersheds_threshold 函数
方法
使用传统的 watersheds 算法
通过阈值合并盆地 :
W
B 1
B 2
max( W B 1 , W B 2 ) Threshold

形态学处理

分割之后,往往需要对区域做进一步处理才能满足要求
常用形态学相关算子
connection, select_shape, opening_circle, closing_circle,
opening_rectangle1, closing_rectangle1, difference,
intersection, union1, shaps_trans, fill_up
高级算子
boundary, skeleton

连通区域 connetion

阈值分割后,需要提取目标物体,为了提取目标物体不得不先找到连通区域
提取连通域的关键是领域搜索的类型
所有的案例中 8 领域法是默认的

形态学算子

任意的结构元素
任意尺寸的结构元素
非常有效的处理
巨大的算子集合 : 44 个算子
经典算子
Erosion, dilation, opening, closing
高级算子
top-hat, bottom-hat, hit-or-miss, boundary
特殊算子
Fitting, pruning, thickening, thinning, skeleton
定义
Operator
union1 : Union of all regions in one variable
union2 : Unify all regions in the second parameter with each region in the first
parameter
Usage
Generate regions by combining primitive shapes
Combine segmentation results
Definition
Operator
intersection : Intersect each region of the first parameter with the union of
all regions of the second parameter
Usage
Generate regions by combining primitive shape
Use as a result those points where two methods return pixels
Operator
difference : Subtract from all regions of the first parameter the union of all
regions of the second parameter
Usage
Generate regions by combining primitive shape
Use as a result those points where one method but not the other one returns
pixels
Operator
complement : Calculate the complement of each input region
Usage
Use as a result those pixels which are not part of the segmentation
Note: with set_system the behavior can be controlled
'clip_region' on: the difference with the maximum image size is calculated
'clip_region' off: only the smart complement is applied

特征提取

特征描述了区域的特有属性
区域特征 ( 形状特征 ) 描述了区域的几何特征,这些特征不依赖
于灰度值
用途:
分割后,通过特征提取选择出所需的目标物体
区域分类 , 比如 OCR
测量
质量检测

提取特征 常用相关算子

area_center, smallest_rectangle1, smallest_rectangle2,
compactness, eccentricity, elliptic_axis, area_center_gray,
intensity, min_max_gray
Region Feature: Moments
区域特征 : 更多特征
smallest_circle :
Convexity( 凸状性 ) : 区域面积和凸形外轮廓的比例
Contlength( 长度 ) : 区域边界长度
Compactness( 紧密度 ) :

区域特征: rectangularity

除了圆形和椭圆形外,长方形是一种典型的形状
典型的形状特征比如比如 roundness, circularity, 或者 compactness 不适用于
选择长方形
输入区域
等价长方形
difference
select_shape( Regions : SelectedRegions : Features , Operation , Min , Max : )
read_image(Image,'monkey')
threshold(Image,S1,160,255) connection(S1,S2)
select_shape(S2,Eyes,['area','anisometry'],'and',[500,1.0],[50000,1.7])
disp_region(Eyes,WindowHandle)
http://www.dtcms.com/a/266757.html

相关文章:

  • AWS 中如何添加一个内部域名
  • Spring AI Alibaba 来啦!!!
  • 本地区块链服务在物联网中的应用实例
  • M30280F8HP#U5B 瑞萨16位工业MCU微控制器,CAN 2.0B+专用PWM,电机控制专家!
  • 使用mindie:2.0.RC2-800I-A2-py311-openeuler24.03-lts制作一个通用的模型推理性能测试的镜像
  • Flynn分类法知识点梳理
  • 微服务架构的演进:迈向云原生
  • 【Spring Boot】Druid 连接池 YAML 配置详解
  • 马尔可夫链:随机过程的记忆法则与演化密码
  • 在LinuxMint 22.1(Ubuntu24.04)上安装使用同花顺远航版
  • 力扣刷题记录【1】146.LRU缓存
  • 【机器人】复现 DOV-SG 机器人导航 | 动态开放词汇 | 3D 场景图
  • 设计模式-应用分层
  • 【狂飙AGI】第8课:AGI-行业大模型(系列2)
  • NumPy-核心函数np.dot()深入理解
  • 【三维重建】【3DGS系列】【深度学习】3DGS的理论基础知识之高斯椭球的颜色表达
  • 鸿蒙开发BindSheet选择章节效果
  • 服务器间接口安全问题的全面分析
  • 数据集-目标检测系列- 卡车 数据集 truck >> DataBall
  • 代码随想录算法训练营第四十六天|动态规划part13
  • 【LeetCode 热题 100】238. 除自身以外数组的乘积——(解法一)前缀积与后缀积
  • 算法学习笔记:7.Dijkstra 算法——从原理到实战,涵盖 LeetCode 与考研 408 例题
  • 物联网数据安全区块链服务
  • AI Agent意图识别
  • 二维码驱动的独立站视频集成方案
  • Mysql+neo4j创建节点和关系
  • Linux操作系统之文件(三):缓冲区
  • Kubernetes 服务发布基础学习
  • OpenSSL 内存泄漏修复全景:119 个历史 Commit 的类型分析与防御启示
  • 人工智能及其十大优势 Artificial Intelligence: With Its Advantages