<h3 style="margin:0px 0px 0.3em; padding-top:0.5em; padding-bottom:0.17em; border-bottom-style:none; font-size:18px; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; line-height:21px"> 本文部分文字Copy自OpenCV中文网站</h3>
<h3 style="margin:0px 0px 0.3em; padding-top:0.5em; padding-bottom:0.17em; border-bottom-style:none; font-size:18px; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; line-height:21px"> Sobel</h3>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> 使用扩展 Sobel 算子计算一阶、二阶、三阶或混合图像差分</p>
<pre style="padding:1em; border:1px dashed rgb(47,111,171); background-color:rgb(249,249,249); line-height:1.1em; font-size:13px">void cvSobel( const CvArr* src, CvArr* dst, int xorder, int yorder, int aperture_size=3 );
</pre>
<dl style="margin-top:0.2em; margin-bottom:0.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px; line-height:21px">
src
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
输入图像.
</dd>
dst
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
输出图像.
</dd>
xorder
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
x 方向上的差分阶数
</dd>
yorder
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
y 方向上的差分阶数
</dd>
aperture_size
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
扩展 Sobel 核的大小,必须是 1, 3, 5 或 7。 除了尺寸为 1, 其它情况下, aperture_size ×aperture_size 可分离内核将用来计算差分。对 aperture_size=1的情况, 使用 3x1 或 1x3 内核 (不进行高斯平滑操作)。这里有一个特殊变量 CV_SCHARR (=-1),对应 3x3 Scharr 滤波器,可以给出比 3x3 Sobel 滤波更精确的结果。Scharr 滤波器系数是:
</dd>
</dl>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> <img alt="\begin{bmatrix} -3 & 0 & 3 \\ -10 & 0 & 10 \\ -3 & 0 & 3 \end{bmatrix}" class="tex" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-8f44bb433e206039c3334a86167eae63.png" style="border:none; vertical-align:middle; margin:0px"></p>
<dl style="margin-top:0.2em; margin-bottom:0.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px; line-height:21px">
<dd style="line-height:1.5em; margin-left:2em; margin-bottom:0.1em">
对 x-方向 或矩阵转置后对 y-方向。
</dd>
</dl>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> 函数 cvSobel 通过对图像用相应的内核进行卷积操作来计算图像差分:</p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> <img alt="dst(x,y) = \frac{d^{xorder+yorder}src} {dx^{xorder} dy^{yorder}} |(x,y)" class="tex" src="http://wiki.opencv.org.cn/images/math/c2dd67bbaf0880f9a28bf9b466bc7a73.png" style="border:none; vertical-align:middle; margin:0px"></p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> 由于Sobel 算子结合了 Gaussian 平滑和微分,所以,其结果或多或少对噪声有一定的鲁棒性。通常情况,函数调用采用如下参数 (xorder=1, yorder=0, aperture_size=3) 或 (xorder=0, yorder=1, aperture_size=3) 来计算一阶 x- 或 y- 方向的图像差分。第一种情况对应:</p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> <img alt="\begin{bmatrix} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \end{bmatrix}" class="tex" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-ef18b885d6b11deea7dfa7d2c64642a0.png" style="border:none; vertical-align:middle; margin:0px"> 核。</p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> 第二种对应:</p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> <img alt="\begin{bmatrix} -1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1 \end{bmatrix}" class="tex" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-e3a6ba467849d6c73fe5f6af20d08fc9.png" style="border:none; vertical-align:middle; margin:0px"></p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvetica,Arial,sans-serif; font-size:13px"> 或者</p>
<p style="margin-top:0.4em; margin-bottom:0.5em; line-height:1.5em; font-family:Tahoma,'Lucida Grande',Verdana,Helvet |
|