When another object is in front of the object, or there are background disturbances, Mean shift algorithm will slow down the tracking rate or lost the object. Weights are given to the background and the object. By the weight of background, the description of the object’s characters is improved. Different weights of different parts of the object increase Bhattacharyya value. After analyzing object template, the weights are brought to the mathematical expression of Mean shift. The real experiments and the comparation of tracking errors and iterative times show that the effect of tracking is improved obviously.