faster median selection
add points constraint to determine the tracking lost