Skip to content

Commit

Permalink
- LEP relabeled so that no strange behavior is seen on the high recal…
Browse files Browse the repository at this point in the history
…l ranges
  • Loading branch information
jponttuset committed Mar 3, 2016
1 parent 1ef55f8 commit c102aad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/aux/relabel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function relabeled = relabel(partition)
% relabeled = relabel(partition)
%
% Relabels connected regions in the partition, sweeping from left to right
% and from up to down. See tests for examples.
% ------------------------------------------------------------------------
% INPUTS
% partition Partition to relabel
%
% OUTPUTS
% relabeled Relabeled partition
% ------------------------------------------------------------------------
% Copyright (C)
% Universitat Politecnica de Catalunya (UPC) - Barcelona - Spain
%
% Jordi Pont-Tuset <[email protected]>
% June 2011
% ------------------------------------------------------------------------

seg = seg2gridbmap(partition);
seg(1:2:end,1:2:end)=1;
filled_contours = bwlabel(1-seg',4);
relabeled = filled_contours(2:2:end,2:2:end)';
end
2 changes: 1 addition & 1 deletion src/io/read_one_lep.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
partition = [];
else
segs = loadvar(res_file,'segs');
partition = uint32(segs{str2double(parameter)});
partition = uint32(relabel(segs{str2double(parameter)}));
end
end

0 comments on commit c102aad

Please sign in to comment.