A method, device, equipment and medium for counting drill rods in coal mines with adaptive scenarios
Through rotating target detection and drill pipe counting inference algorithms, combined with historical and current video data, adaptive scene coal mine drill pipe counting is realized, solving the problems of low counting accuracy and efficiency in the existing technology, adapting to diverse scenarios and improving Improve the accuracy and efficiency of drill pipe counting.
Patent Information
- Application Number
- CN202410030225.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-01-09
AI Technical Summary
Existing drill pipe counting methods rely on fixed camera positions and buffer assistance, resulting in low counting accuracy and efficiency in practical applications, and are unable to adapt to diverse scenarios.
The rotating target detection algorithm and drill pipe counting inference algorithm are used to obtain historical downhole drilling videos for processing and annotation, build an adaptive scene rotating target detection model, identify the drill pipe information in the current video, filter the target drill pipe and calculate the drill pipe The distance between the key point of the rod and the center point of the impact power head is calculated by drawing a peak change graph.
It implements adaptive drill pipe counting that randomly changes camera positions and scenes without the need to draw buffers, improves counting accuracy and efficiency, and increases the diversity and applicability of scene applications.
Smart Images

Figure CN117830908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence deep learning technology, and in particular to a scenario-adaptive coal mine drill rod counting method, device, equipment and medium. Background Art
[0002] Most of the existing drill rod counting technologies are based on vision (i.e., target detection) drill rod counting methods. This type of method uses target detection (such as Yolov5) + DeepSort (object tracking) algorithms. The identified bounding box is a regular rectangular box. The specific counting method is: ① Counting with the help of two auxiliary "buffers". ② The counting method is that when the center point or a special point of the drill rod touches the "buffer" on the left during the process of the drill rod going in and out (and tracking the center point), the drill back count is +1, and when the center point touches the "buffer" on the right, the drill forward count is +1, and the counting is repeated in this way. However, this counting method has the following problems: ① The idea is simple, and only the collision between the center point of the drill rod and the "buffer zone" needs to be observed, without any mathematical formula or logic; ② Two "buffer zones" need to be drawn in advance. When drawing the "buffer zones", the code needs to be modified on the one hand, and the position of the movement of the center point of the drill rod needs to be observed on the other hand. The code needs to be modified according to the range of the movement position, thereby modifying the position of the "buffer zone"; when the position of the "buffer zone" is not drawn accurately, it is definitely not helpful for counting; ③ The biggest problem is that, because of the assistance of the "buffer zone", the position of the camera and the drilling rig must be fixed so that the counting can be accurate. However, the actual position of the camera and the drill rod can be changed at any time. When the camera is slightly moved, the "buffer zone" needs to be redrawn, which affects the accuracy of the counting.
[0003] It can be seen from the above that how to realize the adaptive scenario of coal mine drill rod counting, increase the diversity of scenario applications and the applicability of drill rod counting in practical applications, and improve the accuracy and efficiency of drill rod counting are problems to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a scenario-adaptive coal mine drill rod counting method, device, equipment and medium, which can realize scenario-adaptive coal mine drill rod counting, increase the diversity of scenario applications and the applicability of drill rod counting in practical applications, and improve the accuracy and efficiency of drill rod counting. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a scenario-adaptive coal mine drill rod counting method, comprising:
[0006] Obtaining historical downhole drilling videos, processing and annotating the historical downhole drilling videos to obtain annotated drilling data, and constructing a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data;
[0007] Acquire a current drilling video, and use the rotating target detection model to identify the current drilling video to obtain a recognition result;
[0008] Based on the drill rod counting inference algorithm and according to the preset drill rod selection principle, the identification result is screened to obtain the target drill rod, and the key points of the target drill rod and the center point of the impact power head are determined;
[0009] The distance between the key point of the target drill rod and the center point of the impact power head is calculated in real time, a peak value change diagram is drawn according to the distance, and the drill rod counting is performed using the peak value change diagram.
[0010] Optionally, the processing and labeling of the historical downhole drilling video to obtain labeled drilling data includes:
[0011] Dividing the historical downhole drilling video into pictures, and performing cleaning processing on each of the pictures to obtain the cleaned pictures;
[0012] The image after cleaning is annotated using a preset rotating target detection and annotation tool to obtain annotated drilling data.
[0013] Optionally, the rotating target detection model for adaptive scenarios is constructed based on the rotating target detection algorithm and using the annotated drilling data, including:
[0014] Based on the rotating target detection algorithm and using the annotated drilling data, the preset initial rotating target detection model is trained, tested and verified respectively to obtain the rotating target detection model for the adaptive scene; wherein the rotating target detection algorithm includes YOLOv5_OBB, YOLOv7_OBB, YOLOv8_OBB, GGHL, PP-YOLOE-R, R3Det and MMRotate algorithms.
[0015] Optionally, the using the rotating target detection model to identify the current drilling video to obtain a recognition result includes:
[0016] The current drilling video is identified by using the rotating target detection model to obtain the identification result with a rotating bounding box; the identification result includes the drill rig as a whole, the impact power head, the drill head, the drill rod and the corresponding center point coordinates, short side length, long side length, and rotation angle.
[0017] Optionally, the drill rod counting inference algorithm is used to screen the identification result according to a preset drill rod selection principle to obtain a target drill rod, including:
[0018] Constructing the drill rod selection principle; the drill rod selection principle includes a rotation bounding box selection principle, an occlusion exclusion selection principle and a focus drill rod selection principle;
[0019] Based on the drill rod counting inference algorithm and in accordance with the rotation bounding box selection principle, the occlusion exclusion selection principle and the focus drill rod selection principle, the recognition result with the rotation bounding box is screened for drill rods to obtain the target drill rods.
[0020] Optionally, determining the target drill rod key point and the impact power head center point includes:
[0021] Determine the current state of the target drill pipe; the state includes drilling in and drilling out;
[0022] Based on the state, the corresponding target drill rod key point and the impact power head center point are determined.
[0023] Optionally, the real-time calculation of the distance between the target drill rod key point and the center point of the impact power head, drawing a peak value change graph according to the distance, and using the peak value change graph to count the drill rods includes:
[0024] If the state is drilling, the drilling distance between the key point of the target drill rod and the center point of the impact power head is calculated according to a preset drilling distance calculation method, and a drilling peak change graph is drawn according to the drilling distance, and the drilling peak change graph is used to count the drill rods;
[0025] If the state is drill withdrawal, the drill withdrawal distance between the target drill rod key point and the center point of the impact power head is calculated according to the preset drill withdrawal distance calculation method, and a drill withdrawal peak change graph is drawn according to the drill withdrawal distance, and the drill rod counting is performed using the drill withdrawal peak change graph.
[0026] In a second aspect, the present application discloses a scene-adaptive coal mine drill rod counting device, comprising:
[0027] A model building module, used to obtain historical downhole drilling videos, process and annotate the historical downhole drilling videos to obtain annotated drilling data, and build a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data;
[0028] A recognition module, used for acquiring a current drilling video, and using the rotating target detection model to recognize the current drilling video to obtain a recognition result;
[0029] A drill rod screening module is used to screen the identification results based on the drill rod counting inference algorithm and according to the preset drill rod selection principle to obtain the target drill rod and determine the key points of the target drill rod and the center point of the impact power head;
[0030] The drill rod counting module is used to calculate the distance between the key point of the target drill rod and the center point of the impact power head in real time, draw a peak change diagram according to the distance, and use the peak change diagram to count the drill rods.
[0031] In a third aspect, the present application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] The processor is used to execute the computer program to implement the aforementioned scenario-adaptive coal mine drill rod counting method.
[0034] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for counting coal mine drill rods in an adaptive scenario are implemented.
[0035] It can be seen that the present application provides a method for counting drill rods in coal mines for adaptive scenarios, including obtaining historical underground drilling videos, processing and annotating the historical underground drilling videos to obtain annotated drilling data, and constructing a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data; obtaining a current drilling video, and identifying the current drilling video using the rotating target detection model to obtain an identification result; based on a drill rod counting inference algorithm and in accordance with a preset drill rod selection principle, performing drill rod screening on the identification result to obtain a target drill rod, and determining the key points of the target drill rod and the center point of the impact power head; calculating in real time the distance between the key points of the target drill rod and the center point of the impact power head, drawing a peak change graph based on the distance, and using the peak change graph to count drill rods. This application is based on a rotating target detection algorithm and uses annotated drilling data to build a rotating target detection model for adaptive scenarios, uses the rotating target detection model to identify the current drilling video, and screens out the target drill rod based on the drill rod counting inference algorithm, and calculates the distance change between the key point of the target drill rod and the center point of the impact power head to accurately obtain the peak change and perform drill rod counting. The above technical solution of this application does not require drawing a buffer zone, can switch the camera position at will, and can also randomly change the drilling scene, thereby realizing coal mine drill rod counting in adaptive scenarios, increasing the diversity of scene applications and the applicability of drill rod counting in practical applications, and combining the rotating target detection algorithm with the drill rod counting inference algorithm to improve the accuracy and efficiency of drill rod counting. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 A flow chart of a method for counting drill rods in a coal mine in an adaptive scenario disclosed in the present application;
[0038] Figure 2 This is an example diagram of drill rod screening and overall drill rod during drilling disclosed in the present application;
[0039] Figure 3 This is an example diagram of drill rod screening and overall drill rod during drill withdrawal disclosed in the present application;
[0040] Figure 4 This is an example diagram of a recognition result disclosed in this application;
[0041] Figure 5 (a)-(b) are example diagrams of key points of a target drill pipe during drilling disclosed in the present application;
[0042] Figure 6 This is an example diagram of the distribution of four corner coordinates of a target drill pipe disclosed in this application;
[0043] Figure 7 (a)-(b) are example diagrams of key points of a target drill rod during drill withdrawal disclosed in the present application;
[0044] Figure 8 This is an example diagram of peak value change disclosed in this application;
[0045] Fig. 9 A flow chart of a method for counting drill rods in a coal mine in an adaptive scenario disclosed in the present application;
[0046] Fig.10 A specific flow chart of drill rod counting disclosed in this application;
[0047] Fig.11 This is a schematic structural diagram of a coal mine drill rod counting device for an adaptive scenario disclosed in this application;
[0048] Fig.12 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments 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 creative work are within the scope of protection of the present invention.
[0050] Most of the existing drill rod counting technologies are based on vision (i.e., target detection) drill rod counting methods. This type of method uses target detection (such as Yolov5) + DeepSort (object tracking) algorithms. The identified bounding box is a regular rectangular box. The specific counting method is: ① Counting with the help of two auxiliary "buffers". ② The counting method is that when the center point or a special point of the drill rod touches the "buffer" on the left during the process of the drill rod going in and out (and tracking the center point), the drill back count is +1, and when the center point touches the "buffer" on the right, the drill forward count is +1, and the counting is repeated in this way. However, there are some problems with this counting method: ① The idea is simple, and only the collision between the center point of the drill rod and the "buffer zone" needs to be observed, without mathematical formulas and mathematical logic; ② Two blue "buffer zones" need to be drawn in advance. When drawing the "buffer zone", the code needs to be modified on the one hand, and the position of the drill rod center point needs to be observed on the other hand. The code needs to be modified according to the range of the movement position, thereby modifying the position of the "buffer zone"; when the position of the "buffer zone" is not drawn accurately, it is definitely not helpful for counting; ③ The biggest problem is that because of the "buffer zone" assistance, the position of the camera and the drill rig must be fixed so that the counting can be accurate. However, the actual position of the camera and the drill rod can be changed at any time. When the camera is slightly moved, the "buffer zone" needs to be redrawn, which affects the accuracy of the counting. As can be seen from the above, how to realize the adaptive scene counting of coal mine drill rods, increase the diversity of scene applications and the applicability of drill rod counting in practical applications, and improve the accuracy and efficiency of drill rod counting are problems to be solved in this field.
[0051] See also Figure 1 As shown, the embodiment of the present invention discloses a method for counting drill rods in a coal mine in an adaptive scenario, which may specifically include:
[0052] Step S11: Obtain historical downhole drilling videos, process and annotate the historical downhole drilling videos to obtain annotated drilling data, and construct a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data.
[0053] Step S12: obtaining a current drilling video, and using the rotating target detection model to identify the current drilling video to obtain a recognition result.
[0054] In this embodiment, the current drilling video is obtained, and the current drilling video is recognized using the rotating target detection model to obtain the recognition result with a rotating boundary box; the recognition result includes the drill rig as a whole, the impact power head, the drill head, the drill rod and the corresponding center point coordinates, short side length, long side length, and rotation angle.
[0055] Specifically, the rotating target detection model is used to detect and identify the current drilling video on site, and the recognition result with a rotating bounding box including the drilling rig information is identified in real time. The recognition information includes four objects: the drilling rig as a whole, the impact power head, the drill head, and the drill rod. At the same time, the center point coordinates, short side length, long side length, and rotation angle of the four objects are obtained.
[0056] Step S13: Based on the drill rod counting inference algorithm and in accordance with the preset drill rod selection principle, the identification result is subjected to drill rod screening to obtain the target drill rod, and the key points of the target drill rod and the center point of the impact power head are determined.
[0057] In this embodiment, the drill rod selection principle is constructed; the drill rod selection principle includes a rotating bounding box selection principle, an occlusion exclusion selection principle and a focus drill rod selection principle; based on the drill rod counting inference algorithm and in accordance with the rotating bounding box selection principle, the occlusion exclusion selection principle and the focus drill rod selection principle, the recognition result with the rotating bounding box is screened for drill rods to obtain a target drill rod, and the current state of the target drill rod is determined; the state includes drilling in and drilling out, and the corresponding target drill rod key points and the center point of the impact power head are determined based on the state.
[0058] In this embodiment, the drill rod screening is as follows Figure 2 As shown, get the entire body of the drilling rig ( Figure 2 The center point coordinates of the middle bounding box) and the four bounding boxes of top, bottom, left and right. For the left and right boundaries, select the x coordinate as the reference, take the left side as x_min, and the right side as x_max; for the upper and lower boundaries, select the y coordinate as the reference, take the lower side as y_min, and the upper side as y_max; then obtain the center point coordinates of the impact power head and draw a dot (such as Figure 2 The target drill rod is then determined. The present application determines the target drill rod according to the preset drill rod selection principle. The rotating target detection algorithm will identify all the drill rods in the video image. However, the present invention only cares about the drill rods that are helpful for counting. Other drill rods will be filtered out. Figure 2 The large dot on the left side is the key point of the target drill pipe.
[0059] The drill rod selection principle of the target drill rod is as follows: ① All drill rods outside the overall body frame of the drilling rig are excluded, such as Figure 3 Drill rods outside the frame (often many drill rods are placed on the ground, Figure 3The drill rod on the ground is not obvious in the picture, but there is a drill rod on the ground) needs to be excluded; ② The impact power head and the drill head (such as Figure 3 ③ The drill rod connected to the outside of the impact power head is selected as the drill rod concerned by the present invention, such as Figure 2 , Figure 3 The specific positions of the drilling rig as a whole, the drilling rod, the impact power head and the drilling rig head are as follows: Figure 4 shown.
[0060] The determination of the key points of the target drill pipe is divided into two situations: drilling in and drilling out. Figure 2 As shown, the drill back situation is as follows Figure 3 As shown in the figure, (1) Determination of the key point of the target drill pipe during drilling: When drilling, find the distance on the target drill pipe from the impact power head (such as Figure 4 The farthest point is taken as the target drill pipe key point. Figure 2 There are two situations: ① The target drill rod is on the left side of the impact power head. Figure 5 (a) As shown; ② The standard drill rod is on the right side of the impact power head, as shown Figure 5 (b) is shown. The specific description is as follows: ① The target drill rod is located on the left side of the impact power head. The coordinates of the four corners of the target drill rod are obtained. The ordinate values of the two leftmost points are selected and the middle point, i.e. (y1+y4) / 2, is the key point of the target drill rod. The difference in the horizontal coordinate distance between the key point of the target drill rod and the center point of the impact power head (i.e. Figure 5 (a) The difference between the horizontal coordinates x of the left and right dots in (a) is calculated as dist. ② The target drill rod is located on the right side of the impact power head. The coordinates of the four corners of the target drill rod are obtained. The vertical coordinate values of the two rightmost points are selected and the middle point is taken, i.e. (y2+y3) / 2, which is the key point of the target drill rod. The difference between the horizontal coordinate distances between the key point of the target drill rod and the center point of the impact power head (i.e. Figure 5 The difference in the horizontal coordinates x between the right and left dots in (b) is calculated as dist. The coordinates of the four points y1, y2, y3, and y4 are as follows: Figure 6 shown.
[0061] (2) Determination of the key point of the target drill rod when retracting the drill: When retracting the drill, find the distance on the target drill rod from the impact power head (such as Figure 4 The nearest point is taken as the target drill pipe key point. Figure 3 There are also two situations, namely, ① the target drill rod is on the left side of the impact power head, such as Figure 7 (a) As shown; ② The standard drill rod is on the right side of the impact power head, as shown Figure 7(b) is shown. The specific description is as follows: ① The target drill rod is located on the left side of the impact power head. The coordinates of the four corners of the target drill rod are obtained. The vertical coordinate values of the two rightmost points are selected and the middle point, i.e. (y2+y3) / 2, is the key point of the target drill rod. The difference in the horizontal coordinate distance between the key point of the target drill rod and the center point of the impact power head (i.e. Figure 7 (a) The difference between the horizontal coordinates x of the left and right dots in (a) is calculated as dist. ② The target drill rod is located on the right side of the impact power head. The coordinates of the four corners of the target drill rod are obtained. The vertical coordinate values of the two leftmost points are selected and the middle point is taken, i.e. (y1+y4) / 2, which is the key point of the target drill rod. The difference between the horizontal coordinate distances between the key point of the target drill rod and the center point of the impact power head (i.e. Figure 7 The difference in the horizontal coordinates x between the right and left dots in (b) is calculated as dist.
[0062] In this embodiment, the process of determining the target drill rod and the key points of the target drill rod is as follows: (1) When drilling: When the target drill rod is detected, the center point coordinates, current video frame number, and current timestamp corresponding to the drill rod are directly added to the array, which is defined outside the for loop of the overall data set, and the drill rods that meet the conditions are screened out for visualization of the mask; and a mask is generated on the target drill rod to determine the key points of the target drill rod. (2) When drilling back: When the target drill rod is detected, first determine whether the coordinate values of the key points of the target drill rod on the target drill rod are within the overall body frame of the drilling rig. If so, the center point coordinates, current video frame number, and current timestamp corresponding to the drill rod are added to the array, which is defined outside the for loop of the overall data set, and the drill rods that meet the conditions are screened out for visualization of the mask; and a mask is generated on the target drill rod to determine the key points of the target drill rod.
[0063] Step S14: Calculate the distance between the target drill rod key point and the center point of the impact power head in real time, draw a peak change graph according to the distance, and use the peak change graph to count the drill rods.
[0064] In this embodiment, if the state is drilling, the drilling distance between the target drill rod key point and the center point of the impact power head is calculated according to a preset drilling distance calculation method, and a drilling peak change graph is drawn according to the drilling distance, and the drill rod count is performed using the drilling peak change graph; if the state is drilling withdrawal, the drilling withdrawal distance between the target drill rod key point and the center point of the impact power head is calculated according to a preset drilling withdrawal distance calculation method, and a drilling withdrawal peak change graph is drawn according to the drilling withdrawal distance, and the drill rod count is performed using the drilling withdrawal peak change graph.
[0065] Specifically, the count is performed by the change in the distance between the target drill rod key point and the center point of the impact power head. Figure 8As shown in the figure, the horizontal axis is the number of video frames (25 frames per second), and the vertical axis is the change of the distance dist between the key point of the target drill rod and the center point of the impact power head with the number of frames. The distance dist is the difference between the key point of the target drill rod and the center point of the impact power head. The peak change of the distance dist is used to assist the drill rod counting. The process is as follows: Initialize a threshold threshold (the value of the threshold is set according to the actual situation). (1) Consider finding all peaks from the vertical axis: When the value of the distance dist between the key point of the target drill rod and the center point of the impact power head (i.e. Figure 8 (a point in the list) is higher than the threshold in the vertical coordinate of the point on the left or right, the point is recorded as the peak value peak. (2) Determine the effective peak value from the horizontal coordinate: filter the peak values found. Define two variables peak1 and peak2 to record the positions of the previous peak and the current peak respectively, and define a variable distance to calculate the distance between the two peaks. Only when the distance between the two peaks is greater than the distance (the value of the distance is set according to the actual situation), the position of the previous peak is added to the filtered list, and a drill rod count is completed; otherwise, when the distance between the two peaks is less than the distance, no count is performed and the peak value is discarded. (3) Continuous counting: loop through the above steps (1) and (2) in the array length composed of all peak values to continue counting the drill rod drilling until drilling stops. Both the advance count and the retreat count adopt the above calculation idea, the difference is that the selection of the two key points (the target drill rod key point and the center point of the impact power head) is different (such as Figure 5 and Figure 7 shown).
[0066] In this embodiment, historical downhole drilling videos are obtained, the historical downhole drilling videos are processed and labeled to obtain labeled drilling data, and a rotating target detection model for adaptive scenarios is constructed based on a rotating target detection algorithm and using the labeled drilling data; a current drilling video is obtained, and the current drilling video is identified using the rotating target detection model to obtain an identification result; based on a drill rod counting inference algorithm and in accordance with a preset drill rod selection principle, drill rod screening is performed on the identification result to obtain a target drill rod, and a target drill rod key point and an impact power head center point are determined; the distance between the target drill rod key point and the impact power head center point is calculated in real time, a peak change graph is plotted according to the distance, and drill rod counting is performed using the peak change graph. This application is based on a rotating target detection algorithm and uses annotated drilling data to build a rotating target detection model for adaptive scenarios, uses the rotating target detection model to identify the current drilling video, and screens out the target drill rod based on the drill rod counting inference algorithm, and calculates the distance change between the key point of the target drill rod and the center point of the impact power head to accurately obtain the peak change and perform drill rod counting. The above technical solution of this application does not require drawing a buffer zone, can switch the camera position at will, and can also randomly change the drilling scene, thereby realizing coal mine drill rod counting in adaptive scenarios, increasing the diversity of scene applications and the applicability of drill rod counting in practical applications, and combining the rotating target detection algorithm with the drill rod counting inference algorithm to improve the accuracy and efficiency of drill rod counting.
[0067] See also Fig. 9 As shown, the embodiment of the present invention discloses a method for counting drill rods in a coal mine in an adaptive scenario, which may specifically include:
[0068] Step S21: Obtain a historical downhole drilling video, divide the historical downhole drilling video into pictures, and clean each of the pictures to obtain the cleaned pictures, and use a preset rotating target detection and labeling tool to label the cleaned pictures to obtain labeled drilling data.
[0069] Step S22: Based on the rotating target detection algorithm and using the annotated drilling data, the preset initial rotating target detection model is trained, tested and verified respectively to obtain the rotating target detection model for the adaptive scene; wherein the rotating target detection algorithm includes YOLOv5_OBB, YOLOv7_OBB, YOLOv8_OBB, GGHL, PP-YOLOE-R, R3Det and MMRotate algorithms.
[0070] In this embodiment, the roLabelImg rotation target detection annotation tool is used to annotate the image; in addition, the rotation target detection algorithms include but are not limited to YOLOv5_OBB, YOLOv7_OBB, YOLOv8_OBB, GGHL, PP-YOLOE-R, R3Det and MMRotate.
[0071] Step S23: obtaining the current drilling video, and using the rotating target detection model to identify the current drilling video to obtain a recognition result.
[0072] Step S24: Based on the drill rod counting inference algorithm and in accordance with the preset drill rod selection principle, the identification result is subjected to drill rod screening to obtain the target drill rod, and the key points of the target drill rod and the center point of the impact power head are determined.
[0073] Step S25: Calculate the distance between the key point of the target drill rod and the center point of the impact power head in real time, draw a peak change graph according to the distance, and use the peak change graph to count the drill rods.
[0074] The specific process of this application is as follows Fig.10 As shown, (1) the current drilling video in the coal mine is obtained; (2) the current drilling video is recognized using the trained rotating target detection model to obtain a recognition result with a rotating bounding box; (3) based on the drill rod counting inference algorithm and according to the preset drill rod selection principle, the drill rods are screened on the recognition result to obtain the target drill rod, the key point of the target drill rod and the center point of the impact power head are determined, the distance between the key point of the target drill rod and the center point of the impact power head is calculated, the peak change diagram is drawn according to the distance, and the drill rod counting is performed using the peak change diagram.
[0075] The construction process of the rotating target detection model is as follows: (1) obtaining historical downhole drilling videos; (2) processing the historical downhole drilling videos and labeling them using the roLabelImg rotating target detection labeling tool to obtain labeled drilling data; (3) constructing a rotating target detection model for adaptive scenarios based on the rotating target detection algorithm and using the labeled drilling data.
[0076] In this embodiment, historical downhole drilling videos are obtained, the historical downhole drilling videos are processed and labeled to obtain labeled drilling data, and a rotating target detection model for adaptive scenarios is constructed based on a rotating target detection algorithm and using the labeled drilling data; a current drilling video is obtained, and the current drilling video is identified using the rotating target detection model to obtain an identification result; based on a drill rod counting inference algorithm and in accordance with a preset drill rod selection principle, drill rod screening is performed on the identification result to obtain a target drill rod, and a target drill rod key point and an impact power head center point are determined; the distance between the target drill rod key point and the impact power head center point is calculated in real time, a peak change graph is plotted according to the distance, and drill rod counting is performed using the peak change graph. This application is based on a rotating target detection algorithm and uses annotated drilling data to build a rotating target detection model for adaptive scenarios, uses the rotating target detection model to identify the current drilling video, and screens out the target drill rod based on the drill rod counting inference algorithm, and calculates the distance change between the key point of the target drill rod and the center point of the impact power head to accurately obtain the peak change and perform drill rod counting. The above technical solution of this application does not require drawing a buffer zone, can switch the camera position at will, and can also randomly change the drilling scene, thereby realizing coal mine drill rod counting in adaptive scenarios, increasing the diversity of scene applications and the applicability of drill rod counting in practical applications, and combining the rotating target detection algorithm with the drill rod counting inference algorithm to improve the accuracy and efficiency of drill rod counting.
[0077] See also Fig.11 As shown, the embodiment of the present invention discloses a scene-adaptive coal mine drill rod counting device, which may specifically include:
[0078] A model building module 11 is used to obtain historical downhole drilling videos, process and annotate the historical downhole drilling videos to obtain annotated drilling data, and build a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data;
[0079] The recognition module 12 is used to obtain the current drilling video and recognize the current drilling video using the rotating target detection model to obtain a recognition result;
[0080] A drill rod screening module 13 is used to screen the identification results based on the drill rod counting inference algorithm and according to the preset drill rod selection principle to obtain the target drill rod and determine the key points of the target drill rod and the center point of the impact power head;
[0081] The drill rod counting module 14 is used to calculate the distance between the target drill rod key point and the center point of the impact power head in real time, draw a peak change graph according to the distance, and use the peak change graph to count the drill rods.
[0082] In this embodiment, historical downhole drilling videos are obtained, the historical downhole drilling videos are processed and labeled to obtain labeled drilling data, and a rotating target detection model for adaptive scenarios is constructed based on a rotating target detection algorithm and using the labeled drilling data; a current drilling video is obtained, and the current drilling video is identified using the rotating target detection model to obtain an identification result; based on a drill rod counting inference algorithm and in accordance with a preset drill rod selection principle, drill rod screening is performed on the identification result to obtain a target drill rod, and a target drill rod key point and an impact power head center point are determined; the distance between the target drill rod key point and the impact power head center point is calculated in real time, a peak change graph is plotted according to the distance, and drill rod counting is performed using the peak change graph. This application is based on a rotating target detection algorithm and uses annotated drilling data to build a rotating target detection model for adaptive scenarios, uses the rotating target detection model to identify the current drilling video, and screens out the target drill rod based on the drill rod counting inference algorithm, and calculates the distance change between the key point of the target drill rod and the center point of the impact power head to accurately obtain the peak change and perform drill rod counting. The above technical solution of this application does not require drawing a buffer zone, can switch the camera position at will, and can also randomly change the drilling scene, thereby realizing coal mine drill rod counting in adaptive scenarios, increasing the diversity of scene applications and the applicability of drill rod counting in practical applications, and combining the rotating target detection algorithm with the drill rod counting inference algorithm to improve the accuracy and efficiency of drill rod counting.
[0083] In some specific embodiments, the model building module 11 may specifically include:
[0084] A cleaning processing module, used for dividing the historical downhole drilling video into pictures, and performing cleaning processing on each of the pictures to obtain the cleaned pictures;
[0085] The marking module is used to mark the image after cleaning by using a preset rotating target detection marking tool to obtain marked drilling data.
[0086] In some specific embodiments, the model building module 11 may specifically include:
[0087] A training, testing and verification module is used to train, test and verify the preset initial rotating target detection model based on the rotating target detection algorithm and using the labeled drilling data to obtain the rotating target detection model for the adaptive scene; wherein the rotating target detection algorithm includes YOLOv5_OBB, YOLOv7_OBB, YOLOv8_OBB, GGHL, PP-YOLOE-R, R3Det and MMRotate algorithms.
[0088] In some specific embodiments, the identification module 12 may specifically include:
[0089] The recognition module is used to use the rotating target detection model to recognize the current drilling video to obtain the recognition result with a rotating boundary box; the recognition result includes the drilling rig as a whole, the impact power head, the drilling rig head, the drilling rig drill rod and the corresponding center point coordinates, short side length, long side length, and rotation angle.
[0090] In some specific embodiments, the drill rod screening module 13 may specifically include:
[0091] A principle construction module, used to construct the drill rod selection principle; the drill rod selection principle includes a rotation bounding box selection principle, an occlusion exclusion selection principle and a focus drill rod selection principle;
[0092] The drill rod screening module is used to screen the recognition results with the rotating bounding box based on the drill rod counting inference algorithm and in accordance with the rotating bounding box selection principle, the occlusion exclusion selection principle and the focus drill rod selection principle to obtain the target drill rod.
[0093] In some specific embodiments, the drill rod screening module 13 may specifically include:
[0094] A state determination module, used to determine the current state of the target drill pipe; the state includes drilling in and drilling out;
[0095] The key point and center point determination module is used to determine the corresponding target drill rod key point and impact power head center point based on the state.
[0096] In some specific embodiments, the drill rod counting module 14 may specifically include:
[0097] A drilling rod counting module is used for calculating the drilling distance between the key point of the target drill rod and the center point of the impact power head according to a preset drilling distance calculation method if the state is drilling, and drawing a drilling peak value variation diagram according to the drilling distance, and using the drilling peak value variation diagram to count drill rods;
[0098] The drill rod withdrawal counting module is used to calculate the drill withdrawal distance between the target drill rod key point and the center point of the impact power head according to a preset drill withdrawal distance calculation method if the state is drill withdrawal, and draw a drill withdrawal peak change diagram according to the drill withdrawal distance, and use the drill withdrawal peak change diagram to count drill rods.
[0099] Fig.12A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for counting coal mine drill rods in an adaptive scenario performed by an electronic device disclosed in any of the aforementioned embodiments.
[0100] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0101] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0102] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the method of counting coal mine drill rods in an adaptive scenario performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to including data transmitted from an external device received by the adaptive scenario coal mine drill rod counting device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0103] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0104] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the method for counting coal mine drill rods in an adaptive scenario disclosed in any of the aforementioned embodiments are implemented.
[0105] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0106] The above is a detailed introduction to the method, device, equipment and storage medium for counting coal mine drill rods in an adaptive scenario provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A scenario-adaptive method for counting drill rods in a coal mine, characterized in that: include: Obtaining historical downhole drilling videos, processing and annotating the historical downhole drilling videos to obtain annotated drilling data, and constructing a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data; Acquire a current drilling video, and use the rotating target detection model to identify the current drilling video to obtain a recognition result; Based on the drill rod counting inference algorithm and according to the preset drill rod selection principle, the identification result is screened to obtain the target drill rod, and the key points of the target drill rod and the center point of the impact power head are determined; Calculate the distance between the key point of the target drill rod and the center point of the impact power head in real time, draw a peak change graph according to the distance, and use the peak change graph to count the drill rods; Wherein, the determining of the target drill rod key point and the impact power head center point includes: determining the current state of the target drill rod; the state includes drilling in and drilling out; determining the corresponding target drill rod key point and the impact power head center point based on the state; The real-time calculation of the distance between the key point of the target drill rod and the center point of the impact power head, drawing a peak change diagram according to the distance, and using the peak change diagram to count the drill rods includes: if the state is drilling, calculating the drilling distance between the key point of the target drill rod and the center point of the impact power head according to a preset drilling distance calculation method, drawing a drilling peak change diagram according to the drilling distance, and using the drilling peak change diagram to count the drill rods; the calculation of the drilling distance between the key point of the target drill rod and the center point of the impact power head according to the preset drilling distance calculation method is: calculating the target drill rod The difference between the horizontal coordinate distance between the key point and the center point of the impact power head is the drilling distance; if the state is drilling withdrawal, the drilling withdrawal distance between the key point of the target drill rod and the center point of the impact power head is calculated according to a preset drilling withdrawal distance calculation method, and a drilling withdrawal peak value change diagram is drawn according to the drilling withdrawal distance, and the drilling rod is counted using the drilling withdrawal peak value change diagram; the drilling withdrawal distance between the key point of the target drill rod and the center point of the impact power head is calculated according to the preset drilling withdrawal distance calculation method as follows: the difference between the horizontal coordinate distance between the key point of the target drill rod and the center point of the impact power head is calculated as the drilling withdrawal distance; Determining the key point of the target drill rod during drilling includes: when the target drill rod is on the left side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the ordinate values of the two leftmost points to take the middle point, which is the key point of the target drill rod; when the target drill rod is on the right side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the ordinate values of the two rightmost points to take the middle point, which is the key point of the target drill rod; The determination of the key point of the target drill rod when withdrawing the drill includes: when the target drill rod is on the left side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the longitudinal coordinate values of the two rightmost points and taking the middle point, which is the key point of the target drill rod; when the target drill rod is on the right side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the longitudinal coordinate values of the two leftmost points and taking the middle point, which is the key point of the target drill rod.
2. The scene-adaptive coal mine drill rod counting method according to claim 1, characterized in that: The processing and labeling of the historical downhole drilling video to obtain labeled drilling data includes: Dividing the historical downhole drilling video into pictures, and performing cleaning processing on each of the pictures to obtain the cleaned pictures; The image after cleaning is annotated using a preset rotating target detection and annotation tool to obtain annotated drilling data.
3. The scene-adaptive coal mine drill rod counting method according to claim 1, characterized in that: The method of constructing a rotating target detection model for an adaptive scenario based on a rotating target detection algorithm and using the annotated drilling data includes: Based on the rotating target detection algorithm and using the annotated drilling data, the preset initial rotating target detection model is trained, tested and verified respectively to obtain the rotating target detection model for the adaptive scene; wherein the rotating target detection algorithm includes YOLOv5_OBB, YOLOv7_OBB, YOLOv8_OBB, GGHL, PP-YOLOE-R, R3Det and MMRotate algorithms.
4. The scene-adaptive coal mine drill rod counting method according to any one of claims 1 to 3, characterized in that: The using the rotating target detection model to identify the current drilling video to obtain an identification result includes: The current drilling video is identified by using the rotating target detection model to obtain the identification result with a rotating bounding box; the identification result includes the drill rig as a whole, the impact power head, the drill head, the drill rod and the corresponding center point coordinates, short side length, long side length, and rotation angle.
5. The scene-adaptive coal mine drill rod counting method according to claim 4, characterized in that: The drill rod counting inference algorithm is used to screen the identification result according to a preset drill rod selection principle to obtain a target drill rod, including: Constructing the drill rod selection principle; the drill rod selection principle includes a rotation bounding box selection principle, an occlusion exclusion selection principle and a focus drill rod selection principle; Based on the drill rod counting inference algorithm and in accordance with the rotation bounding box selection principle, the occlusion exclusion selection principle and the focus drill rod selection principle, the recognition result with the rotation bounding box is screened for drill rods to obtain the target drill rods.
6. A scene-adaptive coal mine drill rod counting device, characterized in that: include: A model building module, used to obtain historical downhole drilling videos, process and annotate the historical downhole drilling videos to obtain annotated drilling data, and build a rotating target detection model for adaptive scenarios based on a rotating target detection algorithm and using the annotated drilling data; A recognition module, used for acquiring a current drilling video, and using the rotating target detection model to recognize the current drilling video to obtain a recognition result; A drill rod screening module is used to screen the identification results based on the drill rod counting inference algorithm and according to the preset drill rod selection principle to obtain the target drill rod and determine the key points of the target drill rod and the center point of the impact power head; A drill rod counting module is used to calculate the distance between the key point of the target drill rod and the center point of the impact power head in real time, draw a peak change graph according to the distance, and use the peak change graph to count the drill rods; Wherein, the determining of the target drill rod key point and the impact power head center point includes: determining the current state of the target drill rod; the state includes drilling in and drilling out; determining the corresponding target drill rod key point and the impact power head center point based on the state; The real-time calculation of the distance between the key point of the target drill rod and the center point of the impact power head, drawing a peak change diagram according to the distance, and using the peak change diagram to count the drill rods includes: if the state is drilling, calculating the drilling distance between the key point of the target drill rod and the center point of the impact power head according to a preset drilling distance calculation method, drawing a drilling peak change diagram according to the drilling distance, and using the drilling peak change diagram to count the drill rods; the calculation of the drilling distance between the key point of the target drill rod and the center point of the impact power head according to the preset drilling distance calculation method is: calculating the target drill rod The difference between the horizontal coordinate distance between the key point and the center point of the impact power head is the drilling distance; if the state is drilling withdrawal, the drilling withdrawal distance between the key point of the target drill rod and the center point of the impact power head is calculated according to a preset drilling withdrawal distance calculation method, and a drilling withdrawal peak value change diagram is drawn according to the drilling withdrawal distance, and the drilling rod is counted using the drilling withdrawal peak value change diagram; the drilling withdrawal distance between the key point of the target drill rod and the center point of the impact power head is calculated according to the preset drilling withdrawal distance calculation method as follows: the difference between the horizontal coordinate distance between the key point of the target drill rod and the center point of the impact power head is calculated as the drilling withdrawal distance; Determining the key point of the target drill rod during drilling includes: when the target drill rod is on the left side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the ordinate values of the two leftmost points to take the middle point, which is the key point of the target drill rod; when the target drill rod is on the right side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the ordinate values of the two rightmost points to take the middle point, which is the key point of the target drill rod; The determination of the key point of the target drill rod when withdrawing the drill includes: when the target drill rod is on the left side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the longitudinal coordinate values of the two rightmost points and taking the middle point, which is the key point of the target drill rod; when the target drill rod is on the right side of the impact power head, obtaining the coordinates of the four corners of the target drill rod, selecting the longitudinal coordinate values of the two leftmost points and taking the middle point, which is the key point of the target drill rod.
7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the scenario-adaptive coal mine drill rod counting method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the method for counting coal mine drill rods in an adaptive scenario as described in any one of claims 1 to 5 is implemented.
