Counting polygon vertices while polygon is drawn
조회 수: 3 (최근 30일)
이전 댓글 표시
Is there a way to count the number of polygon vertices specified in impoly(), roipoly(), or roipolyold() while the polygon is being drawn? I'd like to add a counter to my GUI to let the user know how many points they've selected while drawing a polygon. This way, they can make sure to have the minimum number of points required for each polygon so that the program performs optimally. Thus far,I have only been able to accomplish creating such a counter using ginput and a while loop. However, I really don't like that ginput cannot be constrained to an axes object. I'd prefer to limit my user from clicking outside the desired area (i.e. the image). Anyhow, I would greatly appreciate any suggestions/comments. Thanks!
댓글 수: 0
답변 (1개)
Image Analyst
2013년 4월 10일
Not that I know of. You could put something like imline() in a loop and build it up just one line at a time. But how many vertices are required? If there are just a few (4-8), why not just count them when they're all done and alert them only then if there are not enough?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!