处理此算法的最佳方法是什么

处理此算法的最佳方法是什么

本文介绍了处理此算法的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我目前正在使用AForge Framework开展项目。我正在尝试实现一种称为三步搜索的算法。它将用于通过网络摄像头进行运动检测。





三步搜索(TSS)[1,2]



这个算法是由Koga等人于1981年引入的。它因其简单性和稳健性以及近乎最佳的性能而变得非常流行。它以粗到精的搜索模式搜索最佳运动矢量。该算法可以描述为:



步骤1:选择初始步长。挑选距离中心(中心区域周围)步长的八个街区进行比较。



步骤2:步长减半。中心移动到失真最小的点。



重复步骤1和2,直到步长小于1.一个特定的收敛路径该算法如下所示:



[]



图2:三步收敛的示例路径搜索



资料来源: []





我遇到的问题我们正在理解如何为它所说的选择初始步长的部分设置坐标。距离的八个街区从中心(中心区域周围)的步长进行选择以进行比较。



我知道这些块是使用称为均方误差的公式进行比较的。如果我能想出一种创建搜索块的方法,那么在确定如何实现该算法的其余部分方面会有很长的路要走。如果这有点令人困惑,请道歉。我试图以最好的方式解释它。我可能会以完全错误的方式解决这个问题,因为我对C#及其概念相对较新。



我一直在Matlab网站上找到了源码算法的代码,但它是为Matlab编写的,我不明白。



我在这里上传了Matlab代码,这有助于理解它。



[]

Hi,

I am currently working on a project using the AForge Framework. I am trying implement an algorithm called the "three step search". It will be used for motion detection via a webcam.


Three Step Search (TSS) [1,2]

This algorithm was introduced by Koga et al in 1981. It became very popular because of its simplicity and also robust and near optimal performance. It searches for the best motion vectors in a coarse to fine search pattern. The algorithm may be described as:

Step 1: An initial step size is picked. Eight blocks at a distance of step size from the centre (around the centre block) are picked for comparison.

Step 2: The step size is halved. The centre is moved to the point with the minimum distortion.

Steps 1 and 2 are repeated till the step size becomes smaller than 1. A particular path for the convergence of this algorithm is shown below:

http://www.ece.cmu.edu/~ee899/project/r4-1.gif[^]

Fig 2 : Example path for convergence of Three Step Search

Source: http://www.ece.cmu.edu/~ee899/project/deepak_mid.htm[^]


The problem I have having is understanding how the coordinates are set for the part where it says "An initial step size is picked. Eight blocks at a distance of step size from the centre (around the centre block) are picked for comparison."

I do know that these blocks are compared using a formula called mean square error. If I could just figure out a way of creating the search block then it would go a long way in figuring out how to implement the rest of this algorithm. Apologies if this is a bit confusing to understand. I have tried to explain it the best way possible. I could be going about this the total wrong way as I am relatively new to C# and its concepts.

I have been on the Matlab website where I have found the source code for the algorithm but it is written for Matlab which I do not understand.

I have uploaded the Matlab code here is that helps understand it more.

http://pastebin.com/sCKXZhKx[^]

推荐答案


这篇关于处理此算法的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 00:41