Digital Image Processing and Pattern Recognition 第八章 图像分析 .图像分割 (1)单阈值分割(二值化) 假设图像已经归一化 Orherwbe 1讨f(xy)>=T T:阈值
Digital Image Processing and Pattern Recognition 第八章 图像分析 II. 图像分割 (1)单阈值分割(二值化) 假设图像已经归一化 T: 阈值 = = Otherwise if f x y T b x y 0 1 ( , ) ( , )
Digital Image Processing and Pattern Recognition 第八章 图像分析 单阈值分割例子: 原始图像 二值图像 8 0 3 阈值T=7 8 8 2 9 2 8 2
Digital Image Processing and Pattern Recognition 第八章 图像分析 单阈值分割例子: 1 2 8 1 0 3 9 9 9 2 8 9 10 9 8 2 9 9 9 1 2 2 8 3 2 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 阈值T=7 原始图像 二值图像
Digital Image Processing and Pattern Recognition 第八章 图像分析 C/C++程序实现: SingleThreshold(BYTE *data,int T,BYTE **binary) for (int i=0;i<row;i++) for (int j=0;j<col;j++) if (data[i]Lj]>=T) binary[[j]=1;∥通常255 else binary]lj]=0t✉
Digital Image Processing and Pattern Recognition 第八章 图像分析 C/C++程序实现: SingleThreshold(BYTE ** data, int T, BYTE **binary) { for (int i=0;i<row;i++) for (int j=0;j<col;j++) if (data[i][j]>=T) binary[i][j]=1; // 通常255 else binary[i][j]=0; }
T=50
T=150 T= 50
Digital Image Processing and Pattern Recognition 第八章 图像分析 (2)多阈值分割(灰度分层) 81fT<=∫(x,y)<T b(x,y)= 82fT2<=f(x,y)<T 0 Otherwise
Digital Image Processing and Pattern Recognition 第八章 图像分析 (2)多阈值分割(灰度分层) = = = Otherwise g if T f x y T g if T f x y T b x y 0 . ( , ) ( , ) ( , ) 2 2 3 1 1 2