imfreehand() closes the curve in the image but does not save those "closing" points

2 views (last 30 days)
I want to freely draw a segment in an image and thats why im using:
H = imfreehand('Closed',1)
p = wait(H)
This closes the curve that im drawing (visually) but when I plot the points from p the points of the closing part of the curve are missing. Here´s an example:
The marked region of the curve is the one that it has been "closed" automatically:
But then when plotting those points saved in p, i have them missing (is the same segment but rotated):
Does anyone knows how to get those missing points from the segment?

Accepted Answer

Matt J
Matt J on 1 Oct 2022
Copy the first point and append it to the end of the list

More Answers (1)

Matt J
Matt J on 1 Oct 2022
Use thte points to contruct a polyshape object,

Community Treasure Hunt

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

Start Hunting!

Translated by