How to pass from a set of points to lines interpolating them?
Show older comments
Hi everyone! I have obtained the following skeletonization

However, if you zoom, you see that the pink lines are not lines but they are series of rectangles that contain points, like you can see in this figure here below.

I would like to know how to pass from these points (contained in the rectangles) to approximate lines that trace the skeletonization in pink (Maybe there is an approximative interpolation that can do this (?)). Could anyone help me? Thanks in advance
4 Comments
Image Analyst
on 12 Jun 2022
Why do they need to be perfectly straight lines? In other words, what are you prevented from doing if the lines are curved as they are now?
Have you see interp1
Do you just want to connect the centers of the pixels with line segments, like in the following?
load Image
warning off
p=cellfun( @polyshape, bwboundaries(Image));
imagesc(Image); colormap(gray); axis image
hold on;
plot(p(1),'EdgeColor','r','FaceColor','none','LineWidth',3);
hold off
Loren99
on 12 Jun 2022
Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
