The present invention provides a real-time three-dimensional pattern recognition imaging system having a variable focal length, a wide depth of field, a high depth resolution, a fast acquisition time, a variable magnification, a variable optical axis for tracking, and capability of compensating various optical distortions and aberrations, which enables pattern recognition systems to be more accurate as well as more robust to environmental variation. The imaging system for pattern recognition comprises one or more camera system, each of which has at least one micromirror array lens(MMAL), a two-dimensional image senor, and an image processing unit. A MMAL has unique features including a variable focal length, a variable optical axis, and a variable magnification.