Method and device for visual recognition of aviation cable codes considering coding directionality

By dividing a large classifier into multiple small classifiers in aviation cable coding recognition, and combining acquisition, preprocessing and rotation correction technology, the problem of misrecognition of centrally symmetric characters in cable coding recognition is solved and a higher level of performance is achieved. recognition accuracy.

CN113989270BActive Publication Date: 2024-08-23TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111402744.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2024-08-23
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

In aviation cable coding recognition, the misrecognition problem of some centrally symmetric characters leads to a reduction in recognition accuracy. In particular, due to the uncertain direction of cable placement, inaccurate character segmentation leads to misrecognition of characters such as 6 and 9, M and W.

Method used

By dividing a large classifier into multiple small classifiers, and through steps such as acquisition, preprocessing, boundary fitting and rotation correction, segmentation optimization, etc., multiple classifiers for separate encoding directions are designed to reduce classification categories and improve recognition. Accuracy.

Benefits of technology

No matter how the cable is placed, the coded string can be accurately identified. By estimating the cable coding directionality, the problem of misidentification of centrally symmetrical characters is solved, and the accuracy of code recognition is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989270B
    Figure CN113989270B
Patent Text Reader

Abstract

The present application discloses a method and device for visually identifying aviation cable codes that considers coding directionality, wherein the method includes: collecting cable surface coding images and performing image preprocessing; obtaining upper and lower boundary points of the cable in the cable surface coding images, fitting the boundaries and performing tilt correction, and correcting the cable to a horizontal direction; segmenting and optimizing the codes in the cable surface coding images to obtain multiple rectangular areas, rotating the multiple rectangular areas to obtain multiple coded characters to be identified; inputting the multiple coded characters to be identified into multiple classifiers that are pre-trained for coding directions respectively, and obtaining coding directions and coding recognition results through multiple classifiers. The present application reduces classification categories and improves the accuracy of coding recognition by dividing a large classifier into multiple small classifiers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of visual inspection technology in automated equipment and manufacturing, and in particular to a method and device for visually identifying aviation cable codes taking into account coding directionality. Background Art

[0002] In the production process of aircraft, a large number of cables need to be connected according to their functions. In order to avoid confusing the cables, a laser marking machine is used to print a code on the cable in advance, and a matching table between the codes is established. Employees connect the cables by manually reading the code and consulting the matching table. However, the diameter of aviation cables is very thin (2-5mm), and the code characters are very small. Employees will cause a certain degree of damage to their eyes if they identify the cables for a long time. Many studies consider that visual inspection has the characteristics of good non-contact, fast speed, and good portability, and use vision to detect the code characters on aviation cables.

[0003] At present, there are some studies on the use of vision for cable coding recognition. The specific methods include two categories: (1) Using CRNN convolutional recurrent neural network to directly recognize character sequences. The advantage of this method is that it can directly recognize character sequences without pre-processing, and there is no need to consider information such as the character direction of the cable. The disadvantage is that a large amount of training data (tens of thousands) needs to be manually obtained; (2) By pre-processing the image (character segmentation, standardization, etc.), images of the coded characters to be recognized are obtained one by one, and then machine learning methods such as BP neural network and SVM are used to recognize each character one by one. This method increases the similarity of each type of character and reduces the difficulty of character recognition. Therefore, a large amount of data is not required for training. However, the disadvantage is that it is difficult to ensure the accuracy of character segmentation. In addition, due to the recognition of each character and the uncertainty of the cable placement direction (the directions of each character segmented from left to right and from right to left should be opposite), misrecognition of characters may occur (such as 6 and 9, M and W are symmetrical, and recognition may fail). Summary of the invention

[0004] The present application provides a method and device for visual recognition of aviation cable codes taking into account the coding directionality, which solves the problem of misrecognition of some centrally symmetrical characters in code recognition in the related art, and reduces the classification categories and improves the accuracy of code recognition by dividing a large classifier into multiple small classifiers.

[0005] The first aspect of the present application provides a method for visual recognition of aviation cable codes taking into account the coding directionality, comprising the following steps: acquiring a cable surface coding image and performing image preprocessing; obtaining the upper and lower boundary points of the cable in the cable surface coding image, fitting the boundaries and performing tilt correction, and correcting the cable to a horizontal direction; segmenting and optimizing the code in the cable surface coding image to obtain a plurality of rectangular areas, and rotating the plurality of rectangular areas to obtain a plurality of coded characters to be recognized; inputting the plurality of coded characters to be recognized into a plurality of pre-trained classifiers for respective coding directions, and obtaining the coding direction and coding recognition results through the plurality of classifiers.

[0006] According to an embodiment of the present application, the collecting of cable surface coded images and image preprocessing include: using a portable digital microscope with adjustable magnification to collect the cable surface coded images; using a bilinear interpolation algorithm to downsample the cable surface coded images, proportionally reducing the cable surface coded images, and using a nonlinear filtering algorithm to perform image filtering on the downsampled cable surface coded images.

[0007] According to an embodiment of the present application, the obtaining of the upper and lower boundary points of the cable in the cable surface coded image, fitting the boundary and performing tilt correction, and correcting the cable to a horizontal direction, includes: performing neighborhood mean binarization processing on the preprocessed cable surface coded image to highlight the boundary of the cable; obtaining multiple continuous contour groups through the closed contour of the binary image, and selecting a preset number of contour groups with the largest contour area from the multiple continuous contour groups; sorting the centroid coordinates of the selected contour groups and filtering out useless points to obtain the upper and lower boundary points of the cable in the cable surface coded image; fitting a straight line according to the least squares method of the cable boundary points, calculating the cable tilt angle, and rotating the cable surface coded image by the tilt angle to correct the cable surface coded image to a horizontal direction.

[0008] According to an embodiment of the present application, the code in the cable surface coded image is segmented and optimized to obtain a plurality of rectangular areas, and the plurality of rectangular areas are rotated to obtain a plurality of coded characters to be identified, including: performing projection segmentation on the cable code in the horizontal and vertical directions by a projection method, performing an area search based on the principle that the local black pixels are the most dense and the most centered, performing segmentation optimization to obtain the plurality of rectangular areas, cropping the images in the plurality of rectangular areas, and rotating the images clockwise / counterclockwise by a preset angle to obtain a plurality of coded characters to be identified.

[0009] According to an embodiment of the present application, it also includes: designing a cable coding direction identifier, training multiple classifiers for respectively encoding directions through a training set, the training set including: characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, characters that have their own central symmetry properties and characters that are centrally symmetric to each other, training a first large classifier through all training data of the training set, training a second small classifier and a third small classifier through the positive characters and reverse characters of the characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, respectively, and training a fourth small classifier through characters that have their own central symmetry properties.

[0010] The second aspect of the present application provides an aviation cable code visual recognition device that takes into account the coding directionality, including: an acquisition module, used to acquire the cable surface coding image and perform image preprocessing; a correction module, used to obtain the upper and lower boundary points of the cable in the cable surface coding image, fit the boundary and perform tilt correction, and correct the cable to a horizontal direction; a segmentation module, used to segment and optimize the code in the cable surface coding image to obtain multiple rectangular areas, and rotate the multiple rectangular areas to obtain multiple coded characters to be recognized; a recognition module, used to input the multiple coded characters to be recognized into multiple classifiers pre-trained for respective coding directions, and obtain the coding direction and coding recognition results through the multiple classifiers.

[0011] According to an embodiment of the present application, the acquisition module is specifically used to acquire the cable surface coded image using a portable digital microscope with adjustable magnification; downsample the cable surface coded image using a bilinear interpolation algorithm, scale down the cable surface coded image, and perform image filtering on the downsampled cable surface coded image using a nonlinear filtering algorithm.

[0012] According to an embodiment of the present application, the correction module includes:

[0013] A processing unit, used for performing neighborhood mean binarization processing on the pre-processed cable surface coding image to highlight the boundary of the cable;

[0014] A selection unit, configured to obtain a plurality of continuous contour groups through closed contours of the binary image, and select a preset number of contour groups with the largest contour areas from the plurality of continuous contour groups;

[0015] A determination unit, used for sorting the centroid coordinates of the selected contour group and filtering out useless points to obtain the upper and lower boundary points of the cable in the cable surface coded image;

[0016] The rotation unit is used to fit a straight line according to the least square method of the cable boundary points, calculate the cable inclination angle, and rotate the cable surface coded image by the inclination angle to correct the cable surface coded image to a horizontal direction.

[0017] A third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the visual recognition method for aviation cable codes taking into account the coding directionality as described in the above embodiment.

[0018] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program is executed by a processor to implement the visual recognition method for aviation cable codes taking into account the coding directionality as described in the above embodiment.

[0019] The aviation cable code visual recognition method and device taking into account the coding directionality of the embodiment of the present application can correct its direction and ultimately recognize an accurately recognized coding string no matter how the cable is placed in the camera's field of view, as long as the cable code is fully exposed to the camera's field of view. The problem of misrecognition of some centrally symmetrical characters in code recognition can be solved by estimating the directionality of the cable code, and by dividing a large classifier into multiple small classifiers, the classification categories are reduced, thereby improving the accuracy of code recognition.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flowchart of a method for visually identifying aviation cable codes taking into account coding directionality according to an embodiment of the present application;

[0023] Figure 2 These are eight valid distribution forms that cables may have in the cable surface coding image provided according to an embodiment of the present application;

[0024] Figure 3 A schematic diagram of a profile in a profile group provided according to an embodiment of the present application;

[0025] Figure 4 A flow chart of a cable surface coding image correction process provided according to an embodiment of the present application;

[0026] Figure 5A schematic diagram of code rotation in a cable surface code image provided according to an embodiment of the present application;

[0027] Figure 6 A schematic diagram of coding segmentation in a cable surface coding image provided according to an embodiment of the present application;

[0028] Figure 7 A schematic diagram of classifier training provided according to an embodiment of the present application;

[0029] Figure 8 A detailed flow chart of the steps of estimating the directionality of cable coding and accurately identifying cable coding according to an embodiment of the present application;

[0030] Fig. 9 This is an example diagram of an aviation cable coding visual identification device considering coding directionality according to an embodiment of the present application;

[0031] Fig.10 A schematic diagram of the structure of an electronic device provided for an application embodiment. DETAILED DESCRIPTION

[0032] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0033] Figure 1 The present invention is a flowchart of a method for visually identifying aviation cable codes taking into account the coding directionality according to an embodiment of the present application.

[0034] like Figure 1 As shown, the aviation cable coding visual recognition method considering coding directionality includes the following steps:

[0035] In step S101, a cable surface coded image is collected and image preprocessing is performed.

[0036] In one embodiment of the present application, a cable surface coded image is collected and image preprocessing is performed, including: using a portable digital microscope with adjustable magnification to collect the cable surface coded image; using a bilinear interpolation algorithm to downsample the cable surface coded image, proportionally reducing the cable surface coded image, and using a nonlinear filtering algorithm to perform image filtering on the downsampled cable surface coded image.

[0037] Specifically, considering the relatively small size of cables and cable codes and the portability of the visual recognition system, a portable digital microscope with adjustable magnification (embedded with a small LED light source) is used to collect the original image to achieve clear shooting of the cable code. Manual assistance is required when collecting cable images so that the cable code part is exposed to the field of view facing upward. In order to speed up the recognition speed, the bilinear interpolation algorithm is used to downsample the collected original image and reduce the image to a size of 1200*1000 pixels. In order to reduce the interference of image noise, the downsampled image needs to be filtered. Considering that cable code recognition needs to retain the clarity of the code boundary as much as possible while filtering out the interference noise in the image, a nonlinear filtering algorithm combining median filtering and bilateral filtering is used to process the image, thereby obtaining a preprocessed image.

[0038] In step S102, the upper and lower boundary points of the cable in the cable surface coded image are obtained, the boundary is fitted and tilt correction is performed to correct the cable to a horizontal direction.

[0039] In one embodiment of the present application, the upper and lower boundary points of the cable in the cable surface coded image are obtained, the boundary is fitted and tilt correction is performed, and the cable is corrected to a horizontal direction, including: performing neighborhood mean binarization processing on the preprocessed cable surface coded image to highlight the boundary of the cable; obtaining multiple continuous contour groups through the closed contour of the binary image, and selecting a preset number of contour groups with the largest contour area from the multiple continuous contour groups; sorting the centroid coordinates of the selected contour groups and filtering out useless points to obtain the upper and lower boundary points of the cable in the cable surface coded image; fitting a straight line according to the least squares method of the cable boundary points, calculating the cable tilt angle, and rotating the cable surface coded image by the tilt angle to correct the cable surface coded image to a horizontal direction.

[0040] Specifically, the cables in the preprocessed image may have Figure 2 The 8 valid distribution forms shown in (b), (c) and (d) are distinguished by the intersection points (A, B, C, D) of the two cable boundaries and the four edges of the image. This step will correct the direction of all cables to Figure 1 The horizontal cable shown in (a) is very helpful for unifying the direction of cable coding. In order to unify the cable coding direction, it is necessary to first obtain all the upper and lower boundary points of the cable. The pre-processed image is processed by neighborhood mean binarization, and the neighborhood size is set to 31-51 pixels (about half of the cable diameter) to highlight the cable boundary. Further, a series of continuous contour groups are found by finding the closed contour of the binary image. ,observe Figure 2In (b), (c) and (d), it is not difficult to find that no matter how the cable distribution is, the cable boundary points of interest should be located in several contour groups with large area and length. So traverse , extract the three contour groups with the largest enclosed area, and sort them from top to bottom according to the centroid ordinate of their enclosed area , its location is roughly as Figure 3 As shown in (b), it is not difficult to see that the cable boundary point should be located at The lower boundary and The upper boundary of and The points located around the image are the points in the image, and the rest of the points are the cable boundary points. According to the least squares method of the cable boundary points, the straight line is fitted, and its inclination angle is calculated. The image after the cable direction correction can be obtained by rotating the image by this angle. The specific implementation algorithm flow chart is as follows Figure 4 shown.

[0041] In step S103, the codes in the cable surface coded image are segmented and optimized to obtain a plurality of rectangular areas, and the plurality of rectangular areas are rotated to obtain a plurality of coded characters to be recognized.

[0042] In one embodiment of the present application, the code in the cable surface coding image is segmented and optimized to obtain multiple rectangular areas, and the multiple rectangular areas are rotated to obtain multiple coded characters to be identified, including: horizontal and vertical projection segmentation of the cable code by projection method, regional search based on the principle of the most dense and central local black pixels, segmentation and optimization to obtain multiple rectangular areas, cropping the images in the multiple rectangular areas, and rotating clockwise / counterclockwise by preset angles to obtain multiple coded characters to be identified.

[0043] Specifically, Figure 5 and Figure 6 As shown, the cable code at this time should be located on a horizontal straight line, which is specifically manifested as a series of black pixel clustering areas. Therefore, the projection method is used to perform projection segmentation on the code in the horizontal and vertical directions. Further, based on the assumption that the cable code characters are similar in scale, based on the principle of searching for the most densely populated area of ​​local black pixels, segmentation optimization is performed to obtain a series of rectangular areas. The images in the rectangular areas are cropped out and rotated 90° counterclockwise or clockwise to obtain a series of coded characters to be identified. The specific processing method can adopt existing technologies and will not be elaborated on.

[0044] In step S104, a plurality of coded characters to be recognized are input into a plurality of classifiers pre-trained for respective coding directions, and the coding directions and coding recognition results are obtained through the plurality of classifiers.

[0045] Now the cable coding characters include both forward characters and reverse characters, which are related to the direction of the characters when the cable is initially placed: if the character direction is from right to left, then all the characters are reversed; if the character direction is from left to right, then all the characters are forward. This segmentation method will cause a recognition problem, that is, for the two characters 6 and 9, M and W, the forward direction of one character is the reverse direction of another character, so it is impossible to directly use the pattern recognition method to distinguish 6 and 9 (M and W). Therefore, this step designs a method for estimating the directionality of cable coding, which also reduces the number of classification categories for more accurate recognition of cable coding.

[0046] The cable code contains 30 types of characters, which are divided into 3 categories according to their central symmetry:

[0047] (1) Characters that do not have their own central symmetry and are not centrally symmetric with other characters. Such characters can uniquely identify themselves regardless of whether they are in the forward or reverse direction, and reflect the overall directionality of the cable characters. Such characters include: 1, 2, 3, 4, 5, 7, A, B, C, D, E, F, J, K, L, P, R, U, V, Y, a total of 20 categories;

[0048] (2) Characters with their own central symmetry. Such characters can uniquely identify themselves regardless of whether they are in the forward or reverse direction, but they cannot reflect the overall directionality of the cable characters. Such characters include: 8, H, N, S, Z, / , Φ, - a total of 8 categories;

[0049] (3) The two characters are centrally symmetrical to each other. In this type of characters, the positive direction of one character is the reverse direction of the other character, such as 6 and 9, M and W. Therefore, it cannot uniquely identify itself, and it is necessary to make a judgment based on the overall directionality of the characters on the cable.

[0050] In one embodiment of the present application, it also includes: designing a cable coding direction identifier, training multiple classifiers for respectively coding directions through a training set, the training set including: characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, characters that have their own central symmetry properties and characters that are centrally symmetric to each other, training a first large classifier through all training data in the training set, training a second small classifier and a third small classifier through the forward characters and reverse characters of the characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, respectively, and training a fourth small classifier through characters that have their own central symmetry properties.

[0051] like Figure 7 and Figure 8As shown in the figure, firstly, we collect and segment images of about 4000 characters, standardize them into 16*16 images, and extract 256-dimensional grayscale values ​​as features. We identify the positive and negative characters of category (1) separately, and get 40 categories; we identify the positive and negative characters of category (2) together, and get 8 categories; we identify the positive and negative characters of category (3) separately, and get 4 categories, for a total of 52 categories. Four SVM classifiers are pre-trained: SVM_A is a large classifier trained with 52 characters, where (1) class forward characters are encoded as 1-20, (1) class reverse characters are encoded as 21-40, (2) class non-directional characters are encoded as 41-48, and (3) class characters are encoded as 49-52. This classifier will be used to estimate the directionality of cable coding; SVM_1 is a small classifier trained with 20 (1) class forward characters. This classifier will be used for more accurate recognition of forward characters; SVM_2 is a small classifier trained with 20 (1) class reverse characters. This classifier will be used for more accurate recognition of reverse characters; SVM_3 is a small classifier trained with 8 (2) class non-directional characters. This classifier will be used for more accurate recognition of (2) class characters.

[0052] When a new image is obtained, it is first segmented using the method of S101-S103 to obtain a series of character images, which are then sorted from left to right and sent to SVM_A for recognition. For each recognized character, it is determined whether it is a (1) positive character (encoded as 1-20) or a (1) reverse character (encoded as 21-40).

[0053] Count the total number of (1) positive characters and (1) negative characters in the entire cable. If the former is greater, the direction of the characters in the cable is considered to be positive, otherwise the direction of the characters in the cable is considered to be negative, thereby completing the estimation of the cable coding directionality. At the same time, a rough fuzzy estimate can also be made for each character, but since the number of classes of this classifier is relatively large and the training set is relatively small, its classification accuracy is relatively low. Further, based on the code of each character image classified by SVM_A, each character image is sent to a more accurate classifier (code 1-20: sent to SVM_1; code 21-40: sent to SVM_2; code 41-48: sent to SVM_3), and a more accurate classification result for these characters is obtained.

[0054] Regarding the classification of 6 and 9, M and W, since SVM_A has been used to obtain the direction of the characters in the cable, if the direction of the characters in the cable is judged to be forward, the results of encoding 49-52 are accurate results; if the direction of the characters in the cable is judged to be reverse, the results of encoding 49-52 are reverse results, that is, the recognized 6 is actually 9, 9 is actually 6, M is actually W, and W is actually M, and a substitution is sufficient.

[0055] Finally, according to the results of the above recognition of each character, the characters are sorted according to their horizontal coordinate positions in the original image, and the recognized coded string can be output. Not only can the function of correctly and uniquely identifying the coded characters be realized regardless of how the cable is initially placed and whether the cable coding direction is reversed, but also the classification categories are reduced and the classification accuracy is improved by dividing the large classifier into multiple small classifiers.

[0056] Finally, during actual use, characters with high recognition accuracy can be recorded in real time, the data set can be continuously expanded, and training can be performed regularly to continuously improve the accuracy and stability of the system.

[0057] According to the aviation cable code visual recognition method that takes into account the coding directionality proposed in the embodiment of the present application, as long as the cable code is fully exposed to the camera's field of view, no matter how the cable is placed in the camera's field of view, its direction can be corrected and an accurately recognized coding string can be finally recognized. By estimating the directionality of the cable code, the problem of misrecognition of some centrally symmetrical characters in code recognition can be solved. By dividing a large classifier into multiple small classifiers, the classification categories are reduced and the accuracy of code recognition is improved.

[0058] Next, a visual identification device for aviation cable codes taking into account coding directionality proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0059] Fig. 9 This is an example diagram of an aviation cable coding visual identification device that takes coding directionality into consideration according to an embodiment of the present application.

[0060] like Fig. 9 As shown, the aviation cable coding visual recognition device 10 taking coding directionality into consideration includes: a collection module 100 , a correction module 200 , a segmentation module 300 and a recognition module 400 .

[0061] Among them, the acquisition module 100 is used to acquire the cable surface coded image and perform image preprocessing. The correction module 200 is used to obtain the upper and lower boundary points of the cable in the cable surface coded image, fit the boundary and perform tilt correction, and correct the cable to the horizontal direction. The segmentation module 300 is used to segment and optimize the code in the cable surface coded image to obtain multiple rectangular areas, and rotate the multiple rectangular areas to obtain multiple coded characters to be identified. The recognition module 400 is used to input multiple coded characters to be identified into multiple classifiers pre-trained for respective coding directions, and obtain the coding direction and coding recognition results through multiple classifiers.

[0062] In one embodiment of the present application, the acquisition module 100 is specifically used to acquire a cable surface coded image using a portable digital microscope with adjustable magnification; downsample the cable surface coded image using a bilinear interpolation algorithm, scale down the cable surface coded image, and perform image filtering on the downsampled cable surface coded image using a nonlinear filtering algorithm.

[0063] In one embodiment of the present application, the correction module 200 includes:

[0064] A processing unit, used for performing neighborhood mean binarization processing on the pre-processed cable surface coding image to highlight the boundary of the cable;

[0065] A selection unit, used for obtaining a plurality of continuous contour groups through closed contours of the binary image, and selecting a preset number of contour groups with the largest contour areas from the plurality of continuous contour groups;

[0066] A determination unit, used for sorting the centroid coordinates of the selected contour group and filtering out useless points to obtain the upper and lower boundary points of the cable in the cable surface coding image;

[0067] The rotation unit is used to fit a straight line according to the least square method of the cable boundary points, calculate the cable inclination angle, and rotate the cable surface coded image by the inclination angle to correct the cable surface coded image to a horizontal direction.

[0068] In one embodiment of the present application, the segmentation module 300 is specifically used to perform horizontal and vertical projection segmentation of the cable code by projection method, perform regional search based on the principle that the local black pixels are the most dense and the most centered, perform segmentation optimization to obtain multiple rectangular areas, crop the images in the multiple rectangular areas, and rotate them clockwise / counterclockwise by a preset angle to obtain multiple coded characters to be identified.

[0069] In one embodiment of the present application, it also includes: a training module for designing a cable coding direction identifier, training multiple classifiers for respectively encoding directions through a training set, the training set including: characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, characters that have their own central symmetry properties and characters that are centrally symmetric to each other, training a first large classifier through all training data in the training set, training a second small classifier and a third small classifier through the forward characters and reverse characters of the characters that do not have their own central symmetry properties and are not centrally symmetric with other characters, respectively, and training a fourth small classifier through characters that have their own central symmetry properties.

[0070] It should be noted that the aforementioned explanation of the embodiment of the aviation cable coding visual recognition method considering the coding directionality is also applicable to the aviation cable coding visual recognition device considering the coding directionality of this embodiment, and will not be repeated here.

[0071] According to the aviation cable code visual recognition device that takes the code directionality into consideration in the embodiment of the present application, as long as the cable code is completely exposed to the camera's field of view, no matter how the cable is placed in the camera's field of view, its direction can be corrected and an accurately recognized code string can be finally recognized. The problem of misrecognition of some centrally symmetrical characters in code recognition can be solved by estimating the directionality of the cable code, and by dividing a large classifier into multiple small classifiers, the classification categories are reduced, thereby improving the accuracy of code recognition.

[0072] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0073] A memory 1001 , a processor 1002 , and a computer program stored in the memory 1001 and executable on the processor 1002 .

[0074] When the processor 1002 executes the program, the aviation cable code visual recognition method considering the coding directionality provided in the above embodiment is implemented.

[0075] Furthermore, the electronic device further comprises:

[0076] The communication interface 1003 is used for communication between the memory 1001 and the processor 1002 .

[0077] The memory 1001 is used to store computer programs that can be executed on the processor 1002 .

[0078] The memory 1001 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0079] If the memory 1001, the processor 1002 and the communication interface 1003 are implemented independently, the communication interface 1003, the memory 1001 and the processor 1002 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnection (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0080] Optionally, in a specific implementation, if the memory 1001, the processor 1002 and the communication interface 1003 are integrated on a chip, the memory 1001, the processor 1002 and the communication interface 1003 can communicate with each other through an internal interface.

[0081] The processor 1002 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0082] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the above-mentioned method for visually identifying aviation cable codes taking into account the coding directionality.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0084] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0085] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0086] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0087] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

Claims

1. A visual recognition method for aviation cable codes considering the coding directionality, It is characterized in that The following steps are involved: Collect cable surface coded images and perform image preprocessing; The upper and lower boundary points of the cable in the cable surface coded image are obtained, the boundary is fitted and the tilt correction is performed, and the cable is corrected to the horizontal direction; specifically, the following steps are performed: the pre-processed cable surface coded image is subjected to neighborhood mean binarization processing to highlight the boundary of the cable; a plurality of continuous contour groups are obtained through the closed contour of the binary image, and a preset number of contour groups with the largest contour area are selected from the plurality of continuous contour groups; the centroid coordinates of the selected contour groups are sorted and useless points are filtered out to obtain the upper and lower boundary points of the cable in the cable surface coded image; a straight line is fitted according to the least squares method of the cable boundary points, the cable tilt angle is calculated, and the cable surface coded image is rotated by the tilt angle to correct the cable surface coded image to the horizontal direction; Segmenting and optimizing the codes in the cable surface coding image to obtain a plurality of rectangular areas, and rotating the plurality of rectangular areas to obtain a plurality of coded characters to be identified; The plurality of coded characters to be recognized are input into a plurality of classifiers that are pre-trained for respectively encoding directions, and the encoding directions and encoding recognition results are obtained through the plurality of classifiers.

2. The method according to claim 1, It is characterized in that The collecting cable surface coded image and performing image preprocessing include: Using a portable digital microscope with adjustable magnification to collect the cable surface coding image; The cable surface coded image is downsampled by using a bilinear interpolation algorithm, the cable surface coded image is proportionally reduced, and the downsampled cable surface coded image is filtered by using a nonlinear filtering algorithm.

3. The method according to claim 1, It is characterized in that The code in the cable surface code image is segmented and optimized to obtain a plurality of rectangular areas, and the plurality of rectangular areas are rotated to obtain a plurality of code characters to be identified, including: The cable code is segmented in the horizontal and vertical directions by projection method, and the area search is performed based on the principle that the local black pixels are the most dense and the most centered. The segmentation optimization is performed to obtain the multiple rectangular areas, and the images in the multiple rectangular areas are cropped out. They are rotated clockwise / counterclockwise by a preset angle to obtain multiple coded characters to be identified.

4. The method according to claim 1, It is characterized in that Also includes: A cable coding direction identifier is designed, and multiple classifiers for respectively coding directions are trained through a training set, wherein the training set includes: characters that do not have their own central symmetry property and are not centrally symmetric with other characters, characters that have their own central symmetry property and characters that are centrally symmetric to each other, a first large classifier is trained through all training data of the training set, a second small classifier and a third small classifier are respectively trained through the positive characters and reverse characters of the characters that do not have their own central symmetry property and are not centrally symmetric with other characters, and a fourth small classifier is trained through the characters that have their own central symmetry property.

5. A visual recognition device for aviation cable codes taking into account the coding directionality, It is characterized in that include: An acquisition module is used to acquire cable surface coded images and perform image preprocessing; A correction module, used for obtaining the upper and lower boundary points of the cable in the cable surface coded image, fitting the boundary and performing tilt correction, and correcting the cable to a horizontal direction; A segmentation module, used for segmenting and optimizing the code in the cable surface code image to obtain a plurality of rectangular areas, and rotating the plurality of rectangular areas to obtain a plurality of code characters to be identified; A recognition module, used for inputting the plurality of coded characters to be recognized into a plurality of classifiers pre-trained for respectively encoding directions, and obtaining the encoding directions and encoding recognition results through the plurality of classifiers; The correction module comprises: A processing unit, used for performing neighborhood mean binarization processing on the pre-processed cable surface coding image to highlight the boundary of the cable; A selection unit, configured to obtain a plurality of continuous contour groups through closed contours of the binary image, and select a preset number of contour groups with the largest contour areas from the plurality of continuous contour groups; A determination unit, used for sorting the centroid coordinates of the selected contour group and filtering out useless points to obtain the upper and lower boundary points of the cable in the cable surface coded image; The rotation unit is used to fit a straight line according to the least square method of the cable boundary points, calculate the cable inclination angle, and rotate the cable surface coded image by the inclination angle to correct the cable surface coded image to a horizontal direction.

6. The device according to claim 5, It is characterized in that The acquisition module is specifically used to use a portable digital microscope with adjustable magnification to acquire the cable surface coded image; use a bilinear interpolation algorithm to downsample the cable surface coded image, scale down the cable surface coded image, and use a nonlinear filtering algorithm to perform image filtering on the downsampled cable surface coded image.

7. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for visually identifying aviation cable codes taking into account the coding directionality as described in any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that The program is executed by a processor to implement the method for visually identifying aviation cable codes taking into account the coding directionality as described in any one of claims 1 to 4.