In this report, an optoelectronics instrument is introduced, in which the technology of laser alignment, the technology of computer image identification, and the principle of optical triangulation are used to inspect the contour and the internal surface quality of rifling in artillery barrel with real-time and automatically. This instrument is composed of laser aligning system, optical triangulation system, CCD camera system, computer image processing and identification system and computer-controlled system, the photoelectric targets of the caliber gauging system, of the CCD camera system and of laser aligning system, are all fixed in the chamber of the cutter of the boring tool, and they compose the photoelectric probe. When the boring tool bores the barrel, the light coming from the semiconductor laser which is located in the photoelectric probe, is reflected by the internal surface of the barrel and then received by 1D CCD. By the aid of optical triangulation operation, the radius of the rifling can be obtained, in the mean time, the image information of internal surface of the barrel, which is obtained by CCD is fed to be processed by computer image processing and identification system, and then the classified results can be given. The magnitude of deviation of the boring cutter from its ideal boring line, is provided by the laser aligning system with real time, the feedback system can revise the position of the boring tool whenever necessary. The caliber gauging precision of this instrument is +/- 0.005mm.