Calculate curvature at each point of a irregular object

75 Views Asked by At

I have a polygon which looks like: Cell shape

I would like to calculate the curvature at each point, the formulas I used are:

dx <- diff(c(cellShape_smooth$x, cellShape_smooth$x[1])) # Distance 
between x coords with wrap-around
dy <- diff(c(cellShape_smooth$y, cellShape_smooth$y[1])) # Distance 
between y coords with wrap-around
ds <- sqrt(dx^2 + dy^2)             # Segment size between points
ddx <- dx/ds                        # Ratio of x distance to segment size
ddy <- dy/ds                        # Ratio of y distance to segment size
ds2 <- (ds + c(ds[-1], ds[1]))/2    # Mean segment length 
either side per point
cellShape_smooth$Cx <- diff(c(ddx, ddx[1]))/ds2   # Change in ddx per 
unit length
cellShape_smooth$Cy <- diff(c(ddy, ddy[1]))/ds2   # Change in ddy per 
unit length
cellShape_smooth$K <- (ddy * cellShape_smooth$Cx - ddx * 
cellShape_smooth$Cy)/((ddx^2 + ddy^2)^(3/2))

Using these formulars. I can get the curvatures: curvature values at each point

Indeed, from this plot we can see two protrusions are captured just as the cell shape graph indicated, however, my concern is that whether the magnitude is too large as it's very different from a result that an academic article has shown: Curvature plot from another source Paper link: https://www.biorxiv.org/content/10.1101/623793v1.full

From this figure, we can tell that their curvatures are quite small even if the curve is quite sharp. The article didn't say how they calculate the curvature. Is it because we are using different metrics to calculate curvature? Or is it because there are some errors with my calculations? Any help would be much appreciated, thank you!