I am trying to fit a B-spline to a set of ordered discrete data points which represent pixels of a contour extracted from a image.
The below code works fine for some simple shapes, but not for others (please see image here http://imgur.com/5IOVmEt
for examples). Why does this happen, and what would be a better way to approach this problem?
I am quite new to differential geometry and MATLAB in general, appreciate any insights or inputs. Thanks.
x = data(:, 1); y = data(:, 2); % data contains two columns representing x,y coordinates
plot(x, y, 'bo');fittedmodel = fit(x, y, 'cubicinterp');plot(fittedmodel, 'r-');
Best Answer