File size: 544 Bytes
d4035c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function [D, names, counts] = LMcreateObjectIndexField(D)
%
% [D, names] = LMcreateObjectIndexField(D);
%
% This function adds a new field to the LabelMe index that provides a
% numeric index into the object class. 
% 
% The new field is:
%    annotation.object.namendx
% and this is a pointer into 'names'

% Create list of objects:
[names, counts, imagendx, objectndx, objclass_ndx] = LMobjectnames(D, 'name');
% add new field
for k = 1:length(objclass_ndx)
    D(imagendx(k)).annotation.object(objectndx(k)).namendx = objclass_ndx(k);
end