A method based on computer vision to monitor CNC machining in security, and to ensure live safety of operators was proposed, which was achieved by zoning frames into different areas, constructing background model for each pixel in all the areas, and sending passages to control CNC machine according to inconsistence in foreground background. It can be adopt well to lighting changes and machine vibration.