www.gusucode.com > images 案例代码 matlab源码程序 > images/ConvertAnIndexedImageToABinaryImageExample.m

    %% Convert an Indexed Image To a Binary Image
%
%%

% Copyright 2015 The MathWorks, Inc.

load trees
BW = im2bw(X,map,0.4);
imshow(X,map), figure, imshow(BW)