您的位置首页百科问答

Matlab图像二值化

Matlab图像二值化

的有关信息介绍如下:

Matlab图像二值化

Matlab对灰度图像进行二值化

首先读取到一张图片

I = imread('fordebug.bmp');

用graythresh和im2bw命令

thresh = graythresh(I); %自动确定二值化阈值

I2 = im2bw(I,thresh); %对图像二值化

--------------------------------------------------

--------------------------------------------------

说明:

1.graythresh命令为Matlab 自动确定最佳阈值

2.im2bw 为二值转换函数

效果就出来了!

Enjoy!