Filter löschen
Filter löschen

Displaying a value on a image using Imagesc

7 Ansichten (letzte 30 Tage)
Gova ReDDy
Gova ReDDy am 11 Mär. 2014
Kommentiert: Image Analyst am 13 Mär. 2014
Hello,
Can someone explain how to print a value on the image(required image).I tried this but the image was flipped and displayed
plot(5,6,'*r');test=imread('Capture.JPG');hold on;imagesc([.001 .001], [.001 0.001], test)
I also don't understand this scaling [.001 .001], [.001 0.001]
can someone explain of how to use the imagesc to print a value on the(or inside the) image .

Akzeptierte Antwort

Image Analyst
Image Analyst am 13 Mär. 2014
Just use the text() function
caption = sprintf('At (row %d, column %d), the value = %.3f', row, column, yourValue);
text(column, row, caption, 'FontSize', 30, 'Color', [.7, .4, .1]);
  2 Kommentare
Gova ReDDy
Gova ReDDy am 13 Mär. 2014
thanks it works but, can I know how to reduce the image size as the image attached is covering most of the iamge.I want to reduce the size of my image so that it sits in a small of the figure I plot
i=imread('Capture.JPG');
figure;imagesc(10,10,i);
axis([0 400 0 400]);
caption = sprintf('HBR value = %.3f',60);
text(150,150, caption, 'FontSize', 10, 'Color', [.7, .4, .1]);
can I know how to reduce the image size.
Image Analyst
Image Analyst am 13 Mär. 2014
You can use imresize().

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 11 Mär. 2014
compare "axis xy" to "axis ij"
  1 Kommentar
Gova ReDDy
Gova ReDDy am 13 Mär. 2014
Can I get an example to use this imagesc. As I want to print a value of some value here HBR in the middle of the image
box_title = 'HeartRate';
box = uicontrol('Style', 'text','Units', 'norm', 'Position', [0.8 0.8 0.1 0.05]);
set(box,'string', sprintf('%s %f', box_title,HBR));
can I get some example to print a value inside(or middel of the) image.
thanks.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by