How to draw a rectangle around a polygon shape ?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to draw a rectangle around any polygon I draw "roi = drawpolygon" . See the picture below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/812624/image.png)
0 commentaires
Réponses (1)
Walter Roberson
le 24 Nov 2021
If you are creating an interactive rectangle for use with ROI, then you might prefer drawrectangle https://www.mathworks.com/help/images/ref/drawrectangle.html
If you have already determined the coordinates of the rectangle and want to draw it to the display, see rectangle()
If you need to create a rectangle inside an array, such as if you are drawing on top of an image array, then see insertShape() from the Computer Vision Toolbox
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!