Surface Curvature from Range Images (or Depth Maps)

Brickle Macho bricklemacho at gmail.com
Wed Nov 13 08:19:44 EST 2013


I have implemented mean and gaussian curvature methods in python and 
thought they may be appropriate for inclusion to skimage.  An outline of 
the code is provided below.  It assumes a surface defined as a function 
of two coordinates, e.g. z = Z(x, y).  The curvature calculations are 
from the following two papers

* Kurita, T., & Boulanger, P. (1992). Computation of Surface Curvature 
from Range Images Using Geometrically Intrinsic Weights. In /MVA/ (pp. 
389-392).

* Zhao, C., Zhao, D., & Chen, Y. (1996, August). Simplified Gaussian and 
mean curvatures to range image segmentation. In /Pattern Recognition, 
1996., Proceedings of the 13th International Conference on/ (Vol. 2, pp. 
427-431). IEEE.

If appropriate let me know and I will read the contribution/development 
documentation, make the code more robust and submit formally.

Regards,

Michael.
--


Here is a basic outline of the code (H and K are used as they appear 
common terms used in the literature) :
---------------BEGIN CODE--------------
import numpy as np

Zy, Zx = np.gradient(Z)
Zxy, Zxx = np.gradient(Zx)
Zyy, _ = np.gradient(Zy)

# Mean Curvature - equation (3) from Kurita and Boulanger (1992) paper
# See also Surface in 3D space, http://en.wikipedia.org/wiki/Mean_curvature
H = (1 + (Zx ** 2)) * Zyy + (1 + (Zy ** 2)) * Zxx - 2 * Zx * Zy * Zxy
H = H / ((2 * (1 + (Zx ** 2) + (Zy ** 2))) ** 1.5)

# Gaussian Curvature - equation (4) from Kurita and Boulanger (1992) paper
K = (Zxx * Zyy - (Zxy ** 2)) /  ((1 + (Zx ** 2) + (Zy **2)) ** 2)

# Simplified Mean Curvature - equation (3) from Zhao et.al (1996) paper
H = Zxx + Zyy

#  Simplified Gaussian Curvature - equation (3) from Zhao et.al (1996) 
paper
K = Zxx * Zyy - (Zxy ** 2)
---------------END CODE--------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20131113/58bdad2e/attachment.html>


More information about the scikit-image mailing list