In order to adapt to the target scale changes and resolve the unrecoverable problem of target tracking failure in the tracking process in traditional spatiotemporal context, we propose an antiocclusion and adaptive target change visual tracking algorithm based on spatiotemporal context learning, called STCALD. Firstly, we employ the TLD median flow algorithm to initialize the tracking point and the forwardbackward (FB) error algorithm to predict the location of the next frame. Secondly, we use the STC algorithm to determine the output box and calculate its conservative similarity. When the threshold is exceeded the tracking is valid, and the movement similarity between the tracking point and the target frame is calculated. On the contrary, if the tracking fails, we use the TLD detector for detection. As for a single cluster box, it is taken as the output directly; but for multiple detection clusters, its spacetime context model is learned, confidence graphs are calculated one by one by the current spatial model, and the maximum confidence map is taken as the output. Finally, we update classifier related parameters for online learning and conduct experiments on different test video sequences. Experimental results show that the STCALD algorithm can be applied to visual target tracking in complex conditions, such as scale change, occlusion, and so on with a certain degree of robustness.