Steel plate size measuring method
The YOLOv8 algorithm of machine learning trains custom steel plate image datasets, monitors the steel plate spacing in real time, solves the problems of large manual measurement errors and slow speeds, and improves the safety and production efficiency of the heat treatment furnace.
Patent Information
- Application Number
- CN202510250292.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-07-11
AI Technical Summary
There are large errors in manual measurement of steel plate size, which is difficult to meet the needs of efficient and precise production. The slow manual measurement speed has become a bottleneck in production efficiency, resulting in high risk of collision of steel plates in heat treatment furnaces.
The YOLOv8 algorithm of machine learning is used to train a custom steel plate image dataset, and the steel plate profile and length and position information are obtained through computer vision technology, and the steel plate spacing is monitored in real time and feedback to the control system.
It improves the operating safety and production efficiency of the heating furnace, reduces the risk of equipment loss and production stagnation, and avoids "car crashes" caused by manual judgment errors.
Smart Images

Figure CN120298472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for measuring the size of steel plates, belonging to the technical field of steelmaking methods. Background Art
[0002] In the iron and steel industry, the production and processing of steel plates are an important link. With the continuous advancement of industrial automation, in order to prevent steel plates from colliding in the heat treatment furnace, traditional workshops often increase the distance between steel plates to improve production efficiency. The method of manually measuring the size of steel plates gradually becomes difficult to meet the requirements of high-efficiency and precise production. Manual measurement is easily affected by subjective factors, such as the fatigue of measurement personnel and differences in operation skills, resulting in large measurement errors. Moreover, manual measurement is slow, which will become a bottleneck in production efficiency on a large-scale steel plate production line.
[0003] Computer vision technology has made great progress in recent years. High-speed and high-resolution industrial cameras emerge in an endless stream, and can clearly capture images of steel plates. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for measuring the size of steel plates. By using the advanced YOLOv8 algorithm in machine learning to train a custom steel plate image dataset, on the premise of identifying the steel plates, the contour, length and position information of the steel plates can be accurately obtained, thus effectively avoiding "crash" accidents caused by manual judgment errors, greatly improving the operation safety and production efficiency of the heating furnace, reducing equipment losses and potential production stagnation risks, and effectively solving the above problems existing in the background art.
[0005] The technical solution of the present invention is: a method for measuring the size of steel plates, comprising the following steps: S1: Use the camera function to obtain the video in the camera, and enter step S2; S2: The image processor realizes the conversion of the video to pictures, and enters step S3; S3: Image preprocessing, and enter step S4; S4: Image steel plate contour annotation, and enter step S5; S5: Train a custom steel plate dataset with the YOLOv8 algorithm, and enter step S6; S6: Obtain the steel plate contour, and enter step S7; S7: Calculate the length of the steel plate.
[0006] In the above step S1, the camera function is VideoCapture(), and the camera is an RGB-D camera.
[0007] In the above step S2, use the image processor to convert the obtained video into pictures, and form the original dataset with the collected steel plate images.
[0008] In step S3, the image preprocessing includes image grayscale conversion, scaling, padding, and format conversion.
[0009] In step S4, the image steel plate contour annotation includes using the Labelme tool to annotate the contour coordinates of the steel plate.
[0010] In step S5, select a suitable model from the YOLOv8 series according to the specific application scenario and requirements.
[0011] In step S6, load the model parameters trained by YOLOv8 into memory to achieve the segmentation of the steel plate contour in the image.
[0012] In step S7, calculate the length of the steel plate using the vertex coordinate information output by the YOLOv8 algorithm.
[0013] The beneficial effects of the present invention are as follows: By using the advanced YOLOv8 algorithm in machine learning to train a custom steel plate image dataset, on the premise of identifying the steel plate, the contour, length, and position information of the steel plate can be accurately obtained, thus effectively avoiding the "crash" accident caused by human judgment errors, greatly improving the operation safety and production efficiency of the heating furnace, and reducing equipment loss and potential production stagnation risks. Description of the Drawings
[0014] Figure 1 is the method flow chart of the present invention. Detailed Embodiments
[0015] In order to make the objectives, technical solutions, and advantages of the invention implementation cases clearer, the technical solutions in the invention implementation cases will be clearly and completely described below in conjunction with the drawings in the implementation cases. Obviously, the described implementation cases are a small part of the implementation cases of the present invention, rather than all of the implementation cases. Based on the implementation cases of the present invention, all other implementation cases obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0016] A method for measuring the size of a steel plate includes the following steps: S1: Use the camera function to obtain the video in the camera and enter step S2; S2: The image processor realizes the conversion of the video to pictures and enters step S3; S3: Image preprocessing, and enter step S4; S4: Image steel plate contour annotation, and enter step S5; S5: Train a custom steel plate dataset using the YOLOv8 algorithm and enter step S6; S6: Obtain the steel plate contour and proceed to step S7; S7: Calculate the length of the steel plate.
[0017] In step S1, the camera function is VideoCapture(), and the camera is an RGB-D camera.
[0018] In step S2, the image processor converts the acquired video into pictures and forms the original data set with the collected steel plate images.
[0019] In step S3, the image preprocessing includes image grayscaling, scaling, padding, and format conversion.
[0020] In step S4, the image steel plate contour annotation includes using the Labelme tool to annotate the contour coordinates of the steel plate.
[0021] In step S5, select a suitable model from the YOLOv8 series according to specific application scenarios and requirements.
[0022] In step S6, load the model parameters trained by YOLOv8 into memory to achieve the segmentation of the steel plate contour in the image.
[0023] In step S7, calculate the length of the steel plate using the vertex coordinate information output by the YOLOv8 algorithm.
[0024] In practical applications, the present invention uses the camera function to obtain the video in the camera; the image processor realizes the conversion from video to pictures; performs image preprocessing and image steel plate contour annotation; trains a custom steel plate data set using the YOLOv8 algorithm; obtains the steel plate contour; and calculates the length of the steel plate. The present invention can achieve "24-hour" all-weather real-time measurement of the steel plate size in the heat treatment furnace, improve the accuracy of the steel plate spacing. Through the annotation of a large amount of steel plate image data and the in-depth training of the YOLOv8 algorithm, the model can accurately locate the position coordinates of the steel plate in the heating furnace, monitor the steel plate spacing in real time and feedback it to the control system in a timely manner, thereby effectively avoiding the "crash" accident caused by human judgment errors. Embodiment
[0025] A method for measuring the size of a steel plate based on machine vision provided by an embodiment of the present invention includes the following steps: S1: Use the camera function to obtain the video in the camera and proceed to step S2; S2: The image processor realizes the conversion from video to pictures and proceeds to step S3; S3: Image preprocessing and proceed to step S4; S4: Image steel plate contour annotation and proceed to step S5; S5: Train a custom steel plate dataset using the YOLOv8 algorithm and proceed to step S6; S6: Obtain the steel plate contour and proceed to step S7; S7: Calculate the length of the steel plate.
[0026] The present invention uses the YOLOv8 algorithm in machine learning to train a custom steel plate image dataset. On the premise that a steel plate image is captured by a high-definition camera, geometric calculation methods are used to accurately measure its length, monitor the steel plate spacing in real time and feedback it to the control system in a timely manner, greatly improving the operation safety and production efficiency of the heating furnace, and reducing equipment loss and potential production stagnation risks.
[0027] Specifically, in step S1, the video in the camera is obtained using the camera function, where the function for reading the camera is VideoCapture(), and the camera is an RGB-D camera, including extracting the steel plate video in the RGB-D camera using the camera function.
[0028] In step S2, the obtained video is converted into pictures using an image processor, and the steel plate images that meet the conditions are selected to form the original dataset.
[0029] In step S3, image preprocessing includes parts such as image grayscaling, scaling, padding, and format conversion.
[0030] It should be noted that the YOLOv8 algorithm uses JSON format files to transfer configuration information during model training, validation, and inference. Therefore, format conversion is added to the image preprocessing process. At the same time, hyperparameters for training can also be defined in the JSON file, enabling the model training process to flexibly adjust the configuration according to specific tasks and datasets to achieve the best training effect.
[0031] In step S4, image steel plate contour annotation includes using the Labelme tool to annotate the contour coordinates of the steel plate.
[0032] It should be noted that the JSON file output by the Labelme tool includes segmentation mask information, category information, coordinate information, etc. for each segmentation region, and the algorithm model obtains the best hyperparameters by learning the relevant information.
[0033] In step S5, the YOLOv8 algorithm trains a custom steel plate dataset, including selecting a suitable model from the YOLOv8 series according to specific application scenarios and requirements.
[0034] It should be noted that the YOLOv8 series includes models with various scales and characteristics, such as YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, YOLOv8x, etc. Among them, the YOLOv8n model is relatively lightweight with fewer parameters, and is more suitable for scenarios where computing resources are limited, real-time requirements are high, but the accuracy requirements are not extremely high.
[0035] Step S6 to obtain the steel plate contour includes loading the model parameters trained by YOLOv8 into the memory to achieve the segmentation of the steel plate contour in the image.
[0036] Among them, the weight parameters trained by YOLOv8 include the vertex coordinates and mask information of the steel plate contour, and the above information can be used to achieve the segmentation of the steel plate contour.
[0037] In step S7, calculating the length of the steel plate includes calculating the length of the steel plate using the vertex coordinate information output by the YOLOv8 algorithm.
[0038] Among them, the calculation method of the steel plate length is obtained through the scale of the actual length and the length on the graph.
[0039] It should be noted that after using the YOLOv8 model to complete the segmentation of the steel plate contour, it is first necessary to determine the length measurement value corresponding to the steel plate contour on the graph. This measurement can be completed by using the corresponding distance calculation function in the image processing library. By obtaining the coordinates of the key endpoints on the steel plate contour, using the distance formula between two points to calculate the length of a specific line segment of the steel plate contour on the graph, and then accumulating the lengths of each part, etc., the overall length value of the steel plate on the graph can be finally obtained.
Claims
1. A method for measuring the size of a steel plate, characterized in that It includes the following steps: S1: Use the camera function to obtain the video in the camera and proceed to step S2; S2: The image processor realizes the conversion of the video to pictures and proceeds to step S3; S3: Image preprocessing and proceed to step S4; S4: Image steel plate contour annotation and proceed to step S5; S5: Use the YOLOv8 algorithm to train a custom steel plate dataset and proceed to step S6; S6: Obtain the steel plate contour and proceed to step S7; S7: Calculate the length of the steel plate.
2. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S1, the camera function is VideoCapture(), and the camera is an RGB-D camera.
3. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S2, use the image processor to convert the obtained video into pictures and form the original dataset with the collected steel plate images.
4. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S3, the image preprocessing includes image grayscale conversion, scaling, padding, and format conversion.
5. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S4, the image steel plate contour annotation includes using the Labelme tool to annotate the contour coordinates of the steel plate.
6. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S5, select a suitable model from the YOLOv8 series according to specific application scenarios and requirements.
7. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S6, load the model parameters trained by YOLOv8 into memory to achieve the segmentation of the steel plate contour in the image.
8. A method for measuring the size of a steel plate according to claim 1, characterized in that: In step S7, calculate the length of the steel plate using the vertex coordinate information output by the YOLOv8 algorithm.