Skip to content
Snippets Groups Projects
Verified Commit 4536ed1b authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix incompatibility with MATLAB R2007b

parent 4d7ad782
Branches
Tags
No related merge requests found
Pipeline #298 passed
...@@ -128,7 +128,7 @@ for i = 1:n_colors ...@@ -128,7 +128,7 @@ for i = 1:n_colors
dX = bsxfun(@minus,lab,lastlab); % displacement of last from all colors on list dX = bsxfun(@minus,lab,lastlab); % displacement of last from all colors on list
dist2 = sum(dX.^2,2); % square distance dist2 = sum(dX.^2,2); % square distance
mindist2 = min(dist2,mindist2); % dist2 to closest previously-chosen color mindist2 = min(dist2,mindist2); % dist2 to closest previously-chosen color
[~,index] = max(mindist2); % find the entry farthest from all previously-chosen colors [junk,index] = max(mindist2); % find the entry farthest from all previously-chosen colors
colors(i,:) = rgb(index,:); % save for output colors(i,:) = rgb(index,:); % save for output
lastlab = lab(index,:); % prepare for next iteration lastlab = lab(index,:); % prepare for next iteration
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment