Maiseli, Baraka J.
Description:
Distance transform, a central operation in image and video analysis, involves finding the shortest path between feature and non-feature entries of a binary image. The process may be implemented using chamfer-based sequential algorithms that apply small-neighborhood masks to estimate the Euclidean metric. Success of these algorithms depends on the cost function used to optimize chamfer weights. And, for years, mean absolute error and mean squared error have been used for optimization. However, studies have revealed weaknesses of these cost functions—sensitivity against outliers, lack of symmetry, and biasedness—which limit their application. In this work, we have proposed a robust and a more accurate cost function, symmetric mean absolute percentage error, which attempts to address some weaknesses. The proposed function averages the absolute percentage errors in a set of measurements and offers interesting mathematical properties (smoothness, differentiability, boundedness, and robustness) that allow easy interpretation and analysis of the results. Numerical results show that chamfer masks designed under our optimization criterion generate lower errors. The present work has also proposed an automatic algorithm that converts coefficients of the designed real-valued masks into integers, which are preferable in most practical computing devices. Lastly, we have modified the chamfer algorithm to improve its speed and then embedded the proposed weights into the algorithm to compute distance maps of real images. Results show that the proposed algorithm is faster and uses fewer number of operations compared with those consumed by the classical chamfer algorithm. Our results may be useful in robotics to address the matching problem.