Automatic detection of abnormal motion