We detail in this paper the numerical implementation of the so-called image curvature microscope, an algorithm that computes accurate image curvatures at subpixel resolution, and yields a curvature map conforming with our visual perception. In contrast to standard methods, which would compute the curvature by a finite difference scheme, the curvatures are evaluated directly on the level lines of the bilinearly interpolated image, after their independent smoothing, a step necessary to remove pixelization artifacts. The smoothing step consists in the affine erosion of the level lines through a geometric scheme, and can be applied in parallel to all level lines. The online algorithm allows the user to visualize the image of curvatures at different resolutions, as well as the set of level lines before and after smoothing.
Source CodeThe ANSI C++ implementation reviewed by IPOL is given in the file curv.cpp. The complete source code, code documentation, and online demo are accessible at the IPOL web page of this article 1 . The level lines extraction (files levelLine.cpp, lltree.cpp) and level lines smoothing (file gass.cpp) are independent algorithms, out of the scope of this article, and details for their implementation are planned for separate IPOL publications.