opencv形态膨胀过滤器作为最大的过滤器 [英] opencv morphological dilation filter as maximum filter
问题描述
但是我在opencv中找不到这样的过滤器,最接近的是dilate函数
然后,我使用默认配置dilate函数,但结果是不正确的
比较我的蛮力执行的最大过滤器。
我发现对于3x3的情况,等效的扩张配置是使用1x1矩形结构元素,即
dilate(src,dst,getStructuringElement(MORPH_RECT,Size(1,1)))
我的问题是:
-
对于我来说,我认为一个结构元素相当于一个本地窗口,但现在局部窗口的大小只有1x1像素?如果我的最大过滤器的本地窗口扩大(例如5x5,7x7)怎么办?是否有最大的过滤器和膨胀过滤器之间的任何关系?$ / $>
It seemed counter-intuitive for me that I thought a structure element is equivalent to a local window. But now the local window's size is only 1x1 pixel?
What if my maximum filter's local window expands(e.g. 5x5, 7x7)? Is there any relationship between the maximum filter and dilation filter?
在Mathematica中的实现示例:
$ b
$ b 但是 Dilation [] 也可以接受一个结构化的内核:
Like the definition of median filter, I can define "maximum filter" as for a local window
e.g. dst(x,y) = max(3x3 local window pixels)
But I cannot find such a filter in opencv, the closest one is "dilate" function
Then I use the default configuration of "dilate" function, but the result is incorrect compare to my brute force implementation of the maximum filter.
I found that for 3x3 case, the equivalent dilate configuration is to use a 1x1 rectangular structure element, that is
dilate(src, dst, getStructuringElement(MORPH_RECT, Size(1,1)))
My questions are:
An implementation example in Mathematica:
But Dilation[ ] also accepts a structuring kernel:
这篇关于opencv形态膨胀过滤器作为最大的过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!