Optical fiber end face inclination angle measurement method and system based on image gray value
Technical Field
The invention relates to the technical field of optical detection, in particular to a method and a system for measuring an optical fiber end face inclination angle based on an image gray value.
Background
The optical fiber has wide application in various industries, such as the fields of communication, medical treatment, military, security protection, mining industry and the like. In practical application, the optical fiber needs to be welded inevitably, and the quality of the end face of the optical fiber after cutting directly affects whether the optical fiber is welded successfully or not. The optical fiber with poor end surface not only affects the fusion splicing speed of the optical fiber, but also has great optical power attenuation in the communication process.
The common methods for extracting the profile of the optical fiber end face by the optical fiber end face inclination angle measuring equipment in the current market are a Robert operator method, a Sobel operator method, a Prewitt operator method and the like. These methods of fiber-optic endface image extraction are more or less deficient. For example, the Robert operator method has a good effect on low-noise image processing, but both of them are inaccurate in contour extraction of the fiber end face image and are prone to generate large errors. The cost of the device is undoubtedly increased if better hardware components are used. The Sobel operator method or Prewitt operator method is used to extract the profile of the optical fiber end face, and because the Sobel operator method or the Prewitt operator method uses a first-order differential operator method, the first-order differential operator method is a weighted average filtering method, and the second-order differential operator method is an average filtering method, the Sobel operator method or the Prewitt operator method has good effect on processing gradual noise, but the Sobel operator method or the Prewitt operator method is not ideal for processing images mixed with complex noise.
Disclosure of Invention
The invention provides an optical fiber end face inclination angle measurement method and system based on an image gray value, and solves the problem that the prior art cannot accurately extract the complex noise optical fiber end face contour.
The invention provides an optical fiber end face inclination angle measuring method based on an image gray value, which comprises the following steps of:
step 1, acquiring and obtaining end face image information of an optical fiber;
step 2, carrying out graying processing on the end face image information to obtain a grayscale image;
step 3, generating a slope fitting curve based on the gray-scale map;
and 4, obtaining the inclination angle information of the optical fiber end face based on the slope fitting curve.
Preferably, in step 1, before acquiring and acquiring the end face image of the optical fiber, the optical fiber is placed on a three-dimensional displacement table by using an optical fiber clamp, control information is sent to a three-dimensional displacement table driver by a master control system, the three-dimensional displacement table driver drives the three-dimensional displacement table to move according to the control information, and the position of the optical fiber is adjusted so that the axis of the end face of the optical fiber is located at the center of the field of view of the image acquisition device, thereby completing focusing.
Preferably, in the step 2, a specific implementation manner of performing the graying processing on the end face image information is as follows: the end face image information is a black-white picture, and gray values of a plurality of angles passing through the center of the black-white picture are extracted to obtain the gray image.
Preferably, in the step 3, a specific implementation manner of generating a slope fitting curve based on the gray scale map is as follows: fitting a straight line for each angle by taking the pixel value of the black-white image as a horizontal coordinate X and the gray value of the black-white image as a vertical coordinate Y, and adopting the following formula:
Y=Ai·X+Bi
wherein A isiRepresents the slope corresponding to the ith angle, BiRepresenting the intercept corresponding to the ith angle;
obtaining a slope fitting curve based on the fitting straight lines corresponding to the plurality of angles, and adopting the following formula:
K=F(αi,Ai)
wherein alpha isiAnd K represents the ordinate value of a slope fitting curve of a plurality of angles, and F represents the slope fitting curve.
Preferably, in step 4, a maximum slope is obtained based on the slope fitting curve, a maximum inclination angle is obtained according to the maximum slope, and the following formula is adopted:
θ=arctan(max(K))
where θ represents the maximum inclination angle of the fiber end face.
In another aspect, the present invention provides an optical fiber end surface inclination angle measuring system based on image gray scale values, comprising: the system comprises an image acquisition device, a master control system, a three-dimensional displacement table driver and a three-dimensional displacement table;
the image acquisition device is used for acquiring and acquiring end face image information of the optical fiber;
the master control system is used for receiving the end face image information, obtaining control information according to the end face image information and sending the control information to the three-dimensional displacement table driver; the end face image processing device is used for carrying out graying processing on the end face image information to obtain a grayscale image; for generating a slope fit curve based on the gray scale map; the inclination angle information of the optical fiber end face is obtained based on the slope fitting curve;
the three-dimensional displacement table driver is used for carrying out X, Y, Z three-axis control on the three-dimensional displacement table according to the control information;
the three-dimensional displacement table is used for bearing the optical fiber and adjusting the position of the optical fiber;
the optical fiber end face inclination angle measuring system based on the image gray value is used for realizing the steps in the optical fiber end face inclination angle measuring method based on the image gray value.
Preferably, the main control system is further configured to display information on an inclination angle of the optical fiber end face.
Preferably, the image acquisition device is a CCD camera.
Preferably, the resolution of the three-dimensional displacement table is less than or equal to 5 μm, and the X, Y, Z triaxial displacement stroke is: -3mm to +3 mm.
One or more technical schemes provided by the invention at least have the following technical effects or advantages:
in the invention, the end face image information of the optical fiber is acquired, then the end face image information is grayed to obtain a gray-scale image, then a slope fitting curve is generated based on the gray-scale image, and finally the inclination angle information of the end face of the optical fiber is obtained based on the slope fitting curve. Compared with the prior art, the method for calculating the gray scale value of the image is adopted, the original image is not processed too much, the inclination slope of the optical fiber end face is directly calculated, the inclination angle is calculated by using arctan, the accuracy and the stability of the measurement of the optical fiber end face are improved, and the method has the advantages of short measurement time and the like. Meanwhile, the invention has high degree of automation and simple operation, and can be integrated in an optical fiber automatic test system, so that the invention not only can accurately extract the complex noise optical fiber end face outline, but also has lower equipment cost than that of other prior arts.
Drawings
Fig. 1 is a flowchart of an optical fiber end face inclination angle measurement method based on an image gray scale value according to an embodiment of the present invention;
fig. 2 is a gray scale diagram in an optical fiber end face inclination angle measurement method based on image gray scale values according to an embodiment of the present invention;
fig. 3 is a definition curve of focusing of an optical fiber end face in the optical fiber end face inclination angle measurement method based on an image gray value according to the embodiment of the present invention;
fig. 4 is a slope fitting curve in an optical fiber end face slope angle measurement method based on an image gray-scale value according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a framework of an optical fiber end face inclination angle measurement system based on an image gray scale value according to an embodiment of the present invention.
The system comprises an image acquisition device 1, a main control system 2, a three-dimensional displacement table driver 3 and a three-dimensional displacement table 4.
Detailed Description
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
The embodiment provides an optical fiber end face inclination angle measurement method based on an image gray value, which mainly comprises the following steps:
step 1, acquiring and obtaining end face image information of an optical fiber.
Before acquiring and acquiring an end face image of an optical fiber, the optical fiber is placed on a three-dimensional displacement table by using an optical fiber clamp, control information is sent to a three-dimensional displacement table driver through a master control system, the three-dimensional displacement table driver drives the three-dimensional displacement table to move according to the control information, the position of the optical fiber is adjusted, the axis of the end face of the optical fiber is positioned in the center of a view field of an image acquisition device, and focusing is completed.
And 2, carrying out graying processing on the end face image information to obtain a grayscale image.
The specific implementation mode of carrying out graying processing on the end face image information is as follows: the end face image information is a black-white picture, and gray values of a plurality of angles passing through the center of the black-white picture are extracted to obtain the gray image.
It should be noted that, extracting the gray value can be implemented by using related processing software in the prior art.
And 3, generating a slope fitting curve based on the gray-scale map.
The specific implementation mode for generating the slope fitting curve based on the gray-scale map is as follows: fitting a straight line for each angle by taking the pixel value of the black-white image as a horizontal coordinate X and the gray value of the black-white image as a vertical coordinate Y, and adopting the following formula:
Y=Ai·X+Bi
wherein A isiRepresents the slope corresponding to the ith angle, BiRepresenting the intercept corresponding to the ith angle.
It should be noted that for the purposes of the present invention, no intercept values are actually required, and the intercept is used only to express the fitted line.
Obtaining a slope fitting curve based on the fitting straight lines corresponding to the plurality of angles (namely obtaining an integral slope fitting curve according to the plurality of fitting straight lines), and adopting the following formula:
K=F(αi,Ai)
wherein alpha isiRepresenting the ith angle, K representing the ordinate value of the slope fit curve for several angles, and F representing the slope fit curve (i.e. F representing the curve fitted by slopes corresponding to different angles, as shown in fig. 4).
And 4, obtaining the inclination angle information of the optical fiber end face based on the slope fitting curve.
Obtaining a maximum slope based on the slope fitting curve, obtaining a maximum inclination angle according to the maximum slope, and adopting the following formula:
θ=arctan(max(K))
where θ represents the maximum inclination angle of the fiber end face.
The embodiment provides an optical fiber end face inclination angle measuring system based on image gray value, which comprises: the device comprises an image acquisition device, a master control system, a three-dimensional displacement table driver and a three-dimensional displacement table.
The image acquisition device is used for acquiring and acquiring end face image information of the optical fiber.
The master control system is used for receiving the end face image information, obtaining control information according to the end face image information and sending the control information to the three-dimensional displacement table driver; the end face image processing device is used for carrying out graying processing on the end face image information to obtain a grayscale image; for generating a slope fit curve based on the gray scale map; the inclination angle information of the optical fiber end face is obtained based on the slope fitting curve; for displaying tilt angle information of the fiber end face.
And the three-dimensional displacement table driver is used for carrying out X, Y, Z three-axis control on the three-dimensional displacement table according to the control information.
The three-dimensional displacement table is used for bearing the optical fiber and adjusting the position of the optical fiber.
The optical fiber end face inclination angle measuring system based on the image gray value is used for realizing the steps in the optical fiber end face inclination angle measuring method based on the image gray value.
The present invention is further described below.
The invention provides an optical fiber end face inclination angle measurement method based on image gray value, referring to fig. 1 and 5, firstly, a measured optical fiber is clamped by an optical fiber clamp and placed on a three-dimensional displacement table 4, then, an image of an optical fiber end face is collected by using an image collection device 1, a three-dimensional displacement table driver 3 is driven under the control of a main control system 2, the three-dimensional displacement table driver 3 outputs signals to adjust the position of the three-dimensional displacement table 4, so that the axis of the optical fiber end face is positioned at the center of a view field of the image collection device 1, and the image is the clearest at the moment. And then, the main control system 2 is used for processing the image acquired by the image acquisition device 1, calculating a gray value of the optical fiber end surface to generate a gray image, then generating a slope fitting curve based on the gray image to obtain the distribution of the slope of the optical fiber end surface, finally extracting the maximum slope, and calculating the inclination angle of the end surface of the measured optical fiber.
The gray scale of the fiber end face is shown in fig. 2.
The definition curve of the measured optical fiber in the focusing process is shown in fig. 3. The specific method for determining the clearest position of the end face of the optical fiber comprises the following steps: after the optical fiber to be detected is placed on the three-dimensional displacement table 4, the end face of the optical fiber is firstly adjusted to the central position of the view field of the image acquisition device 1 through the up-down and left-right displacement functions of the three-dimensional displacement table 4. And then moving the displacement table back and forth from front to back to obtain the clearest image, and finishing focusing.
The slope fitting curve, i.e. the slope distribution of the fiber end face, is shown in fig. 4, and then the maximum value of the slope on the gray scale of the fiber end face is determined, which is the maximum slope of the measured fiber end face.
The invention provides an optical fiber end face inclination angle measuring system based on image gray value, which mainly comprises 4 parts as shown in figure 5, and comprises the following components: the device comprises an image acquisition device 1, a main control system 2, a three-dimensional displacement table driver 3 and a three-dimensional displacement table 4. The image acquisition device 1 preferably employs a CCD camera. The following description will be made by taking a CCD camera as an example.
The CCD camera is mainly used for collecting images of the end face of the optical fiber, the images are mainly applied to two stages, namely a focusing stage after the optical fiber is placed on the three-dimensional displacement table 4, and a measuring stage of the end face of the optical fiber, and particularly, the CCD camera collects black and white pictures and transmits the black and white pictures to an upper computer (the main control system 2) in real time. The CCD camera starts to work when the test system is started up until the test system is closed.
The main control system 2 is mainly used for processing data of images acquired by the CCD camera, controlling the three-dimensional displacement table driver 3 by using a data processing result and displaying a measured inclination angle of the end face of the optical fiber.
And the three-dimensional displacement table driver 3 outputs signals to control the three-dimensional displacement table 4 under the control of the main control system 2.
The three-dimensional displacement table 4 has the main function of serving as a placement platform of the optical fiber clamp and performing three-dimensional movement on the optical fiber clamp. The precision of the displacement table directly affects the measurement of the inclination angle of the end face of the optical fiber. The smaller the minimum step size, the more accurate the calculated fiber end face inclination angle. The resolution of the triaxial displacement table 4 adopted in the invention is less than or equal to 5 μm, and the X, Y, Z triaxial displacement travel is as follows: the thickness of the film is-3 mm to +3mm, and the application requirement can be met.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention has been described in detail with reference to examples, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, which should be covered by the claims of the present invention.