add edge detection

Signed-off-by: ShuoX Liu <shuox.liu@gmail.com>