哈达玛变换的应用SATD、SAD等匹配算法

参考:新一代高效视频编码 H.265/HEVC:原理、标准与实现、

转载:http://xiyou07127.blog.163.com/blog/static/11349879220125241070660/

用的基于区域的局部匹配准则主要有图像序列中对应像素差的绝对值(SAD, Sum of Absolute Differences),图像序列中对应像素差的平方和(SSD, Sum of Squared Differences),图像的相关性(NCC, Normalized Cross Correlation)等,另外还有Census变换法,也是一种基于区域的匹配方法。 

(1)       SAD 算法:SAD算法是一种最简单的匹配算法,用公式表示为:

SAD(u,v) = Sum{|Left(u,v) - Right(u,v)|}  选择最小值

此 种方法就是以左目图像的源匹配点为中心,定义一个窗口D,其大小为(2m+1) (2n+1),统计其窗口的灰度值的和,然后在右目图像中逐步计算其左右窗口的灰度和的差值,最后搜索到的差值最小的区域的中心像素即为匹配点。

基本流程:

1.构造一个小窗口,类似与卷积核。

2.用窗口覆盖左边的图像,选择出窗口覆盖区域内的所有像素点。 

3.同样用窗口覆盖右边的图像并选择出覆盖区域的像素点。

4.左边覆盖区域减去右边覆盖区域,并求出所有像素点差的绝对值的和。

5.移动右边图像的窗口,重复3,4的动作。(这里有个搜索范围,超过这个范围跳出) 

6.找到这个范围内SAD值最小的窗口,即找到了左边图像的最佳匹配的像素块。

(2)SSD 匹配算法:SSD算法与SAD算法相似,其公式为:

SSD(u,v) =  Sum{[Left(u,v) - Right(u,v)] * [Left(u,v) - Right(u,v)]} 选择最大值

(3)NCC 匹配算法:NCC算法是计算两幅图像匹配区域的互相关性,其计算公式为:

     NCC(u,v) =  [(wl - w)/(|wl - w|)]*[(wr - w)/(|wr - w|)] 选择最大值

NCC is a standard method for matching two windows around a pixel of interest. The nor-malization within the window compensates differences in gain and bias. NCC is statistically the optimal method for compensating Gaussian noise. However, NCC tends to blur depth discontinuities more than many other matching costs, because outliers lead to high errors within the NCC calculation.

由 以上三种算法可知,SAD算法最简单,因此当模板大小确定后,SAD算法的速度最快。NCC算法与SAD算法相比要复杂得多。

------------------------------------

SAD(Sum of Absolute Difference)=SAE(Sum of Absolute Error)即绝对误差和

SSD(Sum of Squared Difference)=SSE(Sum of Squared Error)即差值的平方和

SATD(Sum of Absolute Transformed Difference)即hadamard变换后再绝对值求和

MAD(Mean Absolute Difference)=MAE(Mean Absolute Error)即平均绝对差值

MSD(Mean Squared Difference)=MSE(Mean Squared Error)即平均平方误差

猜你喜欢

转载自blog.csdn.net/sinat_39372048/article/details/81221800
sad