1. A method performed by an electronic device, comprising: determining a local motion pattern by determining a set of local motion vectors within a region of interest between a previous frame and a current frame; determining a global motion pattern by determining a set of global motion vectors between the previous frame and the current frame; calculating a separation metric based on the local motion pattern and the global motion pattern, wherein the separation metric indicates a motion difference between the local motion pattern and the global motion pattern; and tracking an object based on the separation metric.