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[
^]