This paper introduces a novel enhanced algorithm for efficient human tracking based on background subtraction. The algorithm operates in four steps: 1) identifying a fixed background and removing noise, 2) subtracting the background from movable objects, 3) filtering the image to remove shadows and noise, and 4) separating and tracking movable objects using bubble routing. Experimental results found that the proposed algorithm improved motion and trajectory estimation of objects in terms of speed and accuracy compared to previous methods. The algorithm provides a fast and accurate way to track humans which has applications in video surveillance, human action recognition, and human-computer interaction.