MATLAB: How to position the text

displayingtext

I have a code for face detection,i have displayed word Face,how how to position in near the bounding box
http://imgur.com/oKQixuN
code
clear
close all
x=imread('test01.jpg');
I=x;
if (size(x,3)>1)%if RGB image make gray scale
try
x=rgb2gray(x);%image toolbox dependent
catch
x=sum(double(x),3)/3;%if no image toolbox do simple sum
end
end
x=double(x);%make sure the input is double format
[output,count,m,svec]=facefind(x);%full scan
imagesc(x), colormap(gray)%show image
plotbox(output,[],3)%plot the detections as red squares
uicontrol('Style','text','Position', [output(1) output(2) 30,...... ....20],'String','FAce')

Best Answer

Do not use an UICONTROL('style', 'text'), because its coordinates are realtive to the figure. Although it is possible to convert the local position of the face relative to the AXES in figure coordniates also, using the text() command is much more direct.
text(output(1), output(2), 'Face')
Play with the background property for a bounding box on demand.
Related Question