Adaptive Threshold
Adaptive Threshold
1. Otsu's Binarization:
Using a discriminant analysis to partition the image into 2 classes C0 = {0, 1, 2, ..., t} and C1 = {t+1, t+2, ..., L-1} at which is the total number of the gray levels in image;
(1). Let n be the total number of pixels in the image,
(2). the probabilities of the two classes equal to \(w_0 = \sum\limits_{i=1}^{t}{p_i}\), \(w_1 = \sum\limits_{i=t+1}{L-1}{p_i}\),
(3). and so are the means: \(\mu_0(t) = \sum_{i=0}^{t}{\frac{i*p_i}{w_0}} = \sum_{i=0}^{t}{\frac{i*p_i}{{\sum_{i=0}^{t}{p_i}}}}\), \(\mu_1(t) = \sum_{i=t+1}^{L-1}{\frac{i*p_i}{w_1}} = \sum_{i=t+1}^{L-1}{\frac{i*p_i}{w_1}} = \sum_{i=t+1}^{L-1}{\frac{i*p_i}{{\sum_{i=t+1}^{L-1}{p_i}}}}\),
(4). \(\sigma^{2}_{B}\) and \(\sigma^{2}_{T}\) -- the variance in between classes and total variance,
(5). \(\mu = \sum_{i=0}^{L-1}{i*p_i}\);
An optimal threshold t* can be computed by maxmizing the \(\sigma_{B}^{2}\) -- \(t^2 = Arg\{\max\limits_{0<=i<=L-1}{(\frac{\sigma_{B}^{2}}{\sigma_T^2})}\}\), where \(\sigma_B^2 = w_{0} * (\mu_{0} - \mu_{T})^{2} + w_{1} * (\mu_1 - \mu_T)^{2}\) and \(\sigma_{T}^{2} = \sum_{i=1}^{L-1}{(i-\mu_{T})^{2}}\);
Simplier formula: \(t^{*} = Arg\{\max\limits_{0<=i<=L}{(w_{0}*[\mu_0-\mu_T]^{2}+w_{1}*[\mu_{1} - \mu_{T}]^{2}})\}\)
2. Bernsen's Method:
[Used when]: different parts of an image show large varivation between background and foreground, especially as a result of darkness or shadow.
Steps:
(1). Let f(x, y) denotes the gray value in point(x, y);
(2). For a (2w+1)x(2w+1) mask centered at point(x, y), and the threshold T(x, y) characteristic to image is: T(x, y) = 0.5 x (\(\max\limits_{-w<=m<=w, -w<=n<=w}f(x+m, y+m) + \min\limits_{-w<=m<=w, -w<=n<=w}f(x+m, y+m)\))
P.S. It's necessary that mask size should be adapted to the size of the existing objects.
3. Niblack's Method:
[Definition]: A local thresholding method that adapts the threshold's valuebased on local mean and local standard deviation, with a specific rectangular window around each pixel location.
Formula:
Notation: m -- local mean value;
k -- represents size of window, recommended value: -0.2, adjust it -- trying to improve denoising efficacy and preservation of local details;
N -- number of pixels;
\(p_i^2\) -- value of the i-th pixel;
std -- standard-deviation.\(\displaystyle T(x, y) = m(x, y) + k*\sqrt{\frac{\sum_i{p_i^2}}{NP} - m(x, y)^2} = m(x, y) + k*\sqrt{std(x, y)}\)
最新文章
- codevs 2287 火车站
- C#,java,C++ 等变量命名规则
- ios 使用可视化工具charles转换pcap文件,进行流量统计(通过tcpdump抓包)
- 小记:事务(进程 ID 56)与另一个进程被死锁在 锁 | 通信缓冲区 资源上,并且已被选作死锁牺牲品。
- POJ 1146 ID Codes (UVA146)
- Java中的那些名词术语(不断更新中)
- CSS定位:几种类型的position定位的元素
- iOS开发笔记 - 界面调试神器Reveal
- Python进阶之迭代器和生成器
- [ZJOI2012]灾难
- 移动端line-height问题
- keepalived weight正负值问题(实现主服务器nginx故障后迅速切换到备服务器)
- nginx-匹配规则
- HIHOcoder 1457 后缀自动机四&#183;重复旋律7
- SqlServer中exists和in的区别
- 用Elasticsearch做大规模数据的多字段、多类型索引检索
- SQL Server 如何添加删除外键、主键,以及更新自增属性
- IntelliJ IDEA 13.1.3 SVN无法正常使用问题
- 内网渗透中的NTLM-Hash Relay
- JAVA I/O(四)网络Socket和ServerSocket
热门文章
- GlusterFS分布式存储系统复制集更换故障Brick操作记录
- Bitter.Core系列二:Bitter ORM NETCORE ORM 全网最粗暴简单易用高性能的 NETCore ORM 之数据库连接
- java中List元素移除元素的那些坑
- 匿名字段 内嵌结构体 interface作为struct field 匿名接口
- Html5 部分快捷键
- SparkStreaming直连方式读取kafka数据,使用MySQL保存偏移量
- 日志框架(Log4J、SLF4J、Logback)--日志规范与实践
- (13)Linux文件系统的优缺点
- java 石头剪子布游戏
- python中如何添加模块导入路径?