The assembling accuracy of two contactors during the relay switch production is an important factor affecting the quality of relay. An embedded machine vision quality Inspection system has been developed for electric relay production line inspection. The proposed system can provide online feedback on the quality of the relays by measuring the distance of the gap between the contacts of them. Two CMOS imaging sensors are operated for image acquisition and the parallel working mode is realized under dual-channel mode. A red light illumination system has been adopted to eliminate the imaging noise from the reflection of the surfaces of copper sheet. Before the test, the features areas in the image of same type relay is selected as template and saved in the computer. During the inspection procedure, a rotation invariance detection scheme based on circular projection matching algorithm has been used for fast recognizing and locating detected object with the help of these feature areas. According to the corresponding position relation among internal components of relay, the contactors edge detection area can be locked. Then a coarse-to-fine edge detection algorithm has been applied to accurately locate the edge position of the contactors. The gap distance of two contacts of the detected rely can be calculated according to the ratio between the image size and the actual physical size of the corresponding imaging scene. Finally the detected data information is transferred to a data processing center by communication system. The proposed system show great potential in large volume manufacturing of electric relays.