Displaying a value on a image using Imagesc

7 vues (au cours des 30 derniers jours)
Gova ReDDy
Gova ReDDy le 11 Mar 2014
Commenté : Image Analyst le 13 Mar 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 .

Réponse acceptée

Image Analyst
Image Analyst le 13 Mar 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 commentaires
Gova ReDDy
Gova ReDDy le 13 Mar 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 le 13 Mar 2014
You can use imresize().

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 11 Mar 2014
compare "axis xy" to "axis ij"
  1 commentaire
Gova ReDDy
Gova ReDDy le 13 Mar 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by