Code covered by the BSD License  

Highlights from
myLabel 0.04

image thumbnail
from myLabel 0.04 by Nikolay Chumerin
Image labeling tool for Matlab.

change_label(old_label,new_label,wildcard,labels_dir)
function change_label(old_label,new_label,wildcard,labels_dir)
if ~exist('labels_dir','var') || isempty(labels_dir),
    labels_dir = '/huge_sidonia/nick/sequences/city3/labels/rectified/638x508';
end
if ~exist('wildcard','var') || isempty(wildcard),
    wildcard = '*.mat';
end
if ~exist('old_label','var') || isempty(old_label),
    old_label = 128;
end
if ~exist('new_label','var') || isempty(new_label),
    new_label = 131 ;
end

fprintf('Changing label %g with new value %g:           ',old_label,new_label);
list = dir(fullfile(labels_dir,wildcard));
for i = 1:length(list)
    fprintf('\b\b\b\b\b\b\b%6.1f%%',100*(i-1)/length(list));
    if ~list(i).isdir,
        data = load(fullfile(labels_dir,list(i).name));
        l    = data.l;
        l(find(l==old_label)) = new_label;
        save(fullfile(labels_dir,list(i).name),'l');
    end
    fprintf('\b\b\b\b\b\b\b%6.1f%%',100*i/length(list));
end
fprintf(' done.\n');

Contact us at files@mathworks.com