A method for visual recognition of characters on the surface of shaft parts based on line array cameras

Through the visual recognition method based on line array cameras, using power motors and multi-layer sensor OCR classifiers, the problems of low efficiency and poor accuracy of traditional manual visual methods are solved, and efficient and accurate recognition of surface characters of shaft parts is achieved. Suitable for Industry 4.0 smart factories.

CN114140796BActive Publication Date: 2024-09-27BUSINESS SCHOOL OF ANHUI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111438114.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-09-27
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The traditional artificial visual method used for surface character recognition of shaft parts has low efficiency, poor accuracy, and subjective errors, making it difficult to meet the efficient needs of Industry 4.0 smart factories.

Method used

Using a visual recognition method based on a line array camera, the power motor drives the shaft parts to rotate, and uses the visual camera to collect images, perform mean filtering, thresholding, morphological operations, regional connectivity and multi-layer perceptron OCR classifiers for character recognition, replacing Manual operation improves recognition efficiency and accuracy.

Benefits of technology

It achieves efficient and accurate surface character recognition of shaft parts, reduces labor intensity, avoids subjective errors, and overcomes the difficulties and low accuracy of area array cameras in imaging shaft parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140796B
    Figure CN114140796B
Patent Text Reader

Abstract

The present invention discloses a method for visual recognition of characters on the surface of shaft parts based on a linear array camera, and belongs to the field of automatic optical detection. The present invention adopts three groups of visual cameras to respectively collect a part of the image of the shaft part, and obtains the complete surface image through an image stitching algorithm. The image stitching adopts a column tiling form, that is, the image is copied in the horizontal direction, and the image channels, width and height of the three groups of visual cameras are consistent. In view of the problem that the traditional manual visual method is used for the recognition of characters on the surface of shaft parts with low efficiency and poor accuracy, the present invention intends to provide a method for visual recognition of characters on the surface of shaft parts based on a linear array camera, which can replace the manual recognition operation, effectively reduce the labor intensity, and improve the recognition efficiency, and avoid subjective errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic optical detection, and more specifically, to a method for visually recognizing characters on the surface of shaft parts based on a linear array camera. Background Art

[0002] During the manufacturing process of the semi-axle parts of electric tricycles, it is necessary to perform embossing on the shaft, so that the production batch, theoretical size and other related information of the shaft parts are imprinted on the surface of the shaft in the form of characters. The relevant information in the characters is used as the standard data for subsequent dimension detection. Before the part dimension detection process, it is necessary to judge the correctness of its surface character information to ensure the accuracy of subsequent dimension measurement. In traditional methods, the judgment of character information mainly adopts the method of manual visual inspection, that is, the character information is read by human eyes and compared with the character template to obtain the result. This method can only meet the manufacturing process of semi-axle parts with a small number and a single model, and has the disadvantages of low efficiency, large workload, and subjective errors. With the popularization of industrial 4.0 smart factories, the surface character visual recognition method of shaft parts based on linear array cameras can replace manual character recognition of semi-axle parts.

[0003] Linear array cameras are also called line scan cameras. Generally, the object to be measured and the camera need to have relative motion to obtain the surface image of the object to be measured. Linear array cameras are suitable for the field of cylindrical, large-sized, and high-precision visual recognition. In the visual recognition of surface characters of shaft parts, the programmable controller PLC is used to drive the shaft parts to rotate, and the linear array camera is used synchronously to collect images. When the shaft moves one circle, the surface imaging of the shaft parts is completed. After the linear array camera completes the image acquisition, the image processing algorithm is used to recognize the characters in the image and give the results, thereby replacing the work of manual character recognition. At present, this technology has been widely used, but the application methods and practical application effects are different.

[0004] After searching, the application case with application number 2019107379191 discloses a method and device for quickly identifying the types of parts for a crankshaft flexible production line. The steps of the method are: obtaining the image of the part to be classified and identified through an industrial camera, removing the background of the obtained image using an image subtraction algorithm, and extracting the workpiece part; corroding, dilating, opening and closing the workpiece image to obtain the grayscale image of the part to be classified and identified and the grayscale image library of the sample workpiece; using the grayscale image to extract the skeleton features; using the grayscale image to train the AlexNet network model, after the network is trained, a b-dimensional grayscale image feature vector with the same columns as the skeleton feature matrix is ​​obtained; the two parameters are fused through an algorithm; the fused features are input into the support vector machine for training to complete the classification. This case helps to improve the accuracy of classification and identification, and the classification speed is fast. However, the industry is still in the process of continuous research and update of the visual recognition technology of the surface characters, hoping to further improve its application performance. Summary of the invention

[0005] 1. Technical problem to be solved by the invention

[0006] The purpose of the present invention is to address the problem of low efficiency and poor accuracy of surface character recognition of shaft parts using traditional manual visual methods. A method for visual recognition of surface characters of shaft parts based on a linear array camera is proposed, which can replace manual recognition operations, effectively reduce labor intensity, improve recognition efficiency, and avoid subjective errors.

[0007] 2. Technical solution

[0008] In order to achieve the above object, the technical solution provided by the present invention is:

[0009] A method for visually recognizing characters on the surface of shaft parts based on a linear array camera of the present invention comprises the following steps:

[0010] S1, the shaft parts are loaded and driven by the power motor to rotate. When the shaft parts rotate for the second time, the visual camera starts to collect images.

[0011] S2, after acquiring the surface image of the shaft part by using the visual camera, the image is subjected to mean filtering to suppress image noise;

[0012] S3, performing threshold processing on the image after noise removal to obtain a valid character image area;

[0013] S4, performing a morphological opening operation on the image region containing the characters to remove useless information larger than the opening operation kernel;

[0014] S5, using morphological closing operation to fill the holes in the result area of ​​S4 to obtain a full character area;

[0015] S6, performing a regional interconnection algorithm analysis on the image area in S5, selecting an area corresponding to the character according to the size of the pixel area, and obtaining an image area containing only the character;

[0016] S7, using the position feature in the Select_Shape region screening algorithm to sort the image regions of the characters, and selecting each character region in turn from left to right;

[0017] S8. Use the OCR classifier created by the multi-layer perceptron to classify each character obtained in S7, and output the character classification result to the software interface display area, at which time the character positioning and segmentation are completed.

[0018] Furthermore, in S1, the time required for the shaft part to rotate one circle is calculated in advance in the experiment based on the length of the shaft part and the speed of the shaft part, and the time it takes for the power motor to rotate one circle is controlled accordingly to ensure that a complete surface image of the shaft part is obtained with a certain accuracy each time an image is collected.

[0019] Furthermore, the filter template of the filtering process in S2 is set to a 3*3 matrix.

[0020] Furthermore, in S3, threshold processing is performed on the image after noise removal, and an image area in the grayscale range of 112-189 is selected to obtain a valid character image area.

[0021] Furthermore, the mask kernel size of the opening operation in S4 is 3 pixels.

[0022] Furthermore, the mask kernel size of the closing operation in S5 is 2 pixels.

[0023] Furthermore, S1 uses multiple groups of visual cameras to collect partial images of the shaft parts respectively, and obtains the complete surface image through the image stitching algorithm. The image stitching adopts the column tiling form, that is, the image is copied in the horizontal direction, and the image channels, width and height of the multiple groups of visual cameras are consistent.

[0024] Furthermore, in S1, the shaft parts are loaded onto a special fixing system, which includes a base, on which are provided a visual light source, multiple groups of visual cameras and a supporting assembly for supporting and driving the shaft parts to rotate, wherein each group of visual cameras is mounted on a bracket, and the bottom of the bracket cooperates with a slide rail on the base, and the spacing between the multiple groups of visual cameras is adjustable; the visual light source is irradiated in a dark field manner.

[0025] Furthermore, the support assembly includes an upper support roller for clamping the shaft part from the top, and a lower support roller for supporting the shaft part from both sides of the bottom. The lower support rollers on both sides and the upper support roller form a triangular support structure, and the lower support roller below is connected to the power motor and driven to rotate by it, thereby driving the shaft part to rotate. The two ends of the shaft part in the length direction are supported by the support assembly respectively.

[0026] 3. Beneficial effects

[0027] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:

[0028] (1) The character recognition visual recognition method integrated with deep learning training in the present invention can replace manual work to efficiently and accurately complete the surface character recognition of shaft parts.

[0029] (2) The character recognition method of the linear array camera adopted in the present invention effectively overcomes the problems of imaging difficulty and low precision of the area array camera in shaft parts. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the structure of the shaft parts fixing system used in the present invention.

[0031] Explanation of the symbols in the schematic diagram:

[0032] 100. Base; 101. Slide rail; 102. Bracket; 103. Visual camera; 104. Visual light source; 105. Fixed seat; 106. Lower support roller; 107. Upper support roller; 108. Shaft parts. DETAILED DESCRIPTION

[0033] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings.

[0034] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0035] The present invention will be further described below in conjunction with the embodiments.

[0036] Example 1

[0037] like Figure 1The shaft parts fixing system used in this embodiment is shown, including a base 100, on which a visual light source 104, a plurality of visual cameras 103 and a support assembly for supporting and driving the shaft parts 108 to rotate are arranged, wherein each group of visual cameras 103 is installed on a bracket 102, and the bottom of the bracket 102 cooperates with the slide rail 101 on the base 100, and the spacing between the plurality of visual cameras 103 is adjustable; the visual light source 104 is illuminated in a dark field mode. Figure 1 As shown in , this embodiment is provided with three sets of visual cameras 103, which are respectively mounted on the slide rail 101 by means of a bracket 102 for sliding cooperation, and the spacing between them can be adjusted according to the needs. When working, the position of the visual camera 103 is fixed. The visual light source 104 is installed at an angle of 45° with the camera field of view, and irradiates in a dark field mode, the purpose of which is to illuminate the shaft surface, avoid interference from natural light, and improve the imaging quality.

[0038] In this embodiment, the support assembly includes an upper support roller 107 for clamping the shaft part 108 from the upper part, and a lower support roller 106 for supporting the shaft part 108 from both sides of the lower part. The lower support rollers 106 on both sides and the upper support roller 107 on the upper part form a triangular support structure, and the lower support roller 106 at the lower part is connected to the power motor and driven to rotate by it, thereby driving the shaft part 108 to rotate, and the two ends of the shaft part 108 in the length direction are supported by the support assembly. Specifically, fixed seats 105 are respectively provided at both ends of the base 100, and a support stand is provided on the side of the fixed seat 105 at each end. The top of the support stand is provided with an adjustment screw extending downward, and the bottom of the adjustment screw is provided with a mounting seat for rotating and cooperating with the upper support roller 107, and the mounting seat and the support stand are matched through a longitudinal slide rail to achieve the adjustment and control of the height position of the upper support roller 107. Lower support rollers 106 are provided on both sides below the upper support roller 107. The lower support rollers 106 are also rotatably mounted on the lower mounting seat, and the lower support roller 106 on one side is connected to a power motor, i.e., a servo motor, and is driven to rotate by it. The lower support rollers 106 on both sides are connected and driven by a synchronous belt, thereby driving the shaft part 108 to rotate. When in use, the shaft part 108 is clamped between the lower support roller 106 and the upper support roller 107 in a pressed state, which can fix the shaft part 108 and drive it to rotate, so as to cooperate with the three groups of visual cameras 103 next to it for image acquisition. The three groups of visual cameras 103 are arranged in sequence along the length direction of the shaft part 108.

[0039] The surface character visual recognition method of this embodiment includes the following steps:

[0040] S1, the shaft part 108 is loaded and driven to rotate by a power motor. When the shaft part 108 rotates for the second time, the visual camera 103 starts to collect images;

[0041] Specifically, in this embodiment, three groups of visual cameras 103 are used to collect part of the image of the shaft part 108 respectively, and the complete surface image is obtained through the image stitching algorithm. The image stitching adopts the column tiling form, that is, the image is copied in the horizontal direction, and the image channels, width and height of the three groups of visual cameras 103 are consistent. In particular, in order to avoid errors caused by vibration and ensure complete acquisition of images, when debugging each group of visual cameras 103, the horizontal field of view spacing of adjacent visual cameras 103 is set to overlap by 1-2mm.

[0042] When the present embodiment starts working, the corresponding software of the computer is turned on to start the identification button. After the button is clicked, the startup function in the software program will sequentially execute turning on the visual light source 104 to a suitable brightness, sending data to the PLC to control the rotation of the servo motor, and triggering a signal when the shaft part 108 rotates the second circle to start collecting images. The count of the second circle trigger is based on the number of pulses required for the servo motor to rotate one circle. The present embodiment uses the second circle to start image collection and algorithm recognition because there is an acceleration process when the servo motor starts to run. If the image is collected at the beginning, it will cause an error in the longitudinal resolution of the image. Collecting the image in the second circle can ensure that the motor is in a uniform rotation state.

[0043] In the present embodiment, the time required for the shaft part 108 to rotate once is calculated in advance in the experiment according to the length of the shaft part 108 rotating once and the speed at which the servo motor drives the shaft part 108 to rotate. The formula is expressed as l=2πr, t=l / v, where r represents the radius of the shaft part 108, l represents the length of the shaft part 108 rotating once, v represents the speed of the servo motor, and t represents the time it takes for the servo motor to control the shaft part 108 to rotate once. The present embodiment determines the time for each power motor to rotate once according to the time t determined during the experiment, ensuring that a complete surface image of the shaft part 108 is obtained with a certain accuracy each time an image is collected.

[0044] It should also be noted that in actual situations, due to the manufacturing accuracy error of the radius of the shaft part 108 and the time delay caused by the power control system in the signal transmission process, the time delay here includes the process of the PLC sending a pulse signal to the servo motor to rotate it through the network port communication, and the process of the PC sending a signal to control the visual camera 103 to collect images. The above-mentioned accuracy error and time delay will cause the servo motor to rotate within the time t, and the collected image is not completely equal to the surface image of the shaft part 108. If this happens, and the position of the character to be recognized on the shaft part 108 is in the camera's field of view when the shaft part 108 starts to rotate, then due to the existence of the above-mentioned errors, the collected character part image will be incomplete or overlapping, affecting the character recognition algorithm processing. In order to avoid such problems, this embodiment needs to place the character area of ​​the shaft part 108 outside the field of view of the visual camera 103 when loading, that is, when the movement starts, there is no character image in the camera's field of view to ensure that the character area is fully imaged.

[0045] S2, after acquiring the surface image of the shaft part 108 by using the visual camera 103, the image is subjected to mean filtering to suppress image noise; specifically, the filtering template is set to a 3*3 matrix;

[0046] S3, performing threshold processing on the image after noise removal to obtain a valid character image area; specifically, selecting an image area in the grayscale range of 112-189;

[0047] S4, performing a morphological opening operation on the image region containing the characters to remove useless information larger than the opening operation kernel; specifically, the mask kernel size of the opening operation is 3 pixels;

[0048] S5, using morphological closing operation to fill the holes in the result area of ​​S4, and obtain a full character area; that is, fill the holes in the character area caused by the above processing process, and the mask kernel size of the closing operation is 2 pixels;

[0049] S6, performing an area 8-connection algorithm analysis on the image area in S5, selecting an area corresponding to the character according to the size of the pixel area, and obtaining an image area containing only the character;

[0050] S7, using the position feature in the Select_Shape region screening algorithm to sort the image regions of the characters, and selecting each character region in turn from left to right;

[0051] S8. Use the OCR classifier created by the multi-layer perceptron to classify each character obtained in S7, and output the character classification result to the software interface display area, at which time the character positioning and segmentation are completed.

[0052] The present invention and its embodiments are described schematically above, and the description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs a structural method and an embodiment similar to the technical solution without creativity without departing from the purpose of the invention, they shall all fall within the protection scope of the present invention.

Claims

1. A method for visual recognition of characters on the surface of shaft parts based on a linear array camera. Features: The following steps are involved: S1, the shaft part (108) is loaded and driven to rotate by a power motor, and when it rotates for the second time, the visual camera (103) starts to collect images; Specifically, the shaft part (108) is loaded onto a special fixing system, which includes a base (100), on which a visual light source (104), a plurality of groups of visual cameras (103) and a support assembly for supporting and driving the shaft part (108) to rotate are provided, wherein each group of visual cameras (103) is installed on a bracket (102), and the bottom of the bracket (102) cooperates with a slide rail (101) on the base (100), and the spacing between the plurality of groups of visual cameras (103) is adjustable; the visual light source (104) is irradiated in a dark field manner; The support assembly comprises an upper support roller (107) for clamping the shaft part (108) from the top, and lower support rollers (106) for supporting the shaft part (108) from both sides of the bottom, the lower support rollers (106) on both sides and the upper support roller (107) on the top form a triangular support structure, and the lower support roller (106) at the bottom is connected to a power motor and driven to rotate thereby, thereby driving the shaft part (108) to rotate, and both ends of the shaft part (108) in the length direction are respectively supported by the support assembly; S2, after acquiring the surface image of the shaft part (108) by using the visual camera (103), performing mean filtering on the image to suppress image noise; S3, performing threshold processing on the image after noise removal to obtain a valid character image area; S4, performing a morphological opening operation on the image region containing the characters to remove useless information larger than the opening operation kernel; S5, using morphological closing operation to fill the holes in the result area of ​​S4 to obtain a full character area; S6, performing a regional interconnection algorithm analysis on the image area in S5, selecting an area corresponding to the character according to the size of the pixel area, and obtaining an image area containing only the character; S7, using the position feature in the Select_Shape region screening algorithm to sort the image regions of the characters, and selecting each character region in turn from left to right; S8. Use the OCR classifier created by the multi-layer perceptron to classify each character obtained in S7, and output the character classification result to the software interface display area, at which time the character positioning and segmentation are completed.

2. According to the method for visual recognition of characters on the surface of shaft parts based on a linear array camera according to claim 1, Features: In S1, the time required for the shaft part (108) to rotate one circle is calculated in advance in the experiment based on the length of the shaft part (108) rotating one circle and the speed of the shaft part (108) rotating one circle, and the time for the power motor to rotate one circle is controlled accordingly to ensure that a complete surface image of the shaft part (108) is obtained with a certain accuracy each time an image is collected.

3. According to the method for visual recognition of characters on the surface of shaft parts based on a line array camera as described in claim 1, Features: The filter template for the filtering process in S2 is set to a 3*3 matrix.

4. According to claim 1, a method for visually recognizing characters on the surface of shaft parts based on a line array camera, Features: In S3, the image after noise removal is thresholded, and an image area in the grayscale range of 112-189 is selected to obtain a valid character image area.

5. According to claim 1, a method for visually recognizing characters on the surface of shaft parts based on a line array camera, Features: The mask kernel size of the opening operation in S4 is 3 pixels.

6. According to claim 1, a method for visually recognizing characters on the surface of shaft parts based on a line array camera, Features: The mask kernel size of the closing operation in S5 is 2 pixels.

7. According to claim 1, a method for visually recognizing characters on the surface of shaft parts based on a linear array camera, Features: In S1, multiple groups of visual cameras (103) are used to collect partial images of the shaft part (108) respectively, and a complete surface image is obtained through an image stitching algorithm. The image stitching adopts a column tiling form, that is, the image is copied in the horizontal direction, and the image channels, width and height of the multiple groups of visual cameras (103) are consistent.