Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
text in image

Subject: text in image

From: Betty Vag

Date: 3 Oct, 2010 14:16:04

Message: 1 of 6

how can I use the text command on the image..I load the picture and then I do what?how is the text reffering to the image I want?

Subject: text in image

From: ImageAnalyst

Date: 3 Oct, 2010 17:39:19

Message: 2 of 6

On Oct 3, 10:16 am, "Betty Vag" <betty00...@hotmail.com> wrote:
> how can I use the text command on the image..I load the picture and then I do what?how is the text reffering to the image I want?

-------------------------------------
Run this demo to understand:

% Read in a standard MATLAB gray scale demo image.
folder = 'C:\Program Files\MATLAB\R2010a\toolbox\images\imdemos';
baseFileName = 'cameraman.tif';
fullFileName = fullfile(folder, baseFileName);
grayImage = imread(fullFileName);
% Display the original gray scale image.
imshow(grayImage, []);
set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full
screen.

% Place a title/caption "above" (but not on top of) the image on the
figure.
title('Original Image', 'FontSize', 45);

% Place a yellow caption "above" (on top of) the image in the overlay.
text(10, 20, 'This text is in the overlay',...
    'Color', [1 1 0], 'FontSize', 30);

Subject: text in image

From: Betty Vag

Date: 3 Oct, 2010 18:12:04

Message: 3 of 6

thank you very much!!!

Subject: text in image

From: Betty Vag

Date: 10 Oct, 2010 12:20:04

Message: 4 of 6

how can I text the value of i ???
my command is like this:
for i=1 : 10
text(10+i*50, 681, '.',...
    'Color', [1 1 1], 'FontSize', 12);
end
i want to text the value of i next to the spot. what should I do?

Subject: text in image

From: Image Analyst

Date: 10 Oct, 2010 13:41:03

Message: 5 of 6

You mean like this:

for k=1 : 10
    string = ['.' num2str(k)];
text(10+k*50, 681, string,...
    'Color', [1 1 1], 'FontSize', 12);
end

Note I changed i to k since it's not a good idea to use i (the imaginary constant) as a loop iterator.

Subject: text in image

From: Betty Vag

Date: 10 Oct, 2010 13:52:03

Message: 6 of 6

yes,thanks a lot!!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us