Optimization of Three - Frame Difference Method and Improvement of Pedestrian Detection Code Book