*讀取圖片
read_image (Image, 'fabrik') *提取邊緣
roberts (Image, ImageRoberts, 'roberts_max')
*二值化 threshold (ImageRoberts, Region, 9, 255) *提取骨架
skeleton (Region, Skeleton) dev_display (Image) dev_set_color ('red') dev_display (Skeleton)
=============================================
Roberts算子,又稱羅伯茨算子,是一種最簡單的算子,是一種利用局部差分算子尋找邊緣的算子。
他采用對角線方向相鄰兩象素之差近似梯度幅值檢測邊緣。
檢測垂直邊緣的效果好於斜向邊緣,定位精度高,對噪聲敏感,無法抑制噪聲的影響。
roberts(Image : ImageRoberts : FilterType : )
Description
roberts calculates the first derivative of an image and is used as an edge operator. If the following mask describes a part of the image,
A B
C D
the different filter types are defined as follows:
'roberts_max' max(| A - D |,| B - C |)
'gradient_max' max(| A + B - (C + D)|,| A + C - (B + D)|)
'gradient_sum' |A + B - (C + D)| + |A + C - (B + D)|
If an overflow occurs the result is clipped. The result of the operator is stored at the pixel with the coordinates of "D".