23索引转二值

197 阅读1分钟

close all;clear all;clc;

load trees;

BW = im2bw(X,map,0.9); %将索引图像转换为二值图

figure

subplot(1,2,1),imshow(X,map); %显示原索引图像

subplot(1,2,2),imshow(BW); %显示转换后二值图像