Precise fitting method for drilling contour in complex environment

Through deep learning and edge detection technology, combined with the ellipse hybrid evaluation method, the problem of low drilling contour fitting accuracy in complex environments is solved, and the accuracy and robustness of drilling positioning in complex environments are achieved.

CN118570237AActive Publication Date: 2024-08-30INST OF ROCK & SOIL MECHANICS CHINESE ACAD OF SCI +1

Patent Information

Application Number
CN202410652956.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-08-30
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

In complex construction environments, traditional ellipse detection methods are difficult to accurately fit the contour of the drill hole, resulting in reduced drilling positioning accuracy and cannot be applied to complex environments.

Method used

The deep learning method is used to train the target detection model, and the edge detector and ellipse hybrid evaluation method are combined to accurately extract and fit the borehole contour ellipse through image preprocessing, target extraction, arc segment constraints and iterative fitting.

Benefits of technology

It achieves robust and accurate fitting of borehole contours in complex environments, improves the accuracy and reliability of borehole positioning, and is suitable for on-site construction environments such as tunnels and underground factories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570237A
    Figure CN118570237A
Patent Text Reader

Abstract

The invention provides an accurate fitting method for a drilling contour in a complex environment. The method comprises the following steps: S1, training a detection model to obtain a target detection model; s2, acquiring a to-be-detected image of a to-be-detected area of the drill hole through image acquisition equipment, and performing image preprocessing to obtain an initial to-be-processed image; s3, inputting the initial to-be-processed image into the target detection model, and extracting a borehole contour area image from the initial to-be-processed image; s4, extracting an initial drilling region arc segment group from the drilling contour region image; s5, screening out arc sections which do not meet constraint conditions in the arc section group of the initial drilling area, and then obtaining a potential drilling contour arc section group; s6, processing the potential drill hole contour arc segment group and the drill hole contour area image to obtain an initial ellipse; and S7, fitting according to the potential drilling contour arc segment group and the initial ellipse to obtain a drilling contour ellipse. According to the precise fitting method for the drilling contour in the complex environment, the elliptical contour of the drilling hole can be precisely fitted in the complex construction environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image data processing, and in particular relates to a method for accurately fitting drilling contours in complex environments. Background Art

[0002] In geological work, a borehole with a small diameter and a certain depth drilled underground by a drilling rig is usually called a borehole. Borehole measurement plays an extremely important role in borehole quality inspection, borehole orientation, mineral resource assessment, well construction engineering, etc. The typical construction cycle of a borehole can be summarized as a cycle of "layout-drilling-hole finding". Relying on large-scale mechanical equipment such as rock drilling rigs, layout and drilling can realize automated, safe and fast construction. However, for the positioning of the formed boreholes, except for the self-drilling and self-installation situation, it is generally still in the state of manual measurement of the hole, which seriously prolongs the construction cycle of the borehole and restricts the development of fully automatic construction of the borehole.

[0003] At present, the conventional ellipse detection methods such as voting (clustering) method, randomized Hough transform ellipse detection algorithm and arc segment based method are usually used in the prior art to automatically detect the borehole contour for positioning drilling, setting out and other operations. The objects they are facing are mostly daily life scenes. The contour of the ellipse to be detected in the edge image is clear and complete, and has a large difference from the background contour, so the accuracy is relatively low. However, due to the unknown number and position of the detection objects in the borehole contour image under complex construction conditions, the edge image also contains a large number of interference edges, and affected by the uneven surface of the tunnel lining, complex lighting conditions and image shooting quality, the focus of the borehole contour is often incomplete and mixed in the interference edge, which undoubtedly greatly increases the difficulty of detecting the borehole mouth contour, reduces the accuracy of the traditional ellipse detection method, and is not suitable for complex construction environments.

[0004] Therefore, how to provide a method for accurately fitting the drilling contour in a complex environment so as to accurately fit the elliptical contour of the drilling hole in a complex construction environment is a problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The technical problem to be solved by the present invention is that it is difficult to accurately fit the borehole mouth contour ellipse through the traditional ellipse detection method in complex construction environments such as tunnels and underground factories in the prior art.

[0006] In order to solve the above problems, the present invention provides a method for accurately fitting drilling contours in complex environments, including: S1 using a deep learning method to train a basic detection model to obtain a target detection model; S2 obtaining an image to be detected of a drilling area to be detected by an image acquisition device, and performing image preprocessing on the image to be detected to obtain an initial image to be processed; S3 inputting the initial image to be processed into the target detection model, and using a camera image drilling target fast extraction method to extract a drilling contour area image from the initial image to be processed; S4 using an edge detector to extract the drilling contour area image from the drilling contour area image An initial drilling area arc segment group; S5 performs concavity constraint, significance constraint, direction constraint and quadrant constraint on the initial drilling area arc segment group in turn, and obtains a potential drilling contour arc segment group after screening out the arc segments that do not meet the constraint conditions in the initial drilling area arc segment group; S6 uses an initial ellipse mixed evaluation method to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse; S7 uses the initial ellipse as the iterative initial value of the drilling contour ellipse, and uses a drilling contour iterative fitting method to fit the potential drilling contour arc segment group and the initial ellipse to obtain a drilling contour ellipse.

[0007] As a further technical solution of the present invention, in S1, the deep learning method is used to train the basic detection model to obtain the target detection model, including: S101 obtaining a number of learning images containing drilling holes from the target engineering area, performing image preprocessing on the several learning images to obtain a number of preprocessed images, marking the circumscribed rectangular frame of the drilling hole contour in each of the preprocessed images, forming a drilling contour image database through the several circumscribed rectangular frames, and splitting the drilling contour image database into a training database and a test database in proportion; S102 inputting the training database into the basic detection model, training the model network weights of the basic detection model, and using the test database to calculate the detection accuracy of the basic detection model to determine whether the detection accuracy reaches the preset value; S103 if yes, obtaining the target detection model; if not, repeating S102 until the detection accuracy reaches the preset value, and then obtaining the target detection model.

[0008] As a further technical solution of the present invention, in S3, the method for quickly extracting drilling targets using camera images to extract a drilling contour area image from the initial image to be processed includes: obtaining the length, width and center coordinates of a target rectangular box of the drilling contour in the initial image to be processed through the target detection model, taking the center coordinates of the target rectangular box as the center, and taking multiples of the length and width of the target rectangular box as the length and width of the drilling contour area, cutting out the drilling contour area from the initial image to be processed, and performing adaptive histogram balancing on the drilling contour area to obtain a drilling contour area image.

[0009] As a further technical solution of the present invention, in S4, the use of an edge detector to extract an initial drilling area arc segment group from the drilling contour area image includes: using an edge detector to obtain a number of edge points in the drilling contour area image, connecting the several edge points to obtain a number of edge arc segments, and combining the several edge arc segments to form the initial drilling area arc segment group; the edge detector includes a Canny edge detector or an EdgeDrawing edge detector.

[0010] As a further technical solution of the present invention, in S5, the initial drilling area arc segment group is subjected to concavity constraint, significance constraint, direction constraint and quadrant constraint in turn, and the arc segments that do not meet the constraint conditions in the initial drilling area arc segment group are screened out, and the potential drilling contour arc segment group is obtained, including: S501 calculates the class slope of each point in each edge arc segment in the initial drilling area arc segment group in order of points according to formula (1) and breaking each edge arc segment at a position where the sign of the class slope changes to obtain a plurality of new arc segments, and combining the plurality of new arc segments to form a new arc segment group;

[0011]

[0012] In the formula (1), is the class slope of the jth point of the i-th edge arc segment, is the X-axis coordinate of the j-th point of the i-th edge arc segment, is the Y-axis coordinate of the j-th point of the i-th edge arc segment, is the X-axis coordinate of the j+1th point of the i-th edge arc segment, is the Y-axis corresponding coordinate of the j+1th point of the ith edge arc segment; S502 applies the significance constraint, and after filtering out the new arc segments whose lengths are less than the first preset threshold in the new arc segment group, a significant arc segment group is obtained; S503 divides each of the new arc segments in the significant arc segment group into arc segments toward the center and arc segments away from the center according to formula (2), and filters out the arc segments away from the center in the significant arc segment group, so as to obtain a group of arc segments toward the center composed of a plurality of arc segments toward the center;

[0013]

[0014] In the formula (2), Ω i is the i-th new arc segment, Ω forward Towards the central arc segment, {Ω forward} is the arc segment group towards the center, Ω backward For the arc segment facing away from the center, {Ω backward} is the arc segment group facing away from the center, is the jth point of the i-th new arc segment, N0 is the second preset threshold, is a characteristic triangle formed by the starting point of the i-th new arc segment, the end point of the i-th new arc segment and the midpoint of the drilling contour area image as three corner points; S504 distinguishes a plurality of the arc segments toward the center in the arc segment group toward the center according to formula (3) to obtain a four-quadrant arc segment group;

[0015]

[0016] In the formula (3), {Ω1} is the arc segment group of the first quadrant, {Ω2} is the arc segment group of the second quadrant, {Ω3} is the arc segment group of the third quadrant, {Ω4} is the arc segment group of the fourth quadrant, U is the area of ​​the upper half of the circumscribed rectangle of each arc segment toward the center divided by the arc segment toward the center, and O is the area of ​​the lower half of the circumscribed rectangle of each arc segment toward the center divided by the arc segment toward the center; S505 removes the arc segment toward the center in the four-quadrant arc segment group that is not in the coordinate range of the corresponding quadrant, and obtains the potential drilling contour arc segment group.

[0017] As a further technical solution of the present invention, in S6, the initial ellipse hybrid evaluation method is used to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse, including: S601 selecting all edge points in the potential drilling contour arc segment group as valid edge points, and using the least squares method to perform ellipse fitting on the valid edge points, and obtaining the fitting ellipse rotation angle θ after fitting arc ; S602 selects an inclination angle from -90° to 90°, the slope of the inclination angle is k, draws a number of straight lines with slope k at equal intervals on the borehole contour area image, the several straight lines form a straight line group, takes out the pixel points on each straight line in the straight line group to form a corresponding survey line, and the several survey lines form a survey line group; S603 uses a threshold segmentation algorithm to divide all pixels in a survey line in the survey line group into dark-colored pixels and light-colored pixels, and calculates the slope k from the center of gravity of the dark-colored pixels to the center point of the borehole contour area image. m , and calculate the initial ellipse rotation angle θ according to formula (4) temp ;

[0018]

[0019] In the formula (4), H is the height of the target rectangular frame, W is the width of the target rectangular frame, α is the first auxiliary operator, β is the second auxiliary operator, k' is the correction slope, and n is the aspect ratio of the target rectangular frame; S604 repeats step S603 to calculate an initial ellipse rotation angle corresponding to each of the survey lines in the survey line group, and estimates the intermediate ellipse rotation angle θ corresponding to the survey line group from the initial ellipse rotation angles by an evaluation method. k ; S605 repeats steps S602 to S604 to obtain the rotation angle θ of several intermediate ellipses k The intermediate ellipse rotation angle group {θ k}, by evaluating the rotation angle θ from the fitted ellipse arc The rotation angle group {θ k} to evaluate and determine the final initial ellipse rotation angle θ init ; S606 Determine the semi-major axis length a of the initial ellipse according to formula (5) init and the semi-minor axis length b of the initial ellipse init , and taking the center point of the drilling contour area image as the center point of the initial ellipse to obtain the initial ellipse;

[0020]

[0021] As a further technical solution of the present invention, in S7, the drilling profile iterative fitting method is used to fit the drilling profile ellipse according to the potential drilling profile arc segment group and the initial ellipse, including: S701 calculates the algebraic distance d from each edge point in the potential drilling profile arc segment group to the initial ellipse according to formula (6): j , one edge point corresponds to one algebraic distance, a number of algebraic distances are sorted according to size, n edge points corresponding to n algebraic distances are selected in order from large to small, and n edge points are deleted from all edge points in the drilling profile arc segment group to obtain a number of remaining edge points, where n is m times the number of all edge points in the drilling profile arc segment group;

[0022]

[0023] In the formula (6), A, B, C, D, E, and F are the coefficients of any ellipse equation in the general formula of the ellipse respectively; S702 counts the number of the remaining edge points and determines whether the number of the remaining edge points is lower than a preset number threshold; if so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the ellipse is fitted using the least squares method, and the equivalent intersection-union ratio EIOU between the ellipse of the current i-th iteration and the ellipse of the i-1-th iteration is calculated according to formula (7). i,i-1 ;

[0024]

[0025] In the formula (7), is the area of ​​the intersection of the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration, The area of ​​the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration; judge EIOU i,i-1 Is it greater than the set convergence threshold? If so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the operations of S701 to S702 are performed again.

[0026] As a further technical solution of the present invention, the basic detection model includes a YOLO model or a FastRCNN model; the image preprocessing includes distortion correction, grayscale and adaptive histogram balance.

[0027] As a further technical solution of the present invention, the threshold segmentation algorithm includes K-means clustering algorithm or Otsu threshold segmentation algorithm; the evaluation method includes mean evaluation, mode evaluation or median evaluation.

[0028] As a further technical solution of the present invention, the minimum circumscribed rectangle of the ellipse of the wth iteration consists of four corner points {R w}Constraint, R w Obtained by formula (8);

[0029] R w ={(xcos(θ)-ysin(θ),xsin(θ)+ycos(θ))|x=±a,y=±b} (8);

[0030] Wherein, w is i or i-1; a is the length of the semi-major axis of the ellipse of the w-th iteration, b is the length of the semi-minor axis of the ellipse of the w-th iteration, and θ is the rotation angle of the ellipse of the w-th iteration.

[0031] Beneficial effect: The present invention proposes a method for accurately fitting drilling contours in complex environments. First, a deep learning method is used to train a basic detection model to obtain a target detection model. Then, an image acquisition device is used to obtain an image of the drilling area to be detected. The image preprocessing is performed on the image to be detected to obtain an initial image to be processed. The initial image to be processed is then input into the target detection model. A camera image drilling target fast extraction method is used to extract a drilling contour area image from the initial image to be processed, so as to achieve fast detection of drilling targets in the initial graphics to be processed through the target detection model. The target detection model based on deep learning has a high anti-interference effect. An edge detector is used to extract an initial drilling area arc segment group from the drilling contour area image. Then, the initial drilling area arc segment group is sequentially subjected to concavity constraints, significance constraints, direction constraints and quadrant constraints to screen out the initial drilling area. After eliminating the arc segments that do not meet the constraints in the regional arc segment group, that is, the noise arc segments, a potential borehole contour arc segment group is obtained, and then the initial ellipse mixed evaluation method is used to process the potential borehole contour arc segment group and the borehole contour regional image, and the noise arc segments are further eliminated to obtain an initial ellipse. Finally, the initial ellipse is used as the iterative initial value of the borehole contour ellipse, and the borehole contour ellipse is obtained by fitting the potential borehole contour arc segment group and the initial ellipse using the borehole contour iterative fitting method. By using relevant theories based on computer vision, the borehole contour ellipse in the borehole contour regional image is carefully and accurately fitted with an ellipse, which has high ellipse accuracy and is combined with deep learning. It can realize the robust fitting of the borehole contour in complex on-site construction environments such as tunnels and underground workshops, which is more reliable, accurate and stable, and only requires image acquisition equipment such as industrial cameras to achieve it, with low cost, fast operation and convenient deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 Flow chart of a method for accurately fitting a drilling profile in a complex environment according to an embodiment of the present invention;

[0034] Figure 2 It is the overall technical roadmap of the method for accurately fitting the drilling profile in a complex environment in an embodiment of the present invention;

[0035] Figure 3 is an initial image to be processed in the embodiment of the present invention;

[0036] Figure 4 A schematic diagram of a target rectangular frame in a method for quickly extracting drilling targets from camera images according to an embodiment of the present invention;

[0037] Figure 5 is a drilling contour area image in an embodiment of the present invention;

[0038] Figure 6 Schematic diagram of an arc segment group in an initial drilling area according to an embodiment of the present invention;

[0039] Figure 7 is a schematic diagram of a significant arc segment group in an embodiment of the present invention;

[0040] Figure 8 is a schematic diagram of a center-facing arc segment group according to an embodiment of the present invention;

[0041] Fig. 9 Schematic diagram of a potential drilling profile arc segment group in an embodiment of the present invention;

[0042] Fig.10 Schematic diagram of a survey line group and a midpoint of a survey line in an embodiment of the present invention;

[0043] Fig.11 Schematic diagram of equivalent intersection-union ratio in an embodiment of the present invention;

[0044] Fig.12 Schematic diagram of the fitting result of the drilling contour ellipse obtained by fitting in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] 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.

[0046] Example 1

[0047] like Figure 1As shown, the first embodiment provides a method for accurately fitting the drilling contour in a complex environment, including: S1 using a deep learning method to train a basic detection model to obtain a target detection model; S2 acquiring an image to be detected of a drilling area to be detected by an image acquisition device, and performing image preprocessing on the image to be detected to obtain an initial image to be processed; S3 inputting the initial image to be processed into the target detection model, and using a camera image drilling target fast extraction method to extract a drilling contour area image from the initial image to be processed; S4 using an edge detector to extract the initial drilling contour area image from the drilling contour area image Drilling area arc segment group; S5 performs concavity and convexity constraints, significance constraints, direction constraints and quadrant constraints on the initial drilling area arc segment group in turn, and obtains a potential drilling contour arc segment group after filtering out the arc segments that do not meet the constraints in the initial drilling area arc segment group; S6 uses the initial ellipse mixed evaluation method to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse; S7 uses the initial ellipse as the iterative initial value of the drilling contour ellipse, and uses the drilling contour iterative fitting method to fit the potential drilling contour arc segment group and the initial ellipse to obtain the drilling contour ellipse. Among them, the image acquisition device includes an industrial camera.

[0048] Specifically, the present invention proposes a method for accurately fitting drilling contours in complex environments. First, a deep learning method is used to train a basic detection model to obtain a target detection model. Then, an image to be detected of the drilling area to be detected is obtained through an image acquisition device, and the image to be detected is preprocessed to obtain an initial image to be processed. Then, the initial image to be processed is input into the target detection model. A camera image drilling target fast extraction method is used to extract a drilling contour area image from the initial image to be processed, so as to realize fast detection of drilling targets in the initial graphics to be processed through the target detection model. The target detection model based on deep learning has a high anti-interference effect. An edge detector is used to extract an initial drilling area arc segment group from the drilling contour area image, and then the initial drilling area arc segment group is sequentially subjected to concavity constraints, significance constraints, direction constraints and quadrant constraints to screen out the initial drilling area arc segment group. After eliminating the arc segments that do not meet the constraints in the initial drilling area arc segment group, that is, the noise arc segments, a potential drilling contour arc segment group is obtained, and then the initial ellipse mixed evaluation method is used to process the potential drilling contour arc segment group and the drilling contour area image, and the noise arc segments are further eliminated to obtain an initial ellipse. Finally, the initial ellipse is used as the iterative initial value of the drilling contour ellipse, and the drilling contour ellipse is obtained by fitting the potential drilling contour arc segment group and the initial ellipse using the drilling contour iterative fitting method. By using relevant theories based on computer vision, the drilling contour ellipse in the drilling contour area image is carefully and accurately fitted with an ellipse, which has high ellipse accuracy and is combined with deep learning. It can realize the robust fitting of drilling contours in complex on-site construction environments such as tunnels and underground workshops, which is more reliable, accurate and stable, and only requires image acquisition equipment such as industrial cameras to achieve it, with low cost, fast operation and convenient deployment.

[0049] In some possible implementations, in S1, the deep learning method is used to train the basic detection model to obtain the target detection model, including: S101 obtaining a number of learning images containing drilling holes from the target engineering area, performing image preprocessing on the several learning images to obtain a number of preprocessed images, manually marking the circumscribed rectangular frame of the drilling hole contour in each of the preprocessed images, forming a drilling contour image database through the several circumscribed rectangular frames, and splitting the drilling contour image database into a training database and a test database in proportion; S102 inputting the training database into the basic detection model, training the model network weights of the basic detection model, and using the test database to calculate the detection accuracy of the basic detection model to determine whether the detection accuracy reaches the preset value; S103 if yes, obtaining the target detection model; if not, repeating S102 until the detection accuracy reaches the preset value, and obtaining the target detection model.

[0050] This is because, by training the basic detection model through the training database and judging the detection accuracy of the basic detection model with the test database, the detection accuracy of the target detection model obtained after the basic detection model training can reach a certain value, and the drilling target can be correctly identified. The location of the drilling can be roughly marked for subsequent precise fitting based on machine vision.

[0051] In some possible implementations, in S3, the method for quickly extracting drilling targets using camera images to extract a drilling contour area image from the initial image to be processed includes: obtaining the length, width and center coordinates of a target rectangular box of the drilling contour in the initial image to be processed through the target detection model, taking the center coordinates of the target rectangular box as the center and taking multiples of the length and width of the target rectangular box as the length and width of the drilling contour area, cutting out the drilling contour area from the initial image to be processed, and performing adaptive histogram balancing on the drilling contour area to obtain a drilling contour area image.

[0052] Those skilled in the art can understand that the length, width and center coordinates of the target rectangular box of the drilling contour in the initial image to be processed are obtained through the target detection model, the center coordinates of the target rectangular box are taken as the center, and the length and width of the drilling contour area are multiples of the length and width of the target rectangular box. The drilling contour area is cut out from the initial image to be processed, and the drilling contour area is adaptively histogram balanced to lock the drilling target in the initial image to be processed, and an image of the drilling contour area containing the target drilling hole is obtained, thereby narrowing the processing range of the initial image to be processed, which is facilitating subsequent ellipse fitting.

[0053] In some possible implementations, in S4, the extracting the initial drilling area arc segment group from the drilling contour area image using an edge detector includes: acquiring a plurality of edge points in the drilling contour area image using an edge detector, connecting the plurality of edge points to obtain a plurality of edge arc segments, and combining the plurality of edge arc segments to form the initial drilling area arc segment group; the edge detector includes a Canny edge detector or an Edge Drawing edge detector.

[0054] Those skilled in the art can understand that an edge detector is used to obtain a number of edge points in the drilling contour area image, the several edge points are connected to obtain a number of edge arc segments, and the several edge arc segments are combined to form the initial drilling area arc segment group, which can be used to extract potential arc segments belonging to the drilling contour from the drilling contour area image.

[0055] In some possible implementations, in S5, the initial drilling area arc segment group is subjected to concavity constraints, significance constraints, direction constraints and quadrant constraints in sequence, and the arc segments that do not meet the constraints in the initial drilling area arc segment group are screened out to obtain the potential drilling contour arc segment group, including: S501 calculates the class slope of each point in each edge arc segment in the initial drilling area arc segment group in order of points according to formula (1) and breaking each edge arc segment at a position where the sign of the class slope changes to obtain a plurality of new arc segments, and combining the plurality of new arc segments to form a new arc segment group;

[0056]

[0057] In the formula (1), is the class slope of the jth point of the i-th edge segment, is the X-axis coordinate of the j-th point of the i-th edge arc segment, is the Y-axis coordinate of the j-th point of the i-th edge arc segment, is the X-axis coordinate of the j+1th point of the i-th edge arc segment, is the Y-axis corresponding coordinate of the j+1th point of the ith edge arc segment; S502 applies the significance constraint, and after filtering out the new arc segments whose lengths are less than the first preset threshold in the new arc segment group, a significant arc segment group is obtained; S503 divides each of the new arc segments in the significant arc segment group into arc segments toward the center and arc segments away from the center according to formula (2), and filters out the arc segments away from the center in the significant arc segment group, so as to obtain a group of arc segments toward the center composed of a plurality of arc segments toward the center;

[0058]

[0059] In the formula (2), Ω i is the i-th new arc segment, Ω forward Towards the central arc segment, {Ω forward} is the arc segment group towards the center, Ω backward For the arc segment facing away from the center, {Ω backward} is the arc segment group facing away from the center, is the jth point of the i-th new arc segment, N0 is the second preset threshold, is a characteristic triangle formed by the starting point of the i-th new arc segment, the end point of the i-th new arc segment and the midpoint of the drilling contour area image as three corner points; S504 distinguishes a plurality of the arc segments toward the center in the arc segment group toward the center according to formula (3) to obtain a four-quadrant arc segment group;

[0060]

[0061] In the formula (3), {Ω1} is the arc segment group of the first quadrant, {Ω2} is the arc segment group of the second quadrant, {Ω3} is the arc segment group of the third quadrant, {Ω4} is the arc segment group of the fourth quadrant, U is the area of ​​the upper half of the circumscribed rectangle of each arc segment toward the center divided by the arc segment toward the center, and O is the area of ​​the lower half of the circumscribed rectangle of each arc segment toward the center divided by the arc segment toward the center; S505 removes the arc segment toward the center in the four-quadrant arc segment group that is not in the coordinate range of the corresponding quadrant, and obtains the potential drilling contour arc segment group.

[0062] This is because the class slope calculated by formula (1) can avoid the problem of infinite value of the class slope shown in the following formula (9) in the calculation process; each new arc segment in the significant arc segment group obtained after the concave-convexity constraint and the significance constraint processing is a simple concave or simple convex arc segment with a certain length, so as to avoid the influence of the tortuosity of the new arc segment on the subsequent constraint calculation; the arc segment facing away from the center in the significant arc segment group is filtered out by the directional constraint, which is equivalent to adding a direction filter to the new arc segment, further narrowing the range of potential arc segments; the potential borehole contour arc segment group obtained by the above-mentioned concave-convexity constraint, significance constraint, directional constraint and quadrant constraint filters out most of the invalid noise arc segments, so that the remaining arc segments meet the basic requirements of the synthetic ellipse, which is conducive to the accurate fitting of the ellipse.

[0063]

[0064] In some possible implementations, in S6, the process of using the initial ellipse hybrid evaluation method to process the potential drilling profile arc segment group and the drilling profile area image to obtain an initial ellipse includes: S601 selecting all edge points in the potential drilling profile arc segment group as valid edge points, and performing ellipse fitting on the valid edge points using the least squares method, and obtaining the fitting ellipse rotation angle θ after fitting. arc ; S602 selects an inclination angle from -90° to 90°, the slope of the inclination angle is k, draws a number of straight lines with slope k at equal intervals on the borehole contour area image, the several straight lines form a straight line group, takes out the pixel points on each straight line in the straight line group to form a corresponding survey line, and the several survey lines form a survey line group; S603 uses a threshold segmentation algorithm to divide all pixels in a survey line in the survey line group into dark-colored pixels and light-colored pixels, and calculates the slope k from the center of gravity of the dark-colored pixels to the center point of the borehole contour area image. m , and calculate the initial ellipse rotation angle θ according to formula (4) temp ;

[0065]

[0066] In the formula (4), absmin() represents the angle with the smallest absolute value of the two angles, H is the height of the target rectangular frame, W is the width of the target rectangular frame; α is the first auxiliary operator, β is the second auxiliary operator, k' is the correction slope, and n is the aspect ratio of the target rectangular frame; S604 repeats step S603 to calculate an initial ellipse rotation angle corresponding to each of the survey lines in the survey line group, and evaluates the intermediate ellipse rotation angle θ corresponding to the survey line group from the initial ellipse rotation angles by an evaluation method. k ; S605 repeats steps S602 to S604 to obtain the rotation angle θ of several intermediate ellipses k The intermediate ellipse rotation angle group {θ k}, by evaluating the rotation angle θ from the fitted ellipse arc The rotation angle group {θ k} to evaluate and determine the final initial ellipse rotation angle θ init ; S606 Determine the semi-major axis length a of the initial ellipse according to formula (5) init and the semi-minor axis length b of the initial ellipse init , and taking the center point of the drilling contour area image as the center point of the initial ellipse to obtain the initial ellipse;

[0067]

[0068] In some possible implementations, in S7, the drilling profile iterative fitting method is used to fit the potential drilling profile arc segment group and the initial ellipse to obtain the drilling profile ellipse, including: S701 calculates the algebraic distance d from each edge point in the potential drilling profile arc segment group to the initial ellipse according to formula (6): j , one edge point corresponds to one algebraic distance, a number of algebraic distances are sorted according to size, n edge points corresponding to n algebraic distances are selected in order from large to small, and n edge points are deleted from all edge points in the drilling profile arc segment group to obtain a number of remaining edge points, where n is m times the number of all edge points in the drilling profile arc segment group;

[0069]

[0070] In the formula (6), A, B, C, D, E, and F are the coefficients of any ellipse equation in the general formula of the ellipse respectively; S702 counts the number of the remaining edge points and determines whether the number of the remaining edge points is lower than a preset number threshold; if so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the ellipse is fitted using the least squares method, and the equivalent intersection-union ratio EIOU between the ellipse of the current i-th iteration and the ellipse of the i-1-th iteration is calculated according to formula (7). i,i-1 ;

[0071]

[0072] In the formula (7), is the area of ​​the intersection of the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration, The area of ​​the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration; judge EIOU i,i-1 Is it greater than the set convergence threshold? If so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the operations of S701 to S702 are performed again.

[0073] This is because the above-mentioned initial ellipse mixed evaluation method and drilling profile iterative fitting method can further eliminate the noise arc segments in the potential drilling profile arc segment group and accurately fit the drilling profile ellipse.

[0074] In some possible implementations, the basic detection model includes a YOLO model or a Fast RCNN model; and the image preprocessing includes distortion correction, grayscale conversion, and adaptive histogram balancing.

[0075] In some possible implementations, the threshold segmentation algorithm includes a K-means clustering algorithm or an Otsu threshold segmentation algorithm; and the evaluation method includes a mean evaluation, a mode evaluation, or a median evaluation.

[0076] In some possible implementations, the minimum bounding rectangle of the ellipse at the wth iteration consists of four corner points {R w}Constraint, R w Obtained by formula (8);

[0077] R w ={(xcos(θ)-ysin(θ),xsin(θ)+ycos(θ))|x=±a,y=±b} (8);

[0078] Wherein, w is i or i-1; a is the length of the semi-major axis of the ellipse of the w-th iteration, b is the length of the semi-minor axis of the ellipse of the w-th iteration, and θ is the rotation angle of the ellipse of the w-th iteration.

[0079] Example 2

[0080] The second embodiment provides a method for accurately fitting a drilling profile in a complex environment, including:

[0081] S1 uses a deep learning method to train a basic detection model to obtain a target detection model; in S1, the use of a deep learning method to train a basic detection model to obtain a target detection model includes:

[0082] S101 relies on the on-site shooting device to obtain 290 learning images containing the borehole opening from the target engineering area, and performs image preprocessing of distortion correction, grayscale and adaptive histogram balancing on the 290 learning images in turn to obtain 290 preprocessed images, and manually marks the width, height, center pixel coordinates, etc. of the circumscribed rectangular box of the borehole opening contour in each of the preprocessed images. For example, the center pixel coordinates of the circumscribed rectangular box of the borehole opening contour in one of the preprocessed images are (1520.5, 486), the width of the circumscribed rectangular box is 289 pixels, and the height is 276 pixels, that is, the horizontal pixel range is: [1376, 1665], and the vertical pixel range is: [348, 624]; the 290 circumscribed rectangular boxes are used to form a borehole contour image database, and the borehole contour image database is randomly split into 203 images as a training database at a ratio of 7:3, and the remaining 86 images are used as a test database;

[0083] S102 inputs the training database into the YOLO V7 model, trains the model network weights of the YOLO V7 model, and uses the test database to calculate the detection accuracy of the YOLO V7 model to determine whether the detection accuracy reaches a preset value of 90%;

[0084] S103: If yes, the target detection model is obtained; if no, S102 is repeated until the detection accuracy reaches 90%, and the target detection model is obtained;

[0085] S2: acquiring an image to be detected of the area to be detected of the borehole through an image acquisition device, and performing image preprocessing of distortion correction, grayscale conversion, and adaptive histogram balancing on the image to be detected in sequence to obtain an initial image to be processed;

[0086] S3 inputs the initial image to be processed into the target detection model, and uses the camera image drilling target fast extraction method to extract the drilling contour area image from the initial image to be processed; in S3, the method of extracting the drilling contour area image from the initial image to be processed by using the camera image drilling target fast extraction method includes: the initial image to be processed is detected by the YOLO V7 model, and it is considered that there is a 90% probability that the initial image area to be processed is a drilling hole, and the center coordinates of the target rectangular box of the drilling contour in the initial image to be processed are obtained as (1520,492.5), the width of the target rectangular box is 284 pixels, and the height is 299 pixels, that is, the horizontal pixel range is: [1378,1662], and the vertical pixel range is: [343,642]. It can be found that the trained YOLO The V7 model can correctly identify the drilling target and roughly mark the location of the drilling for subsequent precise fitting based on machine vision; then, taking the center coordinates of the target rectangular frame as the center and the length and width of the target rectangular frame multipled by 1.1 as the length and width of the drilling contour area, the drilling contour area is cut out from the initial image to be processed. The center pixel coordinates of the drilling contour area are (1520, 492.5), the width is 312 pixels, and the height is 328 pixels. The drilling contour area is adaptively histogram balanced to obtain a drilling contour area image.

[0087] S4 uses an edge detector to extract an initial drilling area arc segment group from the drilling contour area image; in S4, the extracting the initial drilling area arc segment group from the drilling contour area image using an edge detector includes: using an EdgeDrawing edge detector to obtain a plurality of edge points in the drilling contour area image, connecting the plurality of edge points to obtain a plurality of edge arc segments, and combining the plurality of edge arc segments to form the initial drilling area arc segment group, such as Figure 3 As shown;

[0088] S5 sequentially performs concavity and convexity constraints, significance constraints, direction constraints and quadrant constraints on the initial drilling area arc segment group, and after filtering out the arc segments that do not meet the constraints in the initial drilling area arc segment group, a potential drilling contour arc segment group is obtained; In S5, the concavity and convexity constraints, significance constraints, direction constraints and quadrant constraints are sequentially performed on the initial drilling area arc segment group, and after filtering out the arc segments that do not meet the constraints in the initial drilling area arc segment group, a potential drilling contour arc segment group is obtained, which includes:

[0089] S501 applies the concavity constraint and calculates the class slope of each point in each edge arc segment in the initial drilling area arc segment group in order of points according to formula (1): Each edge arc segment is interrupted at the point where the positive and negative signs of the class slope change to obtain several new arc segments, and the several new arc segments are combined to form a new arc segment group; wherein, in a loose strategy, the influence of horizontal arc segments and vertical arc segments on the concavity is ignored in this embodiment, that is, when the class slope is 0, it is assumed that the edge arc segment is still continuous at this point.

[0090]

[0091] In the formula (1), is the class slope of the jth point of the i-th edge arc segment, is the X-axis coordinate of the j-th point of the i-th edge arc segment, is the Y-axis coordinate of the j-th point of the i-th edge arc segment, is the X-axis coordinate of the j+1th point of the i-th edge arc segment, The Y-axis coordinate of the j+1th point of the i-th edge arc segment;

[0092] S502 applies a saliency constraint to filter out the new arc segments whose lengths are less than a first preset threshold in the new arc segment group, thereby obtaining a saliency arc segment group, such as Figure 4 As shown, in this embodiment, the first preset threshold is the smaller value of 0.02 times the length of the drilling contour area image and 0.02 times the width of the drilling contour area image;

[0093] S503: Each of the new arc segments in the significant arc segment group is divided into arc segments facing toward the center and arc segments facing away from the center according to formula (2), and the arc segments facing away from the center in the significant arc segment group are screened out to obtain an arc segment group facing toward the center composed of a plurality of arc segments facing toward the center, such as: Figure 5 As shown, in this embodiment, the second preset threshold for determining the orientation is the same as the first preset threshold in the saliency constraint;

[0094]

[0095] In the formula (2), Ω i is the i-th new arc segment, Ω forward Towards the central arc segment, {Ω forward} is the arc segment group towards the center, Ω backward For the arc segment facing away from the center, {Ω backward} is the arc segment group facing away from the center, is the jth point of the i-th new arc segment, N0 is the second preset threshold, is a characteristic triangle formed by the starting point of the i-th new arc segment, the end point of the i-th new arc segment and the midpoint of the drilling contour area image as three corner points;

[0096] S504: according to formula (3), a plurality of arc segments facing the center in the arc segment group facing the center are distinguished to obtain a four-quadrant arc segment group;

[0097]

[0098] In the formula (3), {Ω1} is the arc segment group of the first quadrant, {Ω2} is the arc segment group of the second quadrant, {Ω3} is the arc segment group of the third quadrant, {Ω4} is the arc segment group of the fourth quadrant, U is the area of ​​the upper half of the circumscribed rectangle of each arc segment facing the center divided by the arc segment facing the center, and O is the area of ​​the lower half of the circumscribed rectangle of each arc segment facing the center divided by the arc segment facing the center;

[0099] S505: After removing the arc segments toward the center that are not in the coordinate range of the corresponding quadrant in the four-quadrant arc segment group, the potential drilling profile arc segment group is obtained. The quadrant coordinate range of the arc segment group in each quadrant of the four-quadrant arc segment group is set to 1.2 times the quadrant coordinate range. Figure 6 The figure shows the potential drilling contour arc segment group after quadrant constraint. It can be found that after the above-mentioned concavity constraint, saliency constraint, direction constraint and quadrant constraint, the final potential drilling contour arc segment group is the same as Figure 3 Compared with the initial drilling area arc segment group shown in FIG. 1 , most of the invalid noise arc segments have been filtered out, and the remaining arc segments meet the basic requirements of the synthetic ellipse.

[0100] S6 uses an initial ellipse hybrid evaluation method to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse; in S6, the use of the initial ellipse hybrid evaluation method to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse includes:

[0101] S601: All edge points in the potential drilling profile arc segment group are selected as valid edge points, and ellipse fitting is performed on the valid edge points using the least square method. After fitting, the fitting ellipse rotation angle θ is obtained. arc ;

[0102] S602: selecting an inclination angle from -90° to 90°, wherein the slope of the inclination angle is k, drawing a plurality of straight lines with the slope k at equal intervals on the borehole contour area image, wherein the plurality of straight lines form a straight line group, extracting pixel points on each straight line in the straight line group to form a corresponding measurement line, wherein the plurality of measurement lines form a measurement line group;

[0103] S603 uses a K-means clustering algorithm to classify all pixels in one of the survey lines in the survey line group into dark-colored pixels and light-colored pixels, and calculates a slope k from the centroid of the dark-colored pixels to the center point of the drilling contour area image.m , and calculate the initial ellipse rotation angle θ according to formula (4) temp ;

[0104]

[0105] In the formula (4), absmin() represents the angle with the smallest absolute value between the two angles, H is the height of the target rectangular frame, W is the width of the target rectangular frame, α is the first auxiliary operator, β is the second auxiliary operator, k' is the correction slope, and n is the aspect ratio of the target rectangular frame;

[0106] S604: Repeat step S603 to calculate an initial ellipse rotation angle corresponding to each of the survey lines in the survey line group, and evaluate the intermediate ellipse rotation angle θ corresponding to the survey line group from a plurality of the initial ellipse rotation angles by median evaluation, i.e., taking the median method. k ;

[0107] S605 repeats steps S602 to S604. In this embodiment, steps S602 to S604 are repeated six times, and the selected inclination angles are -60°, -30°, 0°, 30°, 60°, and 90°, respectively, to obtain a total of 6 angles of measuring line groups. Each measuring line group takes 5 measuring lines at equal intervals on the upper and lower (left and right) disks of the image along the measuring line axis, and obtains the six intermediate ellipse rotation angles θ. k The intermediate ellipse rotation angle group {θ k}, the rotation angle θ from the fitted ellipse is evaluated by the median arc The rotation angle group {θ k} to evaluate and determine the final initial ellipse rotation angle θ init , Figure 7 The figure shows the six survey line groups and the midpoints of the survey lines. It can be found that except for the midpoints of individual survey lines that are offset due to the influence of illumination, the midpoints of the chords of other survey lines are basically evaluated correctly.

[0108] S606 Determine the semi-major axis length a of the initial ellipse according to formula (5) init and the semi-minor axis length b of the initial ellipse init , and the center point of the drilling contour area image is used as the center point of the initial ellipse to obtain the initial ellipse; in this embodiment, the center pixel coordinates of the obtained initial ellipse are (159.0, 151.5), the long sleeve length and the short sleeve length are 289.2 and 275.7 pixels respectively, and the final initial ellipse rotation angle is 7.88°;

[0109]

[0110] S7 uses the initial ellipse as the iterative initial value of the drilling profile ellipse, and adopts a drilling profile iterative fitting method to fit the potential drilling profile arc segment group and the initial ellipse to obtain a drilling profile ellipse; In S7, adopting a drilling profile iterative fitting method to fit the potential drilling profile arc segment group and the initial ellipse to obtain a drilling profile ellipse includes:

[0111] S701 calculates the algebraic distance d from each edge point in the potential drilling profile arc segment group to the initial ellipse according to formula (6): j , one edge point corresponds to one algebraic distance, a number of algebraic distances are sorted according to size, n edge points corresponding to n algebraic distances are selected in order from large to small, and n edge points are deleted from all edge points in the drilling profile arc segment group to obtain a number of remaining edge points, where n is m times the number of all edge points in the drilling profile arc segment group, and m=0.4;

[0112]

[0113] In the formula (6), A, B, C, D, E, and F are coefficients of any ellipse equation in the general formula of the ellipse, respectively, and can be determined according to the long sleeve length, the short sleeve length, the center pixel coordinates, and the initial ellipse rotation angle;

[0114] S702 counts the number of the remaining edge points and determines whether the number of the remaining edge points is lower than a preset number threshold. In this embodiment, the number threshold is set to 20 points. If so, the ellipse of the current iteration is used as the drilling contour ellipse. If not, the ellipse is fitted using the least squares method, and the equivalent intersection-union ratio EIOU between the ellipse of the current i-th iteration and the ellipse of the i-1-th iteration is calculated according to formula (7). i,i-1 ;

[0115]

[0116] In the formula (7), is the area of ​​the intersection of the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration, is the area of ​​the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration; the minimum enclosing rectangle of the ellipse of the w-th iteration consists of four corner points {R w}Constraint, R w Obtained by formula (8);

[0117] R w ={(xcos(θ)-ysin(θ),xsin(θ)+ycos(θ))|x=±a,y=±b} (8);

[0118] Wherein, w is i or i-1; a is the length of the semi-major axis of the ellipse of the w-th iteration, b is the length of the semi-minor axis of the ellipse of the w-th iteration, and θ is the rotation angle of the ellipse of the w-th iteration.

[0119] Determining EIOU i,i-1 Is it greater than the set convergence threshold, the convergence threshold is set to 0.95, if so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, re-perform S701~S702 operations. In this embodiment, the pixel coordinates of the drilling center of the final drilling contour ellipse are (1518.5,484.6), the major axis length and the minor axis length are 282.1 and 266.4 respectively, and the rotation angle is 9.89°.

[0120] It can be found that the precise fitting method for drilling hole contours in complex environments provided by the present invention can accurately find the location of the drilling hole in complex environments such as tunnels, and thanks to the combination of deep learning methods and machine vision methods, the fitting results of the present invention are both highly robust and highly precise.

[0121] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

[0122] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A method for accurately fitting drilling profiles in complex environments, characterized in that: include: S1 uses deep learning method to train the basic detection model to obtain the target detection model; S2: acquiring an image to be detected of the area to be detected of the borehole through an image acquisition device, and performing image preprocessing on the image to be detected to obtain an initial image to be processed; S3: inputting the initial image to be processed into the target detection model, and extracting a drilling contour area image from the initial image to be processed using a camera image drilling target fast extraction method; S4 uses an edge detector to extract an initial drilling area arc segment group from the drilling contour area image; S5 sequentially performs concavity constraint, significance constraint, direction constraint and quadrant constraint on the initial drilling area arc segment group, and obtains a potential drilling contour arc segment group after filtering out arc segments that do not meet the constraint conditions in the initial drilling area arc segment group; S6 uses an initial ellipse hybrid evaluation method to process the potential drilling profile arc segment group and the drilling profile area image to obtain an initial ellipse; S7: taking the initial ellipse as the iterative initial value of the drilling contour ellipse, and adopting a drilling contour iterative fitting method to fit the potential drilling contour arc segment group and the initial ellipse to obtain a drilling contour ellipse.

2. The method for accurately fitting drilling profiles in complex environments according to claim 1, characterized in that: In S1, the basic detection model is trained by using a deep learning method to obtain a target detection model including: S101 acquires a plurality of learning images containing a borehole opening from a target engineering area, performs image preprocessing on the plurality of learning images to obtain a plurality of preprocessed images, marks an external rectangular frame of the borehole opening contour in each of the preprocessed images, forms a borehole contour image database through the plurality of external rectangular frames, and divides the borehole contour image database into a training database and a test database in proportion; S102: input the training database into the basic detection model, train the model network weight of the basic detection model, and use the test database to calculate the detection accuracy of the basic detection model to determine whether the detection accuracy reaches a preset value; If yes, then the target detection model is obtained in S103; if no, then S102 is repeated until the detection accuracy reaches the preset value, and then the target detection model is obtained.

3. The method for accurately fitting drilling profiles in complex environments according to claim 2, characterized in that: In S3, the method of extracting a drilling contour area image from the initial image to be processed by using a camera image drilling target fast extraction method includes: The target detection model is used to obtain the length, width and center coordinates of the target rectangular box of the drilling contour in the initial image to be processed. The center coordinates of the target rectangular box are taken as the center, and the length and width of the drilling contour area are multiples of the length and width of the target rectangular box. The drilling contour area is cut out from the initial image to be processed, and the drilling contour area is adaptively histogram balanced to obtain a drilling contour area image.

4. The method for accurately fitting drilling profiles in complex environments according to claim 3, characterized in that: In S4, extracting the initial drilling area arc segment group from the drilling contour area image using an edge detector includes: An edge detector is used to obtain a plurality of edge points in the drilling contour area image, a plurality of the edge points are connected to obtain a plurality of edge arc segments, and a plurality of the edge arc segments are combined to form the initial drilling area arc segment group; the edge detector includes a Canny edge detector or an Edge Drawing edge detector.

5. The method for accurately fitting drilling profiles in complex environments according to claim 4, characterized in that: In S5, the initial drilling area arc segment group is subjected to concavity constraint, significance constraint, direction constraint and quadrant constraint in sequence, and the arc segments that do not meet the constraint conditions in the initial drilling area arc segment group are screened out, and the potential drilling contour arc segment group is obtained, including: S501 calculates the class slope of each point in each edge arc segment in the initial drilling area arc segment group in order of points according to formula (1) and breaking each edge arc segment at a position where the sign of the class slope changes to obtain a plurality of new arc segments, and combining the plurality of new arc segments to form a new arc segment group; In the formula (1), is the class slope of the jth point of the i-th edge arc segment, is the X-axis coordinate of the j-th point of the i-th edge arc segment, is the Y-axis coordinate of the j-th point of the i-th edge arc segment, is the X-axis coordinate of the j+1th point of the i-th edge arc segment, The Y-axis coordinate of the j+1th point of the i-th edge arc segment; S502 applies a significance constraint to filter out the new arc segments whose lengths are less than a first preset threshold in the new arc segment group, thereby obtaining a significant arc segment group; S503: each of the new arc segments in the significant arc segment group is divided into an arc segment facing toward the center and an arc segment facing away from the center according to formula (2), and the arc segment facing away from the center in the significant arc segment group is filtered out to obtain an arc segment group facing toward the center consisting of a plurality of arc segments facing toward the center; In the formula (2), Ω i is the i-th new arc segment, Ω forward Towards the central arc segment, {Ω forward } is the arc segment group towards the center, Ω backward For the arc segment facing away from the center, {Ω backward } is the arc segment group facing away from the center, is the jth point of the i-th new arc segment, N0 is the second preset threshold, is a characteristic triangle formed by the starting point of the i-th new arc segment, the end point of the i-th new arc segment and the midpoint of the drilling contour area image as three corner points; S504: according to formula (3), a plurality of arc segments facing the center in the arc segment group facing the center are distinguished to obtain a four-quadrant arc segment group; In the formula (3), {Ω1} is the arc segment group of the first quadrant, {Ω2} is the arc segment group of the second quadrant, {Ω3} is the arc segment group of the third quadrant, {Ω4} is the arc segment group of the fourth quadrant, U is the area of ​​the upper half of the circumscribed rectangle of each arc segment facing the center divided by the arc segment facing the center, and O is the area of ​​the lower half of the circumscribed rectangle of each arc segment facing the center divided by the arc segment facing the center; S505: After filtering out the arc segments facing the center that are not within the coordinate range of the corresponding quadrant in the four-quadrant arc segment group, the potential drilling contour arc segment group is obtained.

6. The method for accurately fitting drilling profiles in complex environments according to claim 5, characterized in that: In S6, the initial ellipse hybrid evaluation method is used to process the potential drilling contour arc segment group and the drilling contour area image to obtain an initial ellipse, including: S601: All edge points in the potential drilling profile arc segment group are selected as valid edge points, and ellipse fitting is performed on the valid edge points using the least square method. After fitting, the fitting ellipse rotation angle θ is obtained. arc ; S602: selecting an inclination angle from -90° to 90°, wherein the slope of the inclination angle is k, drawing a plurality of straight lines with the slope k at equal intervals on the borehole contour area image, wherein the plurality of straight lines form a straight line group, extracting pixel points on each straight line in the straight line group to form a corresponding measurement line, wherein the plurality of measurement lines form a measurement line group; S603 uses a threshold segmentation algorithm to divide all pixels in one of the survey lines in the survey line group into dark-colored pixels and light-colored pixels, and calculates the slope k from the centroid of the dark-colored pixels to the center point of the drilling contour area image. m , and calculate the initial ellipse rotation angle θ according to formula (4) temp ; In the formula (4), H is the height of the target rectangular box, W is the width of the target rectangular box, α is the first auxiliary operator, β is the second auxiliary operator, k is the correction slope, and n is the aspect ratio of the target rectangular box; S604: Repeat step S603 to calculate an initial ellipse rotation angle corresponding to each of the survey lines in the survey line group, and evaluate the intermediate ellipse rotation angle θ corresponding to the survey line group from a plurality of the initial ellipse rotation angles by an evaluation method. k ; S605 Repeat steps S602 to S604 to obtain the rotation angle θ of several intermediate ellipses. k The intermediate ellipse rotation angle group {θ k }, by evaluating the rotation angle θ from the fitted ellipse arc The rotation angle group {θ k } to evaluate and determine the final initial ellipse rotation angle θ init ; S606 Determine the semi-major axis length a of the initial ellipse according to formula (5) init and the semi-minor axis length b of the initial ellipse init , and taking the center point of the drilling contour area image as the center point of the initial ellipse to obtain the initial ellipse; 7. The method for accurately fitting drilling profiles in complex environments according to claim 6, characterized in that: In S7, the drilling profile iterative fitting method is used to fit the potential drilling profile arc segment group and the initial ellipse to obtain the drilling profile ellipse, which includes: S701 calculates the algebraic distance d from each edge point in the potential drilling profile arc segment group to the initial ellipse according to formula (6): j , one edge point corresponds to one algebraic distance, a number of algebraic distances are sorted according to size, n edge points corresponding to n algebraic distances are selected in order from large to small, and n edge points are deleted from all edge points in the drilling profile arc segment group to obtain a number of remaining edge points, where n is m times the number of all edge points in the drilling profile arc segment group; In the formula (6), A, B, C, D, E, and F are coefficients of any ellipse equation in the general formula of the ellipse; S702 counts the number of the remaining edge points and determines whether the number of the remaining edge points is lower than a preset number threshold; if so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the ellipse is fitted using the least squares method, and the equivalent intersection-union ratio EIOU between the ellipse of the current i-th iteration and the ellipse of the i-1-th iteration is calculated according to formula (7): i,i-1 ; In the formula (7), is the area of ​​the intersection of the minimum enclosing rectangle of the ellipse of the i-th iteration and the minimum enclosing rectangle of the ellipse of the i-1-th iteration, is the area of ​​the minimum circumscribed rectangle of the ellipse of the i-th iteration and the minimum circumscribed rectangle of the ellipse of the i-1-th iteration; Determining EIOU i,i-1 Is it greater than the set convergence threshold? If so, the ellipse of the current iteration is used as the drilling contour ellipse; if not, the operations of S701 to S702 are performed again.

8. The method for accurately fitting drilling profiles in complex environments according to claim 7, characterized in that: The basic detection model includes a YOLO model or a Fast RCNN model; The image preprocessing includes distortion correction, grayscale conversion and adaptive histogram balancing.

9. The method for accurately fitting drilling profiles in complex environments according to claim 8, characterized in that: The threshold segmentation algorithm includes a K-means clustering algorithm or an Otsu threshold segmentation algorithm; The evaluation method includes mean evaluation, mode evaluation or median evaluation.

10. The method for accurate fitting of drilling profile in complex environment according to claim 9, characterized in that: The minimum enclosing rectangle of the ellipse at the wth iteration consists of four corner points {R w }Constraint, R w Obtained by formula (8); R w ={(xcos(θ)-ysin(θ),xsin(θ)+ycos(θ))|x=±a,y=±b} (8); Wherein, w is i or i-1; a is the length of the semi-major axis of the ellipse of the w-th iteration, b is the length of the semi-minor axis of the ellipse of the w-th iteration, and θ is the rotation angle of the ellipse of the w-th iteration.

Citation Information

Patent Citations

  • Object shooting image ellipse detection algorithm based on Marklaurin theorem constraint

    CN113962967A

  • Spacer-free high-voltage transmission line galloping early warning method in night vision scene

    CN116453034A

  • Indoor personnel real-time distribution monitoring method based on region segmentation

    CN117132942A

  • Method for automatic segmentation of fuzzy boundary image based on active contour and deep learning

    US20220414891A1

Cited By

  • Image annotation method and device, equipment and medium

    CN119580262A