Displaying a value on a image using Imagesc

6 次查看(过去 30 天)
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 .

采纳的回答

Image Analyst
Image Analyst 2014-3-13
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 个评论
Gova ReDDy
Gova ReDDy 2014-3-13
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.

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2014-3-11
compare "axis xy" to "axis ij"
  1 个评论
Gova ReDDy
Gova ReDDy 2014-3-13
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by