Motion detection and tracking of surveillance videos under distorted environments