Towards An Effective and Efficient Approximation Algorithm for Advanced Computer Vision Applications based on Two-Dimensional Dynamic Programming