This paper presents an FPGA-based algorithm for moving object detection from video for traffic surveillance. The algorithm uses background subtraction, edge detection and shadow detection techniques. Background subtraction involves selective and non-selective updating to improve sensitivity. Edge detection helps find object boundaries while shadow detection removes falsely detected pixels from shadows. The algorithm is implemented using VHDL on a Spartan-6 FPGA board. Experimental results show the algorithm can accurately detect moving vehicles in different lighting conditions with low power consumption, making it suitable for traffic monitoring applications.