Steel plate code spraying identification method suitable for complex environment
Through deep learning and computer vision technology, combined with multi-stage network model, the problem of low recognition rate of steel plate injection coding recognition in complex environments is solved, efficient and accurate automatic identification of injection coding information is achieved, and the informatization and intelligence level of steel production is improved.
Patent Information
- Application Number
- CN202510576601.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-09-02
AI Technical Summary
The existing steel plate inkjet coding recognition method has a low recognition rate in complex environments, making it difficult to effectively deal with problems such as the complexity of the inkjet coding font, the reflective interference on the surface of the steel plate, and the inclination and fracture of characters.
Using deep learning technology combined with computer vision, a multi-stage network model of inkjet area detection, line-by-line segmentation and character recognition includes multi-angle image acquisition, directional border detection, morphological processing, line-by-line detection model training and character recognition model training to achieve automated recognition.
It improves the identification accuracy and recognition efficiency of steel plate inkjet information, improves the efficiency of warehousing and logistics management, meets the information and intelligence needs of steel production, and has an identification accuracy of more than 95%.
Smart Images

Figure CN120580705A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of steel plate code spraying recognition, and in particular to a steel plate code spraying recognition method suitable for complex environments. Background Art
[0002] Steel plate coding is an important method for identifying each steel plate during the steel production process. The coding information usually includes the manufacturer's logo, steel plate size, number, specifications, and production information. This information is invaluable for steel plate traceability, inventory management, and production process optimization.
[0003] Currently, industrial steel plate inkjet code recognition relies primarily on manual or semi-automatic methods, resulting in low recognition efficiency. Existing OCR recognition systems are mostly optimized for standard printed fonts. However, facing issues such as the complexity of inkjet fonts, interference from reflective surfaces on steel plates, and tilted and broken characters, recognition accuracy still has significant room for improvement. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to propose a steel plate inkjet code recognition method suitable for complex environments to solve the technical problem of low recognition rate of existing steel plate inkjet code recognition methods.
[0005] The technical means adopted in the present invention are as follows:
[0006] A steel plate code recognition method suitable for complex environments includes the following steps:
[0007] S1, collecting the steel plate image including the coding area;
[0008] S2, performing coding area detection on the steel plate image collected by S1 to obtain the coding area;
[0009] S3, performing cropping and tilt correction on the coding area detected by S2 to obtain a corrected image;
[0010] S4, performing morphological processing on the image corrected in S3;
[0011] S5, performing line-by-line detection model training on the image processed by S4 to obtain a line-by-line detection model;
[0012] S6. Based on the line-by-line detection results of the line-by-line detection model, perform character recognition model training on each line of text to obtain a character recognition model;
[0013] S7. Use the trained line-by-line detection model and character recognition model to automatically analyze the coding area of the steel plate and output coding content information that meets industry requirements.
[0014] Furthermore, S1 specifically includes the following steps:
[0015] Use ONVIF protocol to control the on-site camera to automatically collect images of steel plates including the coding area from multiple angles and by region, and obtain high-quality images in real time through RTSP video streaming.
[0016] Furthermore, S2 specifically includes the following steps:
[0017] The steel plate image is detected using the oriented border object detection method. The bounding box in the oriented border object detection method is represented by the coordinates of four corner points (x1, y1, x2, y2, x3, y3, x4, y4).
[0018] Furthermore, S3 specifically includes the following steps:
[0019] For the coding area detected by S2, obtain the coordinates of the four corner points of the coding area boundary box and convert them into pixel coordinates according to the actual resolution of the image;
[0020] Use OpenCV to calculate the minimum bounding rectangle of the detection box to find the best cropping area, and obtain the center point, size, and rotation angle of the rectangle;
[0021] Calculate the rotation matrix and perform affine transformation on the image to adjust the coding area to the horizontal direction; after completing the rotation correction, crop the coding area.
[0022] Furthermore, in S3, for multiple lines of reverse characters, they are cropped and further rotated 180° to restore their forward display.
[0023] Furthermore, in S4, the morphological processing includes histogram equalization, dilation and erosion.
[0024] Furthermore, S5 specifically includes the following steps:
[0025] Use manual annotation tools to generate row-level annotation data;
[0026] Use the text detection model provided by PaddleOCR for training, and add data enhancement strategies during the training process;
[0027] The data augmentation strategy includes random rotation and resizing.
[0028] Furthermore, S6 specifically includes the following steps:
[0029] Based on the results of line-by-line detection, the segmented inkjet text lines are further organized and labeled to generate standardized annotation files that meet the needs of model training. The PaddleOCR recognition model is used for training and the model parameters are optimized.
[0030] The present invention also provides a storage medium, which includes a stored program, wherein when the program is run, any one of the above-mentioned steel plate code recognition methods applicable to complex environments is executed.
[0031] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. The processor executes any one of the above-mentioned steel plate inkjet coding recognition methods applicable to complex environments through the operation of the computer program.
[0032] Compared with the prior art, the present invention has the following advantages:
[0033] This paper combines deep learning with computer vision technologies to develop a highly robust inkjet code recognition method. This method, which includes key steps such as code area detection, line-by-line segmentation, and character recognition, enables automated and intelligent recognition of inkjet code information. This technology can significantly improve the accuracy of steel plate information traceability, enhance warehousing and logistics management efficiency, and provide technical support for the informatization and intelligentization of steel production.
[0034] The steel plate inkjet code recognition method provided by the present invention utilizes a three-stage network model: steel plate inkjet code area detection, cropping and correction, line-by-line segmentation, and character recognition. This method is highly robust and can operate stably in complex industrial environments, unaffected by factors such as lighting variations. Furthermore, its efficient processing flow significantly improves recognition efficiency, enabling the recognition of large numbers of steel plate inkjet codes in a short period of time, meeting the requirements of on-site steel plate inbound and outbound management systems. The steel plate inkjet code recognition method provided by the present invention has an accuracy rate exceeding 95%. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 Flow chart of the method of the present invention.
[0037] Figure 2 This is a flow chart of steel plate coding area detection according to the present invention.
[0038] Figure 3 This is a flow chart of the coding area cutting and correction process of the present invention.
[0039] Figure 4 This is a flow chart of character detection and recognition in the coding area of the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] like Figure 1-4 As shown, the present invention provides a steel plate inkjet code recognition method suitable for complex environments, which uses deep learning technology to perform area detection, line-by-line segmentation and character recognition on steel plate images to achieve character recognition in the inkjet code area of the steel plate image. The method specifically includes the following steps:
[0043] S1, collect the steel plate image with the coding area;
[0044] This steel plate image acquisition method utilizes the ONVIF protocol to control on-site cameras for automated multi-angle and regional acquisition, acquiring high-quality images in real time via RTSP video streaming. To store only valid images containing printed code information, an object detection algorithm trained on S2 is used to detect and filter printed code areas in the captured images in real time, reducing irrelevant data redundancy. Furthermore, this method incorporates a timed task scheduling mechanism to automatically execute acquisition tasks at set intervals, ensuring long-term, stable data acquisition.
[0045] S2. Detect the coding area of the collected steel plate image;
[0046] The steel plate images collected by S1 are used as the training set for model training. Since the steel plate images are tilted, the coded characters on the steel plate are not arranged horizontally, but have a certain tilt angle. The horizontal bounding box generated by the traditional target detection method will contain more irrelevant background, affecting the detection accuracy. Therefore, a directional border object detection method is adopted, which not only predicts the position of the target, but also provides additional rotation angle information, so that the detection box can more tightly surround the coded area. Its bounding box is represented by the coordinates of four corner points (x1, y1, x2, y2, x3, y3, x4, y4). Subsequently, the pictures in the training set are annotated, and the pictures as a whole are divided into two categories: multiple lines of forward characters and multiple lines of reverse characters. The above training samples are used to train the model so that it has high-precision target detection capabilities for the steel plate coded area.
[0047] S3, performing cropping and tilt correction on the detected inkjet coding area;
[0048] For the coding area detected by S2, the coordinates of the four corner points of its bounding box are obtained and converted to pixel coordinates based on the actual image resolution. OpenCV is then used to calculate the minimum bounding rectangle of the detection box to find the optimal cropping area, obtaining the rectangle's center point, dimensions, and rotation angle. Next, a rotation matrix is calculated and an affine transformation is performed on the image to adjust the coding area to the horizontal direction as much as possible. After rotation correction, the coding area is cropped. For multi-line reversed characters, the cropped characters are further rotated 180° to restore the normal display.
[0049] S4, performing morphological processing on the corrected image;
[0050] Since the image of the coding area after S3 cropping and correction may still have some factors that affect subsequent recognition, such as uneven lighting and character faults, a series of morphological processing methods are adopted, including histogram equalization, dilation and erosion, to enhance the contrast, connectivity and clarity of the characters.
[0051] Histogram equalization redistributes pixel grayscale values so that the cumulative distribution function approximates a linear distribution, making the brightness distribution more uniform. This enhances the contrast between characters and the background, making character outlines clearer. Dilation fills in broken areas of characters, making them more coherent. Erosion removes noise around characters, making them more detailed.
[0052] S5, training the processed image with a line-by-line detection model;
[0053] The line-by-line detection model is trained on the S4-processed images. First, manual annotation tools are used to generate line-level annotation data. Subsequently, the text detection model provided by PaddleOCR is trained. To adapt to the effects of different coding fonts and ambient lighting, data augmentation strategies such as random rotation and resizing are incorporated into the training process to ensure that the model can efficiently detect the coding area line by line.
[0054] S6, training a character recognition model for each line of text;
[0055] Based on the results of S5 line-by-line detection, the segmented inkjet text lines are further organized and labeled to generate standardized annotation files that meet the model training requirements. The PaddleOCR recognition model is used for training and the model parameters are optimized to enable it to accurately recognize inkjet characters.
[0056] S7. Feedback the recognition result of each line to the system and extract the required character content.
[0057] The line-by-line detection model and character recognition model trained by S5 and S6 are used to automatically analyze the coding area of the steel plate and output coding content information that meets industry requirements.
[0058] Example
[0059] A steel plate code recognition method suitable for complex environments specifically includes the following steps:
[0060] When capturing images of steel plates, a Huawei network camera (IP address: 192.168.3.55) was used as the image acquisition device. Different shooting positions were set using the ONVIF protocol to obtain multi-view images covering the entire coding area. The system reads the camera's real-time video stream based on the RTSP protocol and uses the YOLO11 model (best.pt weight) to detect targets in the coding area. Once the coding area is detected, the system automatically captures and saves high-quality images for subsequent OCR recognition. Furthermore, the system sets a 20-minute acquisition interval and automatically runs image acquisition tasks regularly to meet the high-frequency coding detection requirements of industrial production.
[0061] S2. Use manual labeling tools to process the steel plate image dataset containing the coding area collected by S1. Classify the characters in the image according to their direction. One type is multi-line forward characters, marked as char, and the other type is multi-line reverse characters, marked as unchar. The label file data format is as follows:
[0062] [class_index x1 y1 x2 y2 x3 y3 x4 y4]
[0063] The processed dataset is then converted into samples that conform to the YOLO11 training format, and the YOLO11 oriented bounding box detection model (YOLO11s-obb.pt) is loaded for training. The trained model (best.pt) is then tested to ensure that the model can efficiently detect the steel plate coding area and accurately determine the character direction.
[0064] S3, obtain the coordinates of the four corner points of its bounding box from the coding area detected by S2. Since the detection box coordinates are normalized, they need to be converted into pixel coordinates according to the actual size of the image. The calculation method is:
[0065] x 像素 =x 归一化 × Image width
[0066] y 像素 =y 归一化 × Image width
[0067] Next, the OpenCV minAreaRect method is used to calculate the minimum bounding rectangle of the detection box to find the optimal cropping area. The center point, dimensions, and rotation angle of the rectangle are obtained. Next, the image is oriented horizontally as much as possible by calculating the rotation matrix (cv2.getRotationMatrix2D) and performing an affine transformation (cv2.warpAffine). After rotation correction, the printed area is cropped. For reversed characters (i.e., labels with unchar), cropping is followed by a further 180° rotation to restore the normal display.
[0068] S4: After S3 cropping and correction, the image of the coding area may still have some factors that affect subsequent recognition, such as uneven lighting and character faults. Therefore, a series of morphological processing methods are used, including histogram equalization, dilation, and erosion, to enhance the contrast, connectivity, and clarity of the characters.
[0069] Histogram equalization redistributes pixel grayscale values so that the cumulative distribution function approximates a linear distribution, making the brightness distribution more uniform. This enhances the contrast between characters and the background, making character outlines clearer. Dilation fills in broken areas of characters, making them more coherent. Erosion removes noise around characters, making them more detailed.
[0070] S5. Train the line-by-line detection model for the image processed by S4. First, use the annotation tool PPOCRLabel to annotate the image line by line to generate line-level annotation data. In order to adapt to the influence of different inkjet fonts and ambient lighting, data enhancement strategies such as random rotation and size transformation are added during the training process. These operations effectively improve the robustness of the model to interference factors such as uneven spraying and lighting changes. During the training phase, the PPOCRv3 text detection model in PPOCR is used as the basic network structure, and feature extraction is performed based on ResNet-50 as the backbone network. During the training process, a fixed learning rate decay strategy is set. When there is no significant improvement in the performance of the validation set for several consecutive epochs, the training is terminated to avoid overfitting. When the model can achieve accurate line-by-line detection results on the test set, the optimal model is derived for automated inkjet line detection.
[0071] S6. Based on the results of line-by-line detection in S5, the segmented inkjet text lines are further organized and annotated to generate standardized annotation files that meet the requirements of model training. During the training phase, the PPOCRv4 text recognition model in PPOCR is used as the basic network structure, and text recognition is performed based on the CRNN and visual feature extraction network SVTR as the backbone network. During the training process, if the character recognition accuracy on the validation set does not significantly improve after several consecutive epochs, training is terminated. When the model can achieve accurate character recognition results on the test set, the optimal model is derived for automated inkjet character recognition.
[0072] S7 uses the line-by-line detection model and character recognition model trained in S5 and S6 to automatically parse the steel plate coding area and accurately output the 10-digit steel plate number.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A steel plate inkjet identification method suitable for complex environments, characterized in that: The steps include: S1, collecting the steel plate image including the coding area; S2, performing coding area detection on the steel plate image collected by S1 to obtain the coding area; S3, performing cropping and tilt correction on the coding area detected by S2 to obtain a corrected image; S4, performing morphological processing on the image corrected in S3; S5, performing line-by-line detection model training on the image processed by S4 to obtain a line-by-line detection model; S6. Based on the line-by-line detection results of the line-by-line detection model, perform character recognition model training on each line of text to obtain a character recognition model; S7. Use the trained line-by-line detection model and character recognition model to automatically analyze the area of the steel plate to be coded, and output the coding content information that meets industry requirements.
2. The steel plate inkjet code recognition method suitable for complex environments according to claim 1 is characterized in that: S1 specifically includes the following steps: Use ONVIF protocol to control the on-site camera to automatically collect images of steel plates including the coding area from multiple angles and by region, and obtain high-quality images in real time through RTSP video streaming.
3. The steel plate inkjet code recognition method suitable for complex environments according to claim 1 is characterized in that: S2 specifically includes the following steps: The steel plate image is detected using the oriented border object detection method. The bounding box in the oriented border object detection method is represented by the coordinates of four corner points (x1, y1, x2, y2, x3, y3, x4, y4).
4. The steel plate inkjet code recognition method suitable for complex environments according to claim 1, characterized in that: S3 specifically includes the following steps: For the coding area detected by S2, obtain the coordinates of the four corner points of the coding area boundary box and convert them into pixel coordinates according to the actual resolution of the image; Use OpenCV to calculate the minimum bounding rectangle of the detection box to find the best cropping area, and obtain the center point, size, and rotation angle of the rectangle; Calculate the rotation matrix and perform affine transformation on the image to adjust the coding area to the horizontal direction; After completing the rotation correction, crop the coding area.
5. The steel plate inkjet code recognition method suitable for complex environments according to claim 4 is characterized in that: In S3, for multiple lines of reverse characters, they are cropped and further rotated 180° to restore their forward display.
6. The steel plate inkjet code recognition method suitable for complex environments according to claim 1, characterized in that: In S4, the morphological processing includes histogram equalization, dilation and erosion.
7. The steel plate inkjet code recognition method suitable for complex environments according to claim 1, characterized in that: S5 specifically includes the following steps: Use manual annotation tools to generate row-level annotation data; Use the text detection model provided by PaddleOCR for training, and add data enhancement strategies during the training process; The data augmentation strategy includes random rotation and resizing.
8. The steel plate inkjet code recognition method suitable for complex environments according to claim 1, characterized in that: S6 specifically includes the following steps: Based on the results of line-by-line detection, the segmented inkjet text lines are further organized and labeled to generate standardized annotation files that meet the needs of model training. The PaddleOCR recognition model is used for training and the model parameters are optimized.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the steel plate inkjet coding recognition method applicable to complex environments as described in any one of claims 1 to 8 is executed.
10. 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 steel plate inkjet coding recognition method applicable to complex environments as described in any one of claims 1 to 8 through the computer program.