Does 'improfile' keep a constant number of samples between successive segments?

2 views (last 30 days)
I'm trying to extract several profiles along a path in an image. If I loop the function between successive coordinate pairs, I get the correct result.
Example:
for k=1:N
profiles(k,:)=improfile(im, xs(k,:), ys(k,:), samples, 'bilinear');
end
But 'improfile' should be able to do this without a loop, as it handles a path with successive points. But when I try this:
allprofiles=improfile(im, xs, ys, size(xs, 1)*samples, 'bilinear');
profiles=reshape(allprofiles, samples, []).';
I get a different result and it seems like the number of points interpolated in each segments is not consistent. Is this the way the function is supposed to work, or am I doing something wrong?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!