fix a very important bug. Happens when handling the pixels around the boundary. This bug should also exists in some other versions

Signed-off-by: Enliang <ezheng@cs.unc.edu>
depthmap refinement. This is the correct version. A bunch of bugs were fixed

Signed-off-by: Enliang <ezheng@cs.unc.edu>