A computer vision system has been developed to perform the complex inspection of many components on a flat surface or board. It has a hierarchical structure which allows it to determine the location of components with one camera resolution and then to inspect for small details with a higher resolution. The system has generality in that the same program can be used to inspect boards with completely different components by forming a new model. The MODEL-FORMER program carries out an interactive session with an operator who specifies the layout of components, showing the system each different component and selecting inspection tests which apply to specific regions of the component. These tests allow the INSPECTOR system to differentiate between good and bad components. During inspection, the system (using gray-scale rather than the more limited binary techniques) automatically inspects all components on the board for: (1) presence of correct component; (2) correct position and orientation; (3) any other important features which the operator has designated.