In a process of commutator quality inspection, there are serious quality problems in a convex foreign body near an end notch. So far a manual detecting mode is used to solve this problem. But there are detection inefficiencies, high leakages and other issues. Then an uneven characteristic of a commutator end have more challenges to the detection problem. Aiming at this problem, a method of detecting the surface foreign body of non convex of commutator based on a photometric stereo vision by means of an machine vision technology is proposed in this paper. A different range of illumination image is obtained by a four-way lighting method. An albedo image is reckoned up the lighting image, and then a Gauss disconsolation is applied to treat the images. A defection features is extracted by a polar coordinate transformation used in a particular area, as well as a convex body recognition and detection are carried on. Experimental results have shown that the proposed method can detect the raised foreign bodies on the uneven surface of commutator rapidly and effectively, and the detection accuracy is up to 99.8%. This method can satisfy the requirements of on-line inspection of commutator quality.