How to draw a rectangle on a image?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to draw a rectangle on a image.
box =[100 200 200 200]
im=imread(im); figure, imshow(im)
hold on rectange = rectangle('Position', box, 'FaceColor','k')
Everytime the image gets displayed but without the rectangle. Please help me.
0 Kommentare
Antworten (1)
DGM
am 21 Mär. 2023
I'm going to guess that whatever the image was, it was either too small for the specified rectangle to be in-frame, or it was large, and the rectangle was being placed in a dark region.
box =[100 200 100 100];
im=imread('peppers.png');
imshow(im)
hold on
rectangle('Position', box, 'FaceColor','k')
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
