Efficient method of pixel neighborhood traversal - Pyatykh, Stanislav; Zheng, Lei; Hesser, Jürgen (Journal of visual communication and image representation, 2012)
The processing of a pixel neighborhood is a common operation in image processing. Therefore, a flexible, computationally efficient and easy-to-use strategy for neighborhood traversal is required. In this paper, a new neighborhood traversal method and its implementation in C++ are presented. In the proposed method, the pixel neighbor access is organized without boundary checks and without image extension, which yields to significant improvements of computational efficiency. The method is based on a partition of the image domain, for which valid neighbor pixel offsets can be precomputed for each subset. The proposed C++ implementation is based on generic programming and can handle images of arbitrary dimensionality. It hides all implementation details from the user and can be extended in order to support additional boundary conditions. The evaluation demonstrates that the proposed method is considerably faster than neighborhood traversal implementations from other libraries.