Displaying a value on a image using Imagesc

7 ビュー (過去 30 日間)
Gova ReDDy
Gova ReDDy 2014 年 3 月 11 日
コメント済み: Image Analyst 2014 年 3 月 13 日
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.
Image Analyst
Image Analyst 2014 年 3 月 13 日
You can use imresize().

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by