Can I display the value of a variable onto an image?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
JayJay
am 31 Jul. 2018
Beantwortet: JayJay
am 31 Jul. 2018
I=imread('cameraman.tif');
BW=roipoly(I);
c=bwarea(BW)
I want the value of c to show up on my figure. For eg, if the area (c) = 30, I want the text 'Area=30' to show up on the figure of the cameraman.tif image. Is this possible?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 31 Jul. 2018
Do this:
caption = sprintf('Area = %f', c);
text(10, 10, caption, 'FontSize', 30);
0 Kommentare
Weitere Antworten (2)
Jan
am 31 Jul. 2018
Should it appear in the figure, or do you want to insert it in the saved image file? Both is possible.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!