Nowadays, analysing videos from a surveillance system in real-time is very important for resolving the security related social issues. Foreground extraction and object detection is a vital task in video analysis. In the proposed methods background, modelling is treated as an optimisation problem and solved using particle swarm optimisation. The background is modelled at regular intervals of time for adapting the changes in the environment. Then the background subtraction is applied to the current frame with the corresponding background modelled frame to extract the foreground. Added to it the optical flow applied image is compared with the foreground extracted image to avoid the false positives (FP) and false negatives (FN). This proposed foreground extraction technique for real-time videos gives results better than the previous algorithms with respect to the quality of extraction and space complexity. L. Jeganathan is a Professor and the Dean of the School of Computing Science and Engineering, VIT University, India. Also, he heads the research team of theoretical computer science with the motivation of designing the effective computational models using cellular automata. His research interest includes theoretical computer science, natural computing and bio-inspired computing. He has completed his PhD in IIT Madras in 2009. He has published many national and international conference and journal papers.