Counting polygon vertices while polygon is drawn
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Image Analyst
le 10 Avr 2013
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?
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!