This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/DIPCV/lab1/lab1_4.m
2022-12-06 19:23:49 +08:00

11 lines
No EOL
260 B
Matlab

clear;
clc
close all;
disp('====E2_4_2.m====');
I=imread('PIC2.4.3a-RGB24b.bmp');
imfinfo('PIC2.4.3a-RGB24b.bmp')
I2=im2bw(I); % 语句1
imwrite(I2,'PIC2.4.3b-GRAY.bmp');
imfinfo('PIC2.4.3b-GRAY.bmp')
figure,subplot(1,2,1),imshow(I);
subplot(1,2,2),imshow(I2);