在OpenCV 2.4.x中初始化MSER所给出的参数的确切含义? [英] Exact Meaning of the parameters given to initialize MSER in OpenCV 2.4.x?
问题描述
OpenCV参考手册(2.4.x)指出,初始化MSER的构造函数需要以下参数:
delta,min_area,max_area,max_variation,min_diversity,max_evolution,area_threshold, min_margin,edge_blur_size.
我正在处理灰度图像.参数"delta","max_variation"和"min_diversity"的用途是什么?这些参数可帮助控制MSER的什么属性?
我已经做了很多尝试来找到确切的答案,并且在以下页面上我只能找到一些信息(在告诉我这三个参数究竟控制什么方面,这些信息都没有特别有用): 1. OpenCV Wiki 2. MSSER的维基百科描述 3. 有关STackOverflow的MSER问题
请帮助!
我假设您了解MSER特征检测工作原理的基础知识(如果不了解,请原始论文介绍了MSER区域,实际公式为:
V_T = (size(CC_{T+delta}(p))-size(CC_{T-delta}(p)))/size(CC_T(p))
OpenCV实现使用略有不同的公式来加快特征提取速度.
最小面积,最大面积
如果一个区域最大程度地稳定,则如果其小于 minArea 像素或大于 maxArea 像素,则仍然可以拒绝该区域.
maxVariation
回到点1的变化(与增量相同的功能):如果一个区域最大稳定,但如果该区域的变化大于 maxVariation ,仍然可以拒绝该变化.
> 即,即使该区域相对"稳定(比附近区域更稳定),也可能不够绝对"稳定.对于较小的maxVariation ,您将获得更少的区域minDiversity
此参数用于修剪过于相似的区域(例如,仅几个像素就不同).
对于 最大稳定的区域CC_T1(p)
,找到区域CC_T2(p)
,它是父最大稳定区域".这意味着T2 > T1
,CC_T2(p)
是最大稳定区域,并且没有T2 > Tx > T1
使得CC_Tx(p)
是最大稳定区域.现在,比较一下父母的身高:
diversity = (size(CC_T2(p)) - size(CC_T1(p))) / size(CC_T1(p))
如果此diversity
比 maxDiversity 小 ,则删除 CC_T1(p)
区域.对于更大的多样性,您将获得更少的区域.
(对于该参数的确切公式,我必须在程序代码中进行挖掘)
OpenCV reference manual (2.4.x) states that the constructor that initializes MSER requires the following parameters:
delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold, min_margin, edge_blur_size.
I am dealing with grayscale images. What is the use of the parameters "delta", "max_variation" and "min_diversity"? What property of an MSER do these parameters help control?
I have tried a lot to find the exact answer to this and I could only find a little information on the following pages (none of which was particularly useful in telling me what exactly do these 3 parameters control): 1. OpenCV wiki 2. Wikipedia description of MSER 3. MSER questions on STackOverflow
Please help!
I am going to presume that you know the basics of how MSER feature detection works (if not, Wikipedia, and short recap follows).
You have two types of MSER regions, positive and negative.
First type, you get by thresholding with all intensities (for grayscale images, 0
to 255
). E.g. for a threshold T = 100
, all pixels with intensity < 100
are assigned black
, or foreground
, and all pixels >= 100
intensity are white
or background
.
Now, imagine you're observing a specific pixel p
. At some threshold, let's call it T1
, it will start belonging to the foreground and stay that way until T=255
. At T1
a pixel will belong to a component CC_T1(p)
. 5
gray levels later, it will belong to the component CC_(T1+5)(p)
.
All of these connected components, obtained for all the thresholds, are potential candidates for MSER. (Other type of components is obtained if you reverse my black/foreground
and white/background
assignments for thresholding).
Parameters help decide which potential candidates are indeed maximally stable:
delta
For every region, variation is measured:
V_T = (size(CC_T(p))-size(CC_{T-delta}(p)))/size(CC_{T-delta}(p))
for every possible threshold
Ti
. If this variation for a pixels is a local minimum of a variation, that is,V_T < V_{T-1}
andV_T < V_{T+1}
, the region is maximally stable.The parameter delta indicates through how many different gray levels does a region need to be stable to be considered maximally stable. For a larger delta, you will get less regions.
note: In the original paper introducing MSER regions, the actual formula is:
V_T = (size(CC_{T+delta}(p))-size(CC_{T-delta}(p)))/size(CC_T(p))
The OpenCV implementation uses a slightly different formula to speed up the feature extraction.
minArea, maxArea
If a region is maximally stable, it can still be rejected if it has less than minArea pixels or more than maxArea pixels.
maxVariation
Back to the variation from point 1 (the same function as for delta): if a region is maximally stable, it can still be rejected if the the regions variation is bigger than maxVariation.
That is, even if the region is "relatively" stable (more stable than the neigbouring regions), it may not be "absolutely" stable enough. For smaller maxVariation, you will get less regions
minDiversity
This parameter exists to prune regions that are too similar (e.g. differ for only a few pixels).
For a region
CC_T1(p)
that is maximally stable, find a regionCC_T2(p)
which is the "parent maximally stable region". That means,T2 > T1
,CC_T2(p)
is a maximally stable region and there is noT2 > Tx > T1
such thatCC_Tx(p)
is maximally stable. Now, compare how much bigger the parent is:diversity = (size(CC_T2(p)) - size(CC_T1(p))) / size(CC_T1(p))
If this
diversity
is smaller than maxDiversity, remove the regionCC_T1(p)
. For larger diversity, you will get less regions.(For the exact formula for this parameter I had to dig through the program code)
这篇关于在OpenCV 2.4.x中初始化MSER所给出的参数的确切含义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!