Research of the Stereo Measure Technology for Firearms Chamber

A stereo endoscope measurement system for the firearms' chamber is exploited with the stereo endoscopic technique and it put forward a new detection method for the damage depth and scorching area and it solved the technical problems of the nondestructive detection. It has realistic significance for the improvement of the work efficiency, measurement precision and data statistic. The software design thoughts of the image acquisition card, the stereo camera calibration and the stereo matching are presented in the paper with the stereo vision theory and it obtains the preliminary research results.


Introduction
With the long-term evolution, the mankind's sights made great progress and the stereo visual images can be formed within forward direction of 100 degree to 120 degree, which is called binocular effect, one can determine the space of the objective with the effect.The internal stereo measurement technology is implemented with the same theory and the system includes images acquisition, camera calibration, feature extraction, stereo matching, depth determination and so on.The internal stereoscopic measurement technology employs borescope technology to implement the nondestructive examination.The requests for the internal view technology increased with the popularity of the nondestructive examination technology in recent years.However, the traditional internal measurement technology has some shortcomings, such as operating with operators' eyes, flat measurement for the impaired layer, without stereo display for the damage, without deep detection for the damage and difficult restore of the computer 3-dimension models for the detection parts.Those flaws cannot make sure the reliability of the detection results in the real detection process and the internal stereoscopic technology can overcome those flaws (Xu, 1992).Recently, stereo visual technology is widely used in medical diagnose, surgery and industry detection, especially in medical and industry internal devices.The endoscope produces of IV6C6 and IV8C6 developed by the Japan OLYMPUS Company make full use of stereo visual theory and implement the 2-dimensional measurement of the measured work pieces and the operators can employ the data from the system directly to evaluate the damage, which accelerates the development of the nondestructive examination (Yu, 2002).The paper researches the internal stereoscopic measurement technology and evaluates the damage of the firearms chamber with self-developed stereo endoscopy.

System Scheme
The paper proposes the 3-dimensional measurement and stereo reconstruction scheme of the firearms' chamber with self-developed endoscope display system to meet the light arm testing requires.And the deep measurement of the chamber's scorching image and 3-demesional recurrence are implemented with the photo-electricity technology, stereo image display technology, computer image collection technology and image process software.During the research, we referenced the advanced technology of stereo endoscope technology of 3DSCOPE Company of USA and OLYMPUS Company of Japan and designed the related analyzing software according to the scorching surface status.The functions of the software system include image collection and calibration, image pre-processing, stereo image matching, depth computation and area measurement.

The Theory of the System
The key of the stereo images' acquirement lies in the shooting in different angles and overlapping in the view field.Thus, the stereo visional region can be formed in the definite space range and each point of the region can be formed as two pictures with slight differences in the indicator and those two pictures can cause optical parallax in left eye and right eye individually, then it can be constructed a three-dimensional stereo image.The paper employs the dual light path with parallel optical axis system to analog the eyes' stereo theory and collects the visual signals with high-definition CCD cameras.The stereo matching and depth dimension objectives are determined by the fixed parameters of the optical axis for the fixed point objectives.

The Acquirement Theory of the Stereo Images
The stereo endoscope is stretched into the firearms chamber.There is no light entrance in the chamber, therefore, the optical fiber of the endoscope's front-end can illuminate the inside of the chamber and the light can be reflected on the target surface of the CCD camera through the objective lens, bar lens group and oblique prism.The optical signals can be transferred into visual signals by the CCD camera and it can be displayed on the computer screen after collected by the image collector card.At the meantime, the visual data from the CCD camera can be stored in the computer to analyze and compute.The whole system includes stereo endoscope, illuminating source, optical fiber, computer image collecting and display system and motor control system, shown as in Figure 1.The keys of the image display and collect lie in the optical system of the endoscope.The binocular visual system with the dual optical paths and parallel optical axis is used to analog the mankind's eye characters.Two cameras within a certain distance shot the picture individually and the related information is the key to determine the precision of the whole system.
The self-developed stereo endoscope is adopted and its parameters are shown that the outer diameter is 10 mm, the vision range angle is 70 degree, the stereoscopic vision is 150 mm, the line-of-sight angle is 90 degree, the relative aperture is 1:6 and the object distance of X 1 is 7 mm.

The Stereo Measurement Theory
Two CCD cameras with the same focal distance are employed to get two pictures for the same scene with the same angle just like two eyes of mankind.The two image points of the same objective are detected and matched by the computer to get the depth information (Zhang, 2005), shown in Figure 2. ) individually, then: Where, d is the focal length of the lens.From the Equations of (1), ( 2) and (3), we can get: The total error of z E for the Z-axis is for the coordinate difference of x-axis is bigger due to the limitation of the camera's resolution.

The Calibration and Stereo Matching of the Camera
It's very important to calibrate the stereo camera in the system.Not only the location, attribute and parameter of the camera, but also the relative location of the cameras should be calibrated.In this system, the binocular vision imaging method is employed with same parallel optic axes and the whole optical system within the endoscope keeps fixed.Meantime, the CCD camera is located in rear-end of the endoscope and it remains immobility relatively.Therefore, the complex extent decreased greatly.The Lemon industry camera of the Hitachi Corporation is employed in the system and the optical axis of the every camera is parallel fixed.The distance between the two cameras and the center of the target surface must be calibrated in Figure 2.
Stereo matching is a vital important part in the stereo measurement.When the two cameras shot the same object point, the related image points are called conjugate points.To determine the measured object points' coordinates, the matching relationship of the same object point in the pictures must be constructed.However, the image points of the same object will be shown at the different gray values with the different illumination, noise inference, distortion of the optical system, camera characteristic and so on.Therefore, it's very important to choose a reasonable stereo matching algorithm.

The Stereo Matching Algorithm
Currently, there are many algorithms for the stereo matching, which include characteristic-based algorithm, region-based algorithm, phase-based algorithm and so on.The characteristic-based algorithm mainly detects characteristics of the object structure, such as the grey-discontinuation points of edge-points and angular-points, which are usually the points of the edges or crossing points of the different curved surfaces of the space objects.After getting the matched characteristic values, the system will carry out the interpolation to get the matching points between the characteristic points.The shortcoming of the method is that only precise sparse matching points can be got.The region-based matching is mainly based on the region correlation of the images.The phase-based matching employs the phase signals with the local frequency characters as the matching primitives.Its matching process has the multi-resolution characters and can match every pixel (Bai, Zhuang, & Wang, 2008).
The paper proposes a utility method of fusion-joint images for the fixed observation from multi-directions, based on the stereo visual viewpoint.It includes the following steps.First, the overlapping region of the adjacent images should be determined.Secondly, the images should be geometry corrected and the adjacent images should be transferred into the projection of the same observation direction in turn.Finally, the image pixels' grey level of the conjugate points should be determined.

The Abstraction of the Characteristic Points
The overlapped scope can be predicted based on the different observation angles of the cameras.The characteristic points can be abstracted with the Moravac operator within the predicted scope.The Moravec operator has large variance in all round directions based on an ideal characteristic point.Let ij g is the grey value of the specific pixel within the window of 5 by 5 pixel, then Where, m and n represent the number of row and column individually for the central pixel and i = n-2, …, n+2 and j = m-2, …, m+2.If the value of M is larger than the empirical threshold quantity, then it is optional point.
The value of M should be the maximum within the 11 by 11 pixel window with the method of local non-maxima suppression.

Correspondence Solving
The correspondence problem is to find the correspondence point for the same three-dimension object point from the adjacent pictures (Li, 2013).The matching is measured by the similarity of the grey matching.Let the two adjacent images' grey functions are ) , ( individually and the size of the matching window is m by n centralized with the characteristic point.
The similarity is measured by the men square deviation.


The sum of the absolute value for the grey difference is When the matching operation meets th     max 12 and min  K simultaneously, the two matched windows can be determined as the correspondence windows, where th  is the threshold quantity of the covariance.When the matching operation is carried on, the restrains for the matching should be implemented, which include uniqueness restrain and camera revolution maximum angle restrain, to reduce the computation and mismatching phenomena.
The software has been designed for the firearms chamber rifle and depth size of the scorching with the above algorithm and the stereo measurement theory.The collected images is implemented with the geometric computation and stereo matching algorithm in the WINDOWS XP platform and VC++6.0 development tool.

Conclusion
The stereo measurement in the firearms' chamber introduced in the paper is the prophase project of the detection and measurement system for the chamber rifle, scorching depth and area.It makes first-phase preparations and technology support for the anaphase images joint and area computation.At the same time, we designed the image process models to prepare for the stereo reconstruction and dummy model.Therefore, it has great utility value and practical purpose of the implementation of the detection within the chamber.

Figure 1 .
Figure 1.The composed system of gun three-dimensional measurement

Figure 3 .
Figure 3. Ranging in accordance with parallax