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

1 次查看(过去 30 天)
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!!!

采纳的回答

Matt J
Matt J 2022-10-1
Copy the first point and append it to the end of the list

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by