i must say,
if you look at the link you gave and the code.
the code is a very simple calculation. but the formula on the website is quite more complex.
At this moment to tierd to check if you formula is working.
But i know that your code probbally is slow as hell, this is because C# is standard in "safe mode" and it will slow down image proccessing a lot.
i suggest you start looking into C++ or create a class that is unsafe (contains C++ like code) to calculate these things. it will speed up the calculation by around a factor 100, if not more.
also, i've found this document about Blockmatching:
https://software.intel.com/sites/default...ntium+book
and it has example code in C++, maby you can use that.
but i think the Aforge framework will do everything in "unsafe mode" But you are not utilizing that.
It only asks for a pixels brightness, and then calculate something. getting a value won't matter that much in safe or unsafe mode, but the calculation probably will ;)
i hope it helped a bit!