Description
The goal of this project is to implement algorithm that creates curvature scale space (CSS) image of given shape using OpenCV library. “The CSS image consists of several archshape contours representing the inflection points of the shape as it is smoothed. The maxima of these contours are used to represent a shape. The CSS representation is robust with respect to scale, noise and change in orientation.”[1]
Process
 Find contour coordinates of given shape
 Gaussian kernel is the base for upcoming steps:
transpose(getGaussianKernel(width, sigma, CV_64FC1), G);

Curve evolution can be computed by convolution of contour points with Gaussian kernel. Smoothed contour is not needed for CSS computation; it is used only to visualize the process:
filter2D(X, Xsmooth, X.depth(), G); filter2D(Y, Ysmooth, Y.depth(), G);
 To compute 1^{st} and 2^{nd }derivation of contour points, Gaussian kernel derivations will be needed:
Sobel(G, dG, G.depth(), 1, 0, 3); Sobel(G, ddG, G.depth(), 2, 0, 3);
 Convolution of contour points using derivatives of Gaussian kernel. According to OpenCV documentation: filter2D does actually computes correlation, not the convolution. That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using flip() and set the new anchor to (kernel.cols – anchor.x – 1, kernel.rows – anchor.y – 1) :
flip(dg, dg, 0); flip(ddg, ddg, 0); Point anchor(dg.cols  fwhm 1, dg.rows  0  1); filter2D(X, dX, X.depth(), dG, anchor); filter2D(Y, dY, Y.depth(), dG, anchor); filter2D(X, ddX, X.depth(), ddG, anchor); filter2D(Y, ddY, Y.depth(), ddG, anchor);
 Finally, we calculate the curvature and find zero crossings:
 Zerocrossing points are plotted to the final CSS image. Xaxis represents position of point on the curve; Yaxis represents the value of sigma:
findContours(im, contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE );
Following steps are repeated with increased sigma until there are no zerocrossing points:
Practical Applications
 Finding similar shapes (Used as shape descriptor in MPEG7 standard)
 Corner detection
References
[1] Sadegh Abbasi, Farzin Mokhtarian, Josef Kittler: Curvature Scale Space Image in Shape Similarity Retrieval. Multimedia Syst. 7(6): 467476 (1999)
[2] Farzin Mokhtarian, Alan K. Mackworth: A Theory of Multiscale, CurvatureBased Shape Representation for Planar Curves. IEEE Trans. Pattern Anal. Mach. Intell. 14(8): 789805 (1992)