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 within an area between the previous frame and the current frame, wherein the area is larger than the region of interest; calculating a global motion consistency measure, the global motion consistency measure indicative of a consistency of the global motion vectors relative to an average of the set of global motion vectors; calculating a separation metric based on the local motion pattern and the global motion pattern in a case that the global motion consistency measure meets a consistency criterion, 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 in the case that the global motion consistency measure meets the consistency criterion.