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

1 visualizzazione (ultimi 30 giorni)
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?
Thanks!!!

Risposta accettata

Matt J
Matt J il 1 Ott 2022
Copy the first point and append it to the end of the list

Più risposte (1)

Matt J
Matt J il 1 Ott 2022
Use thte points to contruct a polyshape object,
plot(polyshape(points))

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by