edge函數實現的語法格式如下:
BW=edge(I, 'sobel')
BW=edge(I, 'sobel',thresh)
BW=edge (I, 'sobel', thresh, direction)
[BW, thresh]=edge (I, 'sobel'…)
BW=edge(I, 'sobel') 自動選擇閾值用Sobel算子進行邊緣檢測。
BW=edge(I, 'sobel',thresh)根據所指定的敏感度閾值thresh,用Sobel算子進行邊緣檢測,它忽略了所有小於閾值的邊緣。當thresh為空時,自動選擇閾值。
BW=edge (I, 'sobel', thresh, direction)根據所指定的敏感度閾值thresh,在所指定的方向direction上,用Sobel 算子進行邊緣檢測。Direction可取的字符串值為horizontal(水平方向)、vertical(垂直方向)或both(兩個方向)。
[BW, thresh]=edge (I, 'sobel'…)返回閾值