bwareaopen是matlab函式,作用是刪除二值圖像BW中面積小於P的對象,默認情況下conn使用8鄰域。
基本介紹
- 外文名:bwareaopen
- 作用:刪除二值圖像BW中面積小於P對象
- 簡介:matlab函式圖像處理函式
- 格式:BW2 = bwareaopen(BW,P,conn)
簡介,說明,格式,作用,例子,
簡介
matlab函式
圖像處理函式
說明
刪除小面積對象
格式
BW2 = bwareaopen(BW,P,conn)
作用
刪除二值圖像BW中面積小於P的對象,默認情況下conn使用8鄰域。
例子
originalBW = imread('text.png');
imshow(originalBW)
bwAreaOpenBW = bwareaopen(originalBW,50);
imshow(bwAreaOpenBW)
改寫為---->
figure;
subplot(1,2,1);
originalBW = imread('text.png');
imshow(originalBW);
subplot(1,2,2);
level = graythresh(double(originalBW));
originalBW = im2bw(originalBW,level);
bwAreaOpenBW = bwareaopen(originalBW,50);
imshow(bwAreaOpenBW);
