How to position the text
6 views (last 30 days)
Show older comments
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')
0 Comments
Accepted Answer
Jan
on 21 Jan 2013
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.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!