I am looking for a way to fit a spline of order 2 to a 2d image or point cloud. The input will be an gray scale image. The start and end points are given as 2D coordinates. The goal is to find a spline that minimizes the energy or average image value that the spline is crossing.
It might be easier to understand with the example image:
The blue line is the target. It should approx. through the valley. I hope it is clear what I need...
I already tried to solve the problem with a LiveWire algorithm but that doesn't lead to a smooth and reliable result.
The programming language is python if that is of any importance.