Sum of absolute differences
来源:互联网 发布:淘宝哪家眼镜店好 编辑:程序博客网 时间:2024/05/21 20:25
Sum of absolute differences (SAD) is a widely used, extremely simple algorithm for measuring the similarity between image blocks. It works by taking the absolute differencebetween each pixel in the original block and the corresponding pixel in the block being used for comparison. These differences are summed to create a simple metric of block similarity, the L1 norm of the difference image.
The sum of absolute differences may be used for a variety of purposes, such as object recognition, the generation of disparity maps for stereo images, and motion estimationfor video compression.
Contents
[hide]- 1 Example
- 2 Comparison to other metrics
- 2.1 Object recognition
- 2.2 Video compression
- 3 See also
- 4 References
[edit]Example
This example uses the sum of absolute differences to identify which part of a search image is most similar to a template image. In this example, the template image is 3 by 3 pixels in size, while the search image is 3 by 5 pixels in size. Each pixel is represented by a single integer from 0 to 9.
Template Search image 2 5 5 2 7 5 8 6 4 0 7 1 7 4 2 7 7 5 9 8 4 6 8 5
There are exactly three unique locations within the search image where the template may fit: the left side of the image, the center of the image, and the right side of the image. To calculate the SAD values, the absolute value of the difference between each corresponding pair of pixels is used: the difference between 2 and 2 is 0, 4 and 1 is 3, 7 and 8 is 1, and so forth.
Calculating the SAD values for each of these locations gives the following:
Left Center Right0 2 0 5 0 3 3 3 13 7 3 3 4 5 0 2 01 1 3 3 1 1 1 3 4
For each of these three image patches, the absolute differences are added together, giving a SAD value of 20, 25, and 17, respectively. From these SAD values, it is apparent that the right side of the search image is the most similar to the template image, because it has the least difference as compared to the other locations.
[edit]Comparison to other metrics
[edit]Object recognition
The sum of absolute differences provides a simple way to automate the searching for objects inside an image, but may be unreliable due to the effects of contextual factors such as changes in lighting, color, viewing direction, size, or shape. The SAD may be used in conjunction with other object recognition methods, such as edge detection, to improve the reliability of results.
[edit]Video compression
SAD is an extremely fast metric due to its simplicity; it is effectively the simplest possible metric that takes into account every pixel in a block. Therefore it is very effective for a wide motion search of many different blocks. SAD is also easily parallelizable since it analyzes each pixel separately, making it easily implementable with such instructions as MMX and SSE2. For example, SSE has packed sum of absolute differences instruction (PSADBW) specifically for this purpose. Once candidate blocks are found, the final refinement of the motion estimation process is often done with other slower but more accurate metrics, which better take into account human perception. These include the sum of absolute transformed differences (SATD), the sum of squared differences (SSD), and rate-distortion optimization.
- Sum of absolute differences
- 237 Calculate Sum-Of-Absolute-Differences
- swustojCalculate Sum-Of-Absolute-Differences(0237)
- The Differences Of Browsers!
- codeforces876B Divisiblity of Differences
- Codeforces876B-Divisiblity of Differences
- - Divisiblity of Differences CodeForces
- 所有整数对之间的位差异数之和(Sum of bit differences among all pairs)
- leetcode 530. Minimum Absolute Difference in BST/404. Sum of Left Leaves/563. Binary Tree Tilt
- Differences
- The differences of _single_starting_underscore, __double_starting_underscores, __double_underscores__
- The differences of Iterator and Iterable interface
- Summary of differences between Java versions?
- 564 of 565 differences detected 问题解决办法
- Codeforces 876B. Divisiblity of Differences
- Codeforces Round #441 B.Divisiblity of Differences
- Codeforces 876 B Divisiblity of Differences
- CF B. Divisiblity of Differences【water+WA9】
- 在linux下安装ngx_lua模块,iconv模块
- mysql_auto_increment设置初始值
- 游标加锁更新数据
- oraclevm 安装mac os x 10.8
- SET TRANSACTION READ ONLY 只读事务
- Sum of absolute differences
- 黑马程序员-网络编程
- 使用Silverlight Toolkit中的主题(Theme)
- 计算机视觉、模式识别、机器学习常用牛人主页链接
- 为arm linux内核添加新的系统调用
- 解决win7输入法不见了,5种解决方法
- Android图片处理(Matrix,ColorMatrix)
- GetMemory(char **p, int num)
- ios之沙盒路径