24RGB转二值

229 阅读1分钟

close all;clear all;clc;

I=imread('pears.png'); %读取图像信息

BW=im2bw(I,0.5); %将RGB图像转换为二值图像

figure,

subplot(121),imshow(I); %显示原图像

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