Positioning method for line position holes of aviation electric connector based on template matching
Technical Field
The invention relates to the technical field of automatic control, in particular to a positioning method of an aviation electric connector line position hole based on template matching.
Background
The electric connector is an electromechanical element for connecting electric appliance circuits, and in various military machines and weaponry, the electric connector has a large demand, and particularly, the electric connector is used in an aviation aircraft in a huge amount. Because of the special use of the electrical connector, the stability of the performance of the electrical connector is very high, and thus the assembly of the electrical connector must be sufficiently accurate.
The electric connector needs to be assembled with the electric wires in the production process, and the electric wires of different types need to be inserted into the wire position holes of corresponding types. At present, most of the assembly work of the electric connector in China is completed manually by manpower, the working efficiency is low, and the electric connector is easily affected by various accidental factors in the manual operation process, so that the assembly quality of the electric connector is reduced.
Disclosure of Invention
Aiming at the current situations that the assembly of the electric connector is still in manual operation at a lower level, the efficiency is lower and the resource waste is more, the invention provides the positioning method of the wire position hole of the aviation electric connector based on template matching, and the positioning method can provide accurate wire position hole coordinates for intelligent electric connection assembly, so that a mechanical arm can accurately insert wires into corresponding wire position holes, and the automatic assembly realization of the whole product is promoted.
The invention can be realized by the following technical scheme:
A positioning method of an aviation electric connector line position hole based on template matching comprises the following steps:
step one, establishing a database containing template images of various types of aviation electric connectors, line position location information P corresponding to the template images one by one and characteristic identification information T;
Step two, a feature matching method is utilized to find out a template image matched with the aviation electric connector to be detected, line position location information P and feature identification information T corresponding to the template image and the line position location information P and the feature identification information T from the database, and feature identification information T' in the current state of the aviation electric connector to be detected is calculated;
And thirdly, calculating position coordinate information P 'of the line position hole of the aviation electric connector to be detected in the current state according to the corresponding relation between the characteristic identification information T and T' and the line position information P corresponding to the template image matched with the aviation electric connector to be detected.
Through the database established in advance, the template image, the line position hole information and the characteristic identification information of each model of the aviation electric connector are stored in advance, so that when the line position hole of the aviation electric connector to be detected is identified, the model identification and the characteristic identification information identification of the aviation electric connector to be detected are only needed, then the line position hole identification of the aviation electric connector to be detected can be completed by utilizing the information matched with the model identification and the characteristic identification information in the database, the positions of the line position holes are not needed to be identified one by one in the detection process, the calculation speed is saved, the detection effect is improved, and the requirement of automatic production is met.
Further, the center of the aviation electric connector in the template image is taken as an origin, a rectangular coordinate system is established, the line position information P is set to be a matrix formed by position coordinates of all line position holes contained in the template image according to the corresponding label sequence, and the characteristic identification information T is set to be angle information of the common identification of the aviation electric connectors of various types relative to the origin.
Further, the common identifier is set as a data identifier "1" or a letter identifier "a" of the line bit hole.
The common identification is used as the characteristic identification to adapt to the positioning detection of more types of aviation electric connectors, the application range is enlarged, when a new type of aviation electric connector appears, only the template image, the line position location P and the characteristic identification information T of the aviation electric connector are required to be saved in a database, the compatibility of the identification program is stronger, and the expansion is more convenient.
Further, collecting sample images of all types of aviation electric connectors with the common marks arranged at the unified positions, intercepting the aviation electric connectors in the sample images, processing the sample images into template images with the same size requirement, identifying marks and outlines corresponding to all line holes in the template images, further obtaining circle center coordinates of all line holes, storing the circle center coordinates and the corresponding marks as a whole to form position information P, and finally calculating angle information between the common marks and the original centers as characteristic mark information T to complete database establishment.
The template images with the same size requirement, the unified position setting of the common identifier and the like can reduce the difficulty of data acquisition and subsequent detection and identification to the greatest extent, and reduce the complexity of the whole calculation.
Further, a SIFT feature matching method is adopted, a template image matched with the aviation electric connector to be detected is found out from the database, the center of the aviation electric connector in the corresponding image of the aviation electric connector to be detected is taken as an origin, a rectangular coordinate system is established, angle information of common features in the current state relative to the original center in calculation is used as feature identification T ' in the current state, and line position information P ' of the aviation electric connector to be detected in the current state is calculated according to the corresponding relation between the feature identification information T and T ' and line position information P corresponding to the template image matched with the aviation electric connector to be detected.
Further, according to the angle difference between the angle information T and T ', the rotation angle between the line position information P ' of the current state of the aviation electric connector to be detected relative to the line position information P in the corresponding template image is calculated, so that the line position information P ' of the current state of the aviation electric connector to be detected is obtained.
The beneficial technical effects of the invention are as follows:
through establishing a database, the template images, the line position information and the characteristic identification information are in one-to-one correspondence, then the template images corresponding to the aviation electric connector to be detected are identified by utilizing a matching method, the corresponding line position information and the characteristic identification information are found, and finally, the position information of each line position hole in the aviation electric connector image to be detected can be obtained only by calculating the characteristic identification information in the aviation electric connector image to be detected, so that the calculation time is saved, the identification efficiency is improved, the station is prevented from becoming the bottleneck of the whole production line, and the realization of production automation is facilitated. In addition, the method of the invention is simple and reliable, convenient to operate, easy to realize and convenient to popularize and apply.
Drawings
FIG. 1 is a general flow chart of the present invention;
FIG. 2 is a schematic diagram of a template image acquisition process of the present invention;
FIG. 3 is a schematic illustration of a common identifier of the present invention;
FIG. 4 is a schematic diagram of the common identity of the present invention at different locations in a rectangular coordinate system where the template image is located;
Fig. 5 is a schematic diagram of the line position information P of the present invention.
Detailed Description
The following detailed description of the invention refers to the accompanying drawings and preferred embodiments.
Aiming at solving the problem of assembling an electric connector which is still under manual operation at present, the invention provides a positioning method of a line position hole of an aviation electric connector based on template matching, and the electric connector is assembled by an intelligent automatic method, as shown in fig. 1, the implementation details of the scheme are described in detail below, and the steps are as follows:
Step 1, establishing a database
Firstly, various types of aviation electric connector samples are required to be collected, main image information containing the aviation electric connector is intercepted according to the collected corresponding image information, and the main image information is modified into a uniform image size, so that the main image information is used as a template image. As shown in fig. 2, the left image is an acquired image data image of the electric connector, and the right image is a captured image of the region of interest as a template image of the aviation point connector;
secondly, through researching the structure of various types of aviation electric connectors, we find that the line positions Kong Biaohao of the aviation electric connectors are mostly numbers or letters, although the numbers are different, the numbers are always marked from the numbers of 1 or letters of a, as shown in figure 3, so that the numbers of 1 or letters of a are selected as common marks, so that the line position holes of the aviation electric connectors of various types are subsequently identified, in order to calculate the position coordinates of the line position holes, the center of a base where the line position holes are positioned is selected as a primary center, a rectangular coordinate system is established, and when template image acquisition is carried out, as shown in figure 4, the numbers of 1 or letters of a are positioned at the positions of coordinate axes, such as the positive direction of an X axis, then, the marks corresponding to the line position holes on the aviation electric connectors are identified by a character identification method, the edges of the corresponding line position holes are calculated by a feature extraction method of RANSAC cluster segmentation, the circle center coordinate information of the corresponding line position holes is obtained, the circle center coordinate information of the corresponding line position holes is stored together with the marks as integral position information, as shown in figure 1, the positive direction of the X axis is calculated, and the common angle information is calculated as shown in figure 1, and the positive direction of the coordinate is shown in figure 5, and the positive direction of the primary mark is calculated, and the primary direction is calculated;
and thirdly, storing the template images, the line position information P and the characteristic identification information T in one-to-one correspondence to finish database establishment. Therefore, when the aviation electric connector with a new model appears, the template image, the line position information P and the characteristic identification information T corresponding to the aviation electric connector are saved to the database only by repeating the process, so that the software has stronger expansibility and is more convenient to use.
Step 2, matching the image of the aviation electric connector to be detected with a database
Firstly, processing an aerial electric connector image to be detected according to the method, enabling the aerial electric connector image to have the same size and the like as a template image in a database, then adopting methods such as SIFT feature matching and the like to find the template image matched with the aerial electric connector to be detected from the database, corresponding line position information P and feature identification information T, then taking the center of a line position hole base in the processed aerial electric connector image to be detected as a primary center to establish a rectangular coordinate system, identifying a common identifier, and calculating angle information formed by the common identifier and the primary center connecting line to serve as feature identification information T' in the current state.
Step 3, calculating the line position location P 'of the aviation electric connector image to be detected in the current state'
Calculating the deviation angle of the feature identification information T 'in the current state obtained in the step 2 and the feature identification information T corresponding to the template image, so as to obtain the rotation angle of the aviation electric connector to be detected relative to the template image, further obtain the rotation condition of each line position coordinate of the aviation electric connector to be detected relative to the line position of the template image, further obtain line position information P' of the aviation electric connector to be detected in the current state of the image, then send the obtained line position information to the mechanical arm, and the system controls the mechanical arm to accurately insert the electric wire into the corresponding line position hole of the electric connector, thereby providing a basis for completing automatic wire plugging operation.
While particular embodiments of the present invention have been described above, it will be appreciated by those skilled in the art that these are merely illustrative, and that many changes and modifications may be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims.