I am working on Bayesian statistical estimation of parameters (control points) of closed B-spline curve bounding an object on a an image. The problem is that I require those curves to not be much "curved", so with use of prior distribution I penalize curves with higher total curvature (Gibbs energy distribution with energy equal to total curvature).
In a nutshell, I want to measure a curvature of randomly generated B-spline. The problem is that the randomly generated B-spline curve does not have to be regular. Yeah, in practice I calculate this integral numerically and most likely won't hit a singular point, but rigorously I should define total curvature to be able to handle singularities (at most countable many). But in fact, I cannot find an appropiate definition of curvature able to handle singularities.
My algorithm works, because it prioritizes less curved curves without singularities. But in the thesis this is a part of, it needs to be rigorously and correctly argumented. Is there any definition of a (total) curvature which would help me?
Another way to solve this problem should be to add information to prior distribution that those parameters have to represent regular curve or design proposal density in MCMC such that the resulting curve is regular. But I hope there is a definition of a curvature which would solve this problem.