A steel pipe butt joint abnormality detection method and device, electronic equipment and storage medium
By automating the detection of steel pipe end-alignment anomalies and utilizing image processing and model fitting technologies, the problem of low efficiency in manual identification has been solved, achieving efficient and low-cost end-alignment anomaly detection and ensuring production line safety.
Patent Information
- Application Number
- CN202410179257.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-18
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2044-02-18
AI Technical Summary
The existing steel pipe end-alignment inspection mainly relies on manual identification, which is inefficient and provides untimely feedback, leading to safety hazards and resource waste on the production line.
By acquiring images of steel pipes, using preset baffle and steel pipe detection models, the boundary range and center coordinates of the baffle and steel pipe are calculated, the center line of the steel pipe is fitted, the collision state is determined and the maximum offset of the center point is calculated, and the end-joint anomaly is automatically identified and an alarm is triggered.
It enables real-time monitoring of abnormal steel pipe end alignment, reduces labor costs, improves detection efficiency, reduces losses, and ensures production line safety.
Smart Images

Figure CN118037659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of steel smelting technology, specifically to a method, apparatus, electronic device, and storage medium for detecting abnormal end-joints in steel pipes. Background Technology
[0002] In the steel smelting process, before steel pipes are cut by the pipe saw after being conveyed by roller conveyors, they need to be aligned at the baffle to ensure that the cut surfaces of each steel pipe are as flat as possible. However, if the steel pipes are not aligned properly during transportation and cutting, it will lead to inaccurate cutting and the production of unqualified steel pipe products, wasting resources and time. Misaligned steel pipes may also suddenly move or tip over during the cutting process, which will pose a great safety hazard to the production line. Therefore, it is necessary to notify the relevant personnel in time when any abnormality in the alignment of steel pipes is found.
[0003] Current methods for detecting flush joints in steel pipes primarily rely on experienced workers to manually identify abnormalities. However, due to the existence of multiple production lines, each with long production cycles and high-speed steel pipe transportation, manual monitoring becomes inefficient and feedback is often delayed, compromising the safety of the production lines. Summary of the Invention
[0004] In view of the shortcomings of the above-mentioned related technologies, this application provides a method, device, electronic device and storage medium for detecting steel pipe end-alignment anomalies, so as to solve the technical problems of low identification efficiency and high cost of existing steel pipe end-alignment anomaly detection methods.
[0005] This application provides a method for detecting steel pipe end-to-end anomalies. The method includes: acquiring an image of a steel pipe to be detected, the image including at least two steel pipes and at least one baffle; inputting the image of the steel pipe to be detected into a preset baffle detection model to obtain baffle detection results, the baffle detection results including the baffle detection frame width, baffle detection frame height, and baffle detection frame center coordinates; inputting the image of the steel pipe to be detected into a preset steel pipe detection model to obtain steel pipe detection results for each of the steel pipes, the steel pipe detection results including the steel pipe detection frame width and steel pipe detection frame center coordinates; and based on the baffle detection frame width, the... The boundary range of the baffle is obtained by using the height of the baffle detection frame and the center coordinates of the baffle detection frame. The center coordinates of the head of each steel pipe are obtained based on the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame. The center line of the steel pipe is obtained by fitting the center coordinates of the head of the steel pipes of multiple steel pipes. The collision state between the head of the steel pipe and the baffle is obtained according to the boundary range of the baffle and the center line of the steel pipe. If the collision state is that a collision has occurred, the maximum offset of the center point is obtained based on the center coordinates of the head of the steel pipe and the center line of the steel pipe. If the maximum offset of the center point exceeds a preset offset threshold, the detection result of the image of the steel pipe to be detected is abnormal.
[0006] In one embodiment of this application, historical steel pipe images are obtained, the historical steel pipe images including at least two steel pipes and at least one baffle; the coordinate positions of the steel pipes are marked in the historical steel pipe images based on steel pipe labels, and the coordinate positions of the baffles are marked in the historical steel pipe images based on baffle labels; a training dataset is established based on the marked historical steel pipe images; the training dataset is input into a preset detection model to obtain the preset steel pipe detection model and the preset baffle detection model.
[0007] In one embodiment of this application, the upper and lower boundary ranges of the baffle boundary range are obtained based on the center coordinates of the baffle detection frame and the baffle detection height; the left and right boundary ranges of the baffle boundary range are obtained based on the center coordinates of the baffle detection frame and the baffle detection width.
[0008] In one embodiment of this application, a loss function is constructed based on the center coordinates of multiple steel pipe heads; the target slope and target intercept of the steel pipe center line are obtained by solving the loss function; and the steel pipe center line is obtained based on the target slope and the target intercept.
[0009] In one embodiment of this application, the target slope of the center line of the steel pipe is obtained for multiple consecutive frames, and an average slope is obtained based on the target slope of the multiple frames; if the average slope is less than a preset slope threshold, the intersection state of the center line of the steel pipe and the boundary range of the baffle is determined; if the intersection state is an intersection, the collision state is a collision.
[0010] In one embodiment of this application, the point-to-line distance from the center of the head of each steel pipe to the center line of the steel pipe is obtained based on the center coordinates of the head of each steel pipe; the maximum value of the point-to-line distance is taken as the maximum offset of the center point.
[0011] In one embodiment of this application, if the detection result is abnormal, an alarm indicator is triggered to sound an alarm.
[0012] The beneficial effects of the present invention: Embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for detecting abnormal steel pipe end-to-end joints. The method includes acquiring an image of the steel pipe to be detected; inputting the image of the steel pipe to be detected into a preset baffle detection model to obtain baffle detection results; inputting the image of the steel pipe to be detected into the preset steel pipe detection model to obtain steel pipe detection results; estimating the baffle detection frame width, baffle detection frame height, and baffle detection frame center coordinates to obtain the baffle boundary range; obtaining the steel pipe head center coordinates of each steel pipe based on the steel pipe detection frame width and steel pipe detection frame center coordinates; fitting the steel pipe centerline based on the steel pipe head center coordinates of multiple steel pipes; and obtaining the steel pipe end-to-end joint joint based on the baffle boundary range and the steel pipe centerline. The collision status between the part and the baffle is determined. If the collision status is "collision has occurred," cases that have not yet collided can be filtered out, improving detection efficiency. The maximum offset of the center point is obtained based on the center coordinates of the steel pipe head and the straight line of the steel pipe center. If the maximum offset of the center point exceeds the preset offset threshold, or if the distance between the center coordinates of the steel pipe head and the straight line of the steel pipe center is too far, it is considered an abnormal steel pipe alignment. The detection result of the steel pipe image to be detected is abnormal. This method can realize real-time monitoring of steel pipes on each production line, so that when steel pipe alignment is abnormal, an alarm can be triggered in time to minimize losses. In addition, it can also reduce the labor cost of manual supervision, thereby achieving high-efficiency and low-cost steel pipe alignment anomaly detection.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0014] Figure 1 This is a schematic diagram illustrating the implementation environment of a method for detecting abnormal end-joints in steel pipes, as shown in an exemplary embodiment of this application.
[0015] Figure 2 This is a flowchart illustrating an exemplary embodiment of the present application of a method for detecting abnormal end-joint joints in steel pipes;
[0016] Figure 3 This is an exemplary embodiment of the present application illustrating a steel pipe end-alignment detection alarm flowchart;
[0017] Figure 4This is an exemplary embodiment of the present application illustrating the original image of the steel pipe and baffle in the detection of steel pipe end anomalies;
[0018] Figure 5 This is an exemplary embodiment of the present application illustrating a detection frame image of a steel pipe and a baffle in the detection of steel pipe end-to-end anomalies;
[0019] Figure 6 This is an exemplary embodiment of the present application illustrating a straight line image of the center of a steel pipe during steel pipe end-to-end anomaly detection;
[0020] Figure 7 This is a block diagram illustrating an abnormal steel pipe end-joint detection device, as shown in an exemplary embodiment of this application.
[0021] Figure 8 This is a schematic diagram illustrating the structure of an electronic device as shown in an exemplary embodiment of this application. Detailed Implementation
[0022] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0024] It should be noted that in this application, terms such as "first" and "second" are merely for distinguishing similar objects, and do not limit the order or sequence of similar objects. The variations of "including" and "having" indicate that the scope covered by the subject of the word is not exclusive, except for the examples shown by the word.
[0025] It is understood that the various numerical designations, step numbers, and other identifiers recorded in this application are for descriptive convenience and are not intended to limit the scope of this application. The size of the identifiers in this application does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.
[0026] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0027] The embodiments of this application respectively propose a method for detecting abnormal steel pipe end-joints, a device for detecting abnormal steel pipe end-joints, an electronic device, a computer-readable storage medium, and a computer program product. These embodiments will be described in detail below.
[0028] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a method for detecting abnormal end-joints in steel pipes, as shown in an exemplary embodiment of this application.
[0029] like Figure 1 As shown, the implementation environment may include an image acquisition device 101 and a computer device 102. The image acquisition device 101 can use an industrial camera to capture the image to be inspected and adjust the camera angle so that the steel pipe and the baffle are both in the field of view. The computer device 102 may be at least one of a microcomputer, an embedded computer, a neural network computer, etc.
[0030] In one embodiment of this application, an image acquisition device 101 acquires an image of the steel pipe to be detected during the impact of the steel pipe against the baffle. The image acquisition device 101 adjusts its shooting angle before acquisition to ensure that the image of the steel pipe to be detected fully includes all the steel pipes and the baffle. The image acquisition device 101 sends the acquired image of the steel pipe to be detected to a computer device 102. The computer device 102 inputs the image of the steel pipe to be detected into a preset baffle detection model and a preset steel pipe detection model to obtain baffle detection results and steel pipe detection results. The baffle detection results include the width, height, and center coordinates of the baffle detection frame. The steel pipe detection results include... The computer device 102 obtains the boundary range of the baffle based on the width, height, and center coordinates of the baffle detection frame. It also obtains the center coordinates of the head of each steel pipe based on the width and center coordinates of the steel pipe detection frame. The center line of the steel pipe is obtained by fitting the center coordinates of the head of multiple steel pipes. The collision state between the head of the steel pipe and the baffle is obtained according to the boundary range of the baffle and the center line of the steel pipe. If the collision state is "collision has occurred", the maximum offset of the center point is obtained based on the center coordinates of the head of the steel pipe and the center line of the steel pipe. If the maximum offset of the center point exceeds the preset offset threshold, the detection result of the image of the steel pipe to be detected is abnormal.
[0031] Please seeFigure 2 , Figure 2 This is a flowchart illustrating an exemplary embodiment of a method for detecting abnormal end-joint joints in steel pipes, as shown in this application. This method can be applied to... Figure 1 The implementation environment shown can also be applied to other exemplary implementation environments and specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0032] like Figure 2 As shown, in an exemplary embodiment, the method for detecting abnormal steel pipe end joints includes at least steps S210 to S280, which are described in detail below:
[0033] Step S210: Obtain an image of the steel pipe to be inspected, which includes at least two steel pipes and at least one baffle.
[0034] In one embodiment of this application, an image of the steel pipes being aligned at the baffle is acquired as the image of the steel pipe to be detected. The image to be detected includes at least one baffle and two steel pipes.
[0035] In one embodiment of this application, please refer to Figure 4 , Figure 4 This is an exemplary embodiment of the present application illustrating the original image to be detected of the steel pipes and baffle in the detection of steel pipe end anomalies. The image to be detected in this embodiment includes five steel pipes and one baffle.
[0036] In one embodiment of this application, an industrial camera can be used to capture the image to be inspected, and the camera angle can be adjusted so that both the steel pipe and the baffle are within the field of view. In this embodiment, image preprocessing can also be performed on the image to be inspected, including converting the color image to a grayscale image to reduce processing complexity, using a filter to remove noise, and converting the image to a black and white binary image for easier subsequent processing.
[0037] In one embodiment of this application, before obtaining the image of the steel pipe to be detected, the method further includes: obtaining historical steel pipe images, which include at least two steel pipes and at least one baffle; marking the coordinate positions of the steel pipes in the historical steel pipe images based on steel pipe labels, and marking the coordinate positions of the baffles in the historical steel pipe images based on baffle labels; establishing a training dataset based on the marked historical steel pipe images; and inputting the training dataset into a preset detection model to obtain a preset steel pipe detection model and a preset baffle detection model.
[0038] In one embodiment of this application, a clear historical image of steel pipes is obtained. The historical steel pipe image includes at least two steel pipes and one baffle. Data annotation is performed on the historical steel pipe image, that is, the coordinate position of each steel pipe and baffle in the image is marked to establish an image dataset. Based on the image dataset, a deep neural network steel pipe detection model and a baffle detection model are established, and the steel pipe detection model and the baffle detection model are trained respectively to obtain the final trained model.
[0039] Step S220: Input the image to be detected into the preset baffle detection model to obtain the baffle detection result. The baffle detection result includes the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame.
[0040] In one embodiment of this application, Figure 5 This is an exemplary embodiment of the present application illustrating the detection frame image of the steel pipe and baffle in the detection of steel pipe end-to-end anomalies. Figure 5 The two numbers in the upper left corner of the detection box represent the label and confidence level, respectively. Number 0 indicates a steel pipe label, and number 1 indicates a baffle label. Figure 5 As shown, five steel pipes were detected in this embodiment.
[0041] Step S230: Input the image of the steel pipe to be detected into the preset steel pipe detection model to obtain the steel pipe detection results of each steel pipe. The steel pipe detection results include the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame.
[0042] In one embodiment of this application, Figure 5 This is an exemplary embodiment of the present application illustrating the detection frame image of the steel pipe and baffle in the detection of steel pipe end-to-end anomalies. Figure 5 The two numbers in the upper left corner of the detection box represent the label and confidence level, respectively. Number 0 indicates a steel pipe label, and number 1 indicates a baffle label. Figure 5 As shown, a baffle was detected in this embodiment.
[0043] Step S240: Obtain the boundary range of the baffle based on the width, height and center coordinates of the baffle detection frame; obtain the center coordinates of the head of each steel pipe based on the width and center coordinates of the steel pipe detection frame.
[0044] In one embodiment of this application, obtaining the center coordinates of the steel pipe head of each steel pipe based on the width of the steel pipe inspection frame and the center coordinates of the steel pipe inspection frame includes:
[0045]
[0046] y i_hc =c i_y Equation (2)
[0047] In equations (1) and (2), x i_hc and y i_hc c represents the center coordinates of the steel pipe head. i_x and c i_y w represents the center coordinates of the steel pipe inspection frame for the i-th steel pipe. i This represents the width of the steel pipe inspection frame for the i-th steel pipe.
[0048] In one embodiment of this application, obtaining the baffle boundary range based on the baffle detection frame width, baffle detection frame height, and baffle detection frame center coordinates includes: obtaining the upper and lower boundary ranges of the baffle boundary range based on the baffle detection frame center coordinates and baffle detection height; and obtaining the left and right boundary ranges of the baffle boundary range based on the baffle detection frame center coordinates and baffle detection width.
[0049] In one embodiment of this application, the boundary range of the baffle is obtained based on the baffle detection frame width, the baffle detection frame height, and the center coordinates of the baffle detection frame, including:
[0050]
[0051]
[0052]
[0053]
[0054] In equations (3), (4), (5), and (6), y top Indicates the upper boundary of the baffle, y bottom x represents the lower boundary of the baffle. left x represents the left boundary of the baffle. right c represents the right boundary of the baffle. x and c y The coordinates of the center of the baffle detection frame are represented by w, the width of the baffle detection frame is represented by h, and the height of the baffle detection frame is represented by h.
[0055] Step S250: Obtain the straight line of the steel pipe center based on the fitting of the center coordinates of the steel pipe head of multiple steel pipes.
[0056] In one embodiment of this application, the process of fitting the center coordinates of the heads of multiple steel pipes to obtain a straight line for the center of the steel pipes includes: constructing a loss function based on the center coordinates of the heads of multiple steel pipes; solving the loss function to obtain the target slope and target intercept of the straight line for the center of the steel pipes; and obtaining the straight line for the center of the steel pipes based on the target slope and target intercept.
[0057] In one embodiment of this application, constructing a loss function based on the center coordinates of multiple steel pipe heads includes performing a straight line fitting using the least squares method, wherein the expression for the fitted straight line at the center point is:
[0058] y p =a+bx p Equation (7)
[0059] In equation (7), a and b represent the intercept and slope of the fitted line, respectively, and x p and y p Let x and y represent the x-axis and y-axis of the fitted line. The least squares method requires minimizing the sum of squared residuals between the predicted and observed values, i.e., minimizing the following loss function:
[0060]
[0061] In equation (8), x p and y p Represents the x-axis and y-axis on the fitted line, x i_hc and y i_hc Let represent the coordinates of the center of the head of the i-th steel pipe, and n represent the number of steel pipes.
[0062] The formulaic solution of the least squares method can be obtained by taking the partial derivatives of the loss function L(a,b) with respect to a and b respectively and setting them equal to zero:
[0063]
[0064]
[0065] In equations (9) and (10), and x represents the target intercept and target slope of fitted a and b, respectively. i_hc and y i_hc This represents the coordinates of the center of the head of the i-th steel pipe, and n represents the number of steel pipes. x represents i_hc The average value, Indicates y i_hc The average value.
[0066] In one embodiment of this application, Figure 6 This is an exemplary embodiment of the present application illustrating a straight line image of the center line of a steel pipe during steel pipe end-to-end anomaly detection, such as... Figure 6 As shown, Figure 6 The straight line in the figure is the fitted center line of the steel pipe in this embodiment.
[0067] Step S260: Obtain the collision state between the head of the steel pipe and the baffle based on the boundary range of the baffle and the center line of the steel pipe.
[0068] In one embodiment of this application, the collision state between the steel pipe head and the baffle based on the boundary range of the baffle and the center line of the steel pipe includes: obtaining the target slope of the center line of the steel pipe for multiple consecutive frames, and obtaining the average slope based on the target slope of the multiple frames; if the average slope is less than a preset slope threshold, then determining the intersection state between the center line of the steel pipe and the boundary range of the baffle; if the intersection state is intersection, then the collision state is collision.
[0069] In one embodiment of this application, obtaining the target slope of the center line of the steel pipe in multiple consecutive frames includes obtaining multiple consecutive frames of images of the steel pipe to be detected, and obtaining the target slope of the center line of the steel pipe in multiple consecutive frames based on the images of the steel pipe to be detected. In this embodiment, the multiple consecutive frames include the image of the steel pipe to be detected that is being detected and the two frames before and after the image.
[0070] In one embodiment of this application, determining the intersection state between the center line of the steel pipe and the boundary range of the baffle includes:
[0071] y1=a+bx left Equation (11)
[0072] y2=a+bx right Equation (12)
[0073]
[0074]
[0075] In equations (11), (12), (13), and (14), y top Indicates the upper boundary of the baffle, y bottom x represents the lower boundary of the baffle. left x represents the left boundary of the baffle. right The right boundary of the baffle is represented by , and a and b represent the intercept and slope of the fitted line, respectively.
[0076] In one embodiment of this application, if y1 is within the range, y top and y bottom Within, y2 is in the range y top and y bottom Within, x1 is in the range x left and x right Within, x2 is in the range x left and x right If any one of these four conditions is met, then the intersection state between the center line of the steel pipe and the boundary range of the baffle is determined to be an intersection.
[0077] Step S270: If the collision state is "collision has occurred", then the maximum offset of the center point is obtained based on the center coordinates of the steel pipe head and the straight line of the steel pipe center.
[0078] In one embodiment of this application, obtaining the maximum offset of the center point based on the center coordinates of the steel pipe head and the straight line of the steel pipe center includes: obtaining the point-to-line distance from the center of the steel pipe head to the straight line of the steel pipe center based on the center coordinates of the steel pipe head of each steel pipe; and taking the maximum value of the point-to-line distance as the maximum offset of the center point.
[0079] In one embodiment of this application, obtaining the maximum offset of the center point based on the center coordinates of the steel pipe head and the straight line of the steel pipe center includes:
[0080]
[0081] In equation (15), A, B, and C are all parameters of the straight line of the steel pipe center, (x i y i ) represents the center coordinates of the pipe head of each steel pipe, d max This represents the maximum offset of the center point.
[0082] Step S280: If the maximum offset of the center point exceeds the preset offset threshold, the detection result of the steel pipe image to be detected is abnormal.
[0083] In one embodiment of this application, if the maximum offset of the center point exceeds a preset offset threshold, and the detection result of the steel pipe image to be detected is abnormal, the method further includes: if the detection result is abnormal, triggering an alarm indicator to issue an alarm.
[0084] In one embodiment of this application, when the maximum offset of the center point is greater than the preset offset threshold T, the steel pipe is considered to be abnormally aligned, and the alarm indicator will sound an alarm.
[0085] In one embodiment of this application, when the detection result is abnormal, the system triggers an alarm indicator, which can be an audible and visual alarm device to immediately notify the operator or monitoring personnel that an abnormality has occurred. At the same time, it records the abnormality of this detection and related data (such as timestamps, the image to be detected that is abnormal, etc.) and saves the abnormal data in the abnormality log for subsequent analysis and investigation of the abnormality.
[0086] Please see Figure 3 , Figure 3 This is an exemplary embodiment of the present application illustrating a steel pipe end-alignment detection alarm flowchart, as follows: Figure 3As shown, the image of the steel pipe to be detected is input into the steel pipe detection model and the baffle detection model respectively. The steel pipe detection model obtains the coordinates of the center point of the steel pipe head. The center line of the steel pipe is obtained by fitting the center point of the steel pipe head center coordinates. The baffle detection model obtains the position coordinates of the baffle. Based on the steel pipe center line and the baffle position coordinates, it is determined whether the steel pipe and the baffle have collided. If no collision has occurred, the image detection result is normal. If a collision has occurred, the maximum offset of the center point is obtained based on the steel pipe head center coordinates and the steel pipe center line. If the maximum offset of the center point is greater than a preset threshold, the result of image detection abnormality is output and an alarm signal is output. If the maximum offset of the center point is less than or equal to the preset threshold, the image detection result is normal.
[0087] Please see Figure 7 , Figure 7 This is a block diagram illustrating an abnormal end-joint detection device for steel pipes, as shown in an exemplary embodiment of this application. The device can be applied to... Figure 1 The implementation environment shown can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0088] like Figure 7 As shown, the exemplary steel pipe end-alignment anomaly detection device includes an image acquisition module 701, a baffle detection module 702, a steel pipe detection module 703, a coordinate calculation module 704, a straight line calculation module 705, a collision judgment module 706, an offset calculation module 707, and an anomaly detection module 708.
[0089] Image acquisition module 701 is used to acquire an image of the steel pipe to be detected, the image of the steel pipe to be detected including at least two steel pipes and at least one baffle;
[0090] The baffle detection module 702 is used to input the image of the steel pipe to be detected into the preset baffle detection model to obtain the baffle detection result. The baffle detection result includes the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame.
[0091] The steel pipe detection module 703 is used to input the image of the steel pipe to be detected into the preset steel pipe detection model to obtain the steel pipe detection results of each steel pipe. The steel pipe detection results include the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame.
[0092] The coordinate calculation module 704 is used to obtain the boundary range of the baffle based on the width, height and center coordinates of the baffle detection frame, and to obtain the center coordinates of the head of each steel pipe based on the width and center coordinates of the steel pipe detection frame.
[0093] The straight line calculation module 705 is used to obtain the straight line of the steel pipe center based on the fitting of the center coordinates of the steel pipe head based on multiple steel pipes;
[0094] The collision determination module 706 is used to determine the collision state between the head of the steel pipe and the baffle based on the boundary range of the baffle and the center line of the steel pipe.
[0095] Offset calculation module 707 is used to obtain the maximum offset of the center point based on the center coordinates of the steel pipe head and the straight line of the steel pipe center if the collision state is already collided.
[0096] The anomaly detection module 708 is used to determine that the detection result of the steel pipe image to be detected is abnormal if the maximum offset of the center point exceeds a preset offset threshold.
[0097] Figure 8 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0098] like Figure 8 As shown, the computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 802 or programs loaded from storage portion 808 into Random Access Memory (RAM) 803, such as performing the methods described in the above embodiments. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.
[0099] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0100] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs various functions defined in the system of this application.
[0101] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0103] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0104] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the steel pipe end-trimming anomaly detection method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0105] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steel pipe end-joint anomaly detection method provided in the above embodiments.
[0106] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for detecting abnormal end-joint joints in steel pipes, characterized in that, The method includes: Obtain an image of the steel pipe to be inspected, wherein the image of the steel pipe to be inspected includes at least two steel pipes and at least one baffle; The image of the steel pipe to be detected is input into a preset baffle detection model to obtain the baffle detection result. The baffle detection result includes the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame. The image of the steel pipe to be detected is input into a preset steel pipe detection model to obtain the steel pipe detection results for each steel pipe. The steel pipe detection results include the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame. The boundary range of the baffle is obtained based on the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame; the center coordinates of the head of each steel pipe are obtained based on the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame. The straight line of the steel pipe center is obtained by fitting the center coordinates of the head of the steel pipes based on multiple steel pipes. The collision state between the steel pipe head and the baffle is determined based on the boundary range of the baffle and the center line of the steel pipe, including: obtaining the target slope of the center line of the steel pipe in multiple consecutive frames, and obtaining the average slope based on the target slope of the multiple frames; if the average slope is less than a preset slope threshold, the intersection state of the center line of the steel pipe and the boundary range of the baffle is determined; if the intersection state is intersection, the collision state is collision; wherein, obtaining the target slope of the center line of the steel pipe in multiple consecutive frames includes obtaining images of the steel pipe to be detected in multiple consecutive frames, and obtaining the target slope of the center line of the steel pipe in multiple consecutive frames based on the images of the steel pipe to be detected in multiple consecutive frames, wherein the multiple consecutive frames include the image of the steel pipe to be detected being detected and the two frames before and after the image; determining the intersection state of the center line of the steel pipe and the boundary range of the baffle includes: ; ; ; ;in, This indicates the upper boundary of the baffle. This indicates the lower boundary of the baffle. Indicates the left boundary of the baffle. Let represent the right boundary of the baffle, and a and b represent the intercept and slope of the fitted line, respectively; if Within the scope, and Inside, In scope and Inside, In scope and Inside, In scope and If any one of these four conditions is met, the intersection state between the center line of the steel pipe and the boundary range of the baffle is determined to be an intersection. If the collision state is a collision, the maximum offset of the center point is obtained based on the center coordinates of the steel pipe head and the straight line of the steel pipe center. If the maximum offset of the center point exceeds the preset offset threshold, the detection result of the steel pipe image to be detected is abnormal.
2. The method for detecting abnormal steel pipe end-to-end joints according to claim 1, characterized in that, Before acquiring the image of the steel pipe to be inspected, the following steps are also included: Acquire historical images of steel pipes, wherein the historical images of steel pipes include at least two steel pipes and at least one baffle; The coordinates of the steel pipes are marked in the historical steel pipe images based on the steel pipe labels, and the coordinates of the baffles are marked in the historical steel pipe images based on the baffle labels. A training dataset was created based on the labeled historical steel pipe images; The training dataset is input into the preset detection model to obtain the preset steel pipe detection model and the preset baffle detection model.
3. The method for detecting abnormal steel pipe end-to-end joints according to claim 1, characterized in that, The boundary range of the baffle, based on the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame, includes: The upper and lower boundary ranges of the baffle boundary range are obtained based on the center coordinates of the baffle detection frame and the baffle detection height. The left and right boundary ranges of the baffle boundary range are obtained based on the center coordinates of the baffle detection frame and the baffle detection width.
4. The method for detecting abnormal steel pipe end-to-end joints according to claim 1, characterized in that, The straight line at the center of the steel pipe is obtained by fitting the coordinates of the center of the head of the steel pipe based on multiple steel pipes, including: A loss function is constructed based on the coordinates of the center of the heads of the steel pipes. The target slope and target intercept of the straight line at the center of the steel pipe are obtained by solving the loss function. The center line of the steel pipe is obtained based on the target slope and the target intercept.
5. The method for detecting abnormal steel pipe end-to-end joints according to claim 3, characterized in that, The collision state between the steel pipe head and the baffle is obtained based on the boundary range of the baffle and the center line of the steel pipe, including: Obtain the target slope of the center line of the steel pipe in multiple consecutive frames, and obtain the average slope based on the target slope of the multiple frames; If the average slope is less than a preset slope threshold, then the intersection state of the center line of the steel pipe and the boundary range of the baffle is determined. If the intersection state is intersection, then the collision state is collision.
6. The method for detecting abnormal end-joint joints in steel pipes according to claim 1, characterized in that, The maximum offset of the center point is obtained based on the center coordinates of the steel pipe head and the straight line of the steel pipe centerline, including: The point-to-line distance from the center of the head of each steel pipe to the center of the steel pipe is obtained based on the center coordinates of the head of each steel pipe. The maximum value among the point-line distances is taken as the maximum offset of the center point.
7. The method for detecting abnormal steel pipe end-to-end joints according to claim 1, characterized in that, If the maximum offset of the center point exceeds a preset offset threshold, and the detection result of the steel pipe image to be detected is abnormal, the following steps are also included: If the detection result is abnormal, the alarm indicator will be triggered to sound an alarm.
8. A device for detecting abnormal end-joint joints in steel pipes, characterized in that, The steel pipe end-joint anomaly detection device includes: An image acquisition module is used to acquire an image of a steel pipe to be inspected, wherein the image of the steel pipe to be inspected includes at least two steel pipes and at least one baffle. The baffle detection module is used to input the image of the steel pipe to be detected into a preset baffle detection model to obtain the baffle detection result. The baffle detection result includes the width of the baffle detection frame, the height of the baffle detection frame, and the center coordinates of the baffle detection frame. The steel pipe detection module is used to input the image of the steel pipe to be detected into a preset steel pipe detection model to obtain the steel pipe detection results of each steel pipe. The steel pipe detection results include the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame. The coordinate calculation module is used to obtain the boundary range of the baffle based on the width of the baffle detection frame, the height of the baffle detection frame and the center coordinates of the baffle detection frame, and to obtain the center coordinates of the head of each steel pipe based on the width of the steel pipe detection frame and the center coordinates of the steel pipe detection frame. A straight line calculation module is used to fit the center coordinates of the steel pipe heads of multiple steel pipes to obtain a straight line at the center of the steel pipes. The collision determination module is used to determine the collision state between the steel pipe head and the baffle based on the boundary range of the baffle and the center line of the steel pipe. This includes: acquiring the target slope of the center line of the steel pipe for multiple consecutive frames, and obtaining an average slope based on the target slope of the multiple frames; if the average slope is less than a preset slope threshold, determining the intersection state between the center line of the steel pipe and the boundary range of the baffle; if the intersection state is intersection, then the collision state is collision. Acquiring the target slope of the center line of the steel pipe for multiple consecutive frames includes acquiring multiple consecutive frames of images of the steel pipe to be detected, and obtaining the target slope of the center line of the steel pipe for multiple consecutive frames based on the images of the steel pipe to be detected. The multiple consecutive frames include the image of the steel pipe to be detected being tested and the two frames preceding and following that image. Determining the intersection state between the center line of the steel pipe and the boundary range of the baffle includes: ; ; ; ;in, This indicates the upper boundary of the baffle. This indicates the lower boundary of the baffle. Indicates the left boundary of the baffle. Let represent the right boundary of the baffle, and a and b represent the intercept and slope of the fitted line, respectively; if Within the scope, and Inside, In scope and Inside, In scope and Inside, In scope and If any one of these four conditions is met, the intersection state between the center line of the steel pipe and the boundary range of the baffle is determined to be an intersection. The offset calculation module is used to obtain the maximum offset of the center point based on the center coordinates of the steel pipe head and the straight line of the steel pipe center if the collision state is a collision. An anomaly detection module is used to determine that the detection result of the steel pipe image to be detected is abnormal if the maximum offset of the center point exceeds a preset offset threshold.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the steel pipe end-joint anomaly detection method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by the computer's processor, causes the computer to perform the steel pipe end-joint anomaly detection method as described in any one of claims 1-7.
Citation Information
Patent Citations
Bar alignment detection method, system and device and medium
CN112053336A
Bar head alignment method and device
CN116912211A
