A vision system for automated parts inspection is proposed. The system is equipped with learning capabilities such that it automatically selects from a set of sample parts a minimum, but effective inspection region within the camera's field of view for parts discrimination. A binary template is formed within the inspection region which is then used for parts inspection by template matching. The inspection speed is enhanced by keeping the inspection region small and by making the matching task uncomplicated. A simple learning algorithm based on statistical pattern recognition theory is employed, which only requires the system to be taught by a training set of good and defective parts without specific defect identification or location. The system is applicable to most 2-D industrial parts inspection.