how to display string over image for scene labeling?

how to label the objects in the scene image after performing training and tesing..

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 12 月 7 日

0 投票

text()

3 件のコメント

sheno39
sheno39 2013 年 12 月 7 日
can u give me the sample code..
Walter Roberson
Walter Roberson 2013 年 12 月 7 日
xpos = 5;
ypos = 3.9;
text(xpos, ypos, 'this is a label')
sheno39
sheno39 2013 年 12 月 7 日
i need to write string over an image.. how to code?
Thank You Sir.

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

chitresh
chitresh 2013 年 12 月 7 日

0 投票

>> a = imread('Image_File');
>> binary = im2bw(a);
>> l = bwlabel(a_b,4);% 4 or 8 we can choose according to our requirement
>> [r, c] = find(l==2);
>> rc = [r c];
>> imshow(l == 2)
>> s = regionprops(l, 'Centroid');
>> imshow(a_b)
>> for k = 1:numel(s)
c = s(k).Centroid;
text(c(1), c(2), sprintf('%d', k),'HorizontalAlignment', 'center','VerticalAlignment', 'middle');
end
hold off
if you problem is solved accept the answer :-)

質問済み:

2013 年 12 月 7 日

回答済み:

2013 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by