Object tracking is one of the promising fields of research in the domain of image processing and computer vision. This paper deals with detection and tracking of moving objects. Detecting the region which is moving in the search region of a video is the first step. Tracking the object over frames is the second step and the most important one too. The first step can be achieved by background subtraction. Particle filter is used for estimating the object. In the second process, prediction and correction are the two tasks to achieve. In the process of prediction, resampling of particles in the search space region generates a sample impoverishment problem. To overcome this problem Continuous Opinion Dynamic Optimizer algorithm is used. This algorithm provides social rank to every particle for selection. CODO is combined with the particle filter algorithm and tested on the dataset. It contains different movements of objects randomly, partially occluded. The results of the proposed method are compared by calculating error difference from the previous method.