Skip to content

Commit 04fa09f

Browse files
committed
docs(selectivesearch): 更新源码解析:预处理操作
1. 创建选择性搜索对象 2. 设置原始图像 3. 设置分组策略
1 parent e44bb02 commit 04fa09f

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

docs/选择性搜索-源码解析.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,71 @@
8484

8585
## 超参数
8686

87-
## 函数流程
87+
图分割相关:
88+
89+
* $k$:用于计算阈值函数τ,控制两个分量之间的差异必须大于其内部差异的程度
90+
* $\sigma$:作用于高斯滤波
91+
92+
## 函数流程
93+
94+
根据测试代码`samples/selectivesearchsegmentation.cpp`,总体函数流程图如下所示
95+
96+
1. 创建选择性搜索对象,输入原始图像,设置检测策略
97+
2. 处理图像,获取候选区域
98+
3. 绘制候选区域边框
99+
100+
### 第一步:预处理
101+
102+
分为`3`个步骤:
103+
104+
1. 创建选择性搜索对象,使用函数`createSelectiveSearchSegmentation`
105+
2. 输入原始图像,使用函数`setBaseImage`
106+
3. 设置检测策略
107+
108+
#### 创建选择性搜索对象
109+
110+
`createSelectiveSearchSegmentation`是一个辅助性函数,用于创建`SelectiveSearchSegmentation`对象,其返回一个`SelectiveSearchSegmentation`指针
111+
112+
#### 输入原始图像
113+
114+
通过调用类`SelectiveSearchSegmentation`的公共函数`setBaseImage`载入原始图像
115+
116+
#### 设置检测策略
117+
118+
`SelectiveSearchSegmentation`提供了`3`种检测策略:
119+
120+
1. 简单计算策略`switchToSingleStrategy`
121+
2. 快速计算策略`switchToSelectiveSearchFast`
122+
3. 高质量计算策略`switchToSelectiveSearchQuality`
123+
124+
##### 简单计算策略
125+
126+
函数`switchToSingleStrategy`仅使用单个分组
127+
128+
* 颜色空间:`HSV`
129+
* 图分割超参数:`k=200,sigma=0.8`
130+
* 相似性度量:`0.25*color + 0.25*texture + 0.25*size + 0.25*size`
131+
132+
##### 快速分组策略
133+
134+
函数`switchToSelectiveSearchFast`使用多个分组
135+
136+
* 颜色空间:`HSV、Lab`(共`2`种)
137+
* 图分割超参数:`base_k = 150,inc_k = 150,sigma = 0.8`(在程序中最高`k`值设置为`base_k + inc_k * 2`,所以`k`取值为`150/300/450`,共`3`种)
138+
* 相似性度量:`0.25*color + 0.25*texture + 0.25*size + 0.25*fill``0.3333*fill + 0.3333*texture + 0.3333*size`(共`2`种)
139+
140+
所以快速计算策略使用了`2*3*2=12`个分组
141+
142+
##### 高质量计算策略
143+
144+
函数`switchToSelectiveSearchQuality`使用了更多的分组
145+
146+
* 颜色空间:`HSV、Lab、I、H、bgI`(共`5`种)
147+
* 图分割超参数:`base_k = 150,inc_k = 150,sigma = 0.8`(在程序中最高`k`值设置为`base_k + inc_k * 2`,所以`k`取值为`150/300/450`,共`3`种)
148+
* 相似性度量:`0.25*color + 0.25*texture + 0.25*size + 0.25*fill、0.3333*fill + 0.3333*texture + 0.3333*size、fill、size`(共`4`种)
149+
150+
所以高质量计算策略使用了`5*3*4=60`个分组
151+
152+
### 第二步:区域检测
153+
154+
在预处理阶段设置了多个分组策略,

0 commit comments

Comments
 (0)