UNDISTORTED OUTSPREAD METHOD FOR ANNULAR IMAGES OF THE INNER WALL OF BOREHOLE WITH A CENTER OFFSET

20240209725 ยท 2024-06-27

Assignee

Inventors

Cpc classification

International classification

Abstract

An undistorted outspread method for annular images of the inner wall of borehole with a center offset is provided. The undistorted outspread method includes putting a camera into a hole and pushing the camera inward to carry out a video acquisition; selecting two frames of images from the video obtained; adjusting axis angle 2 in FIG. 2 to the same angle as axis angle 1 in FIG. 1; adjusting axis angle 1 and adjusted axis angle 2 in S2 until the angle is zero; calculating a radius ratio of motion 1 according to adjusted FIG. 1 and FIG. 2, and similarly, obtaining radius ratio of motion 2; obtaining radius ratio of axis distance 1, and similarly, obtaining radius ratio of axis distance 2; correcting radius ratio of axis distance 1 and radius ratio of axis distance 2; outspreading the undistorted image to obtain an undistorted outspread image.

Claims

1. An undistorted outspread method for annular images of the inner wall of borehole with a center offset, comprising S1, putting a camera into a hole and pushing the camera inward to carry out a video acquisition; S2, selecting two frames of images from the video obtained from S1, namely a FIG. 1 and a FIG. 2; adjusting an axis angle 2 in the FIG. 2 to the same angle as an axis angle 1 in the FIG. 1 to obtain an adjusted axis angle 2; S3, adjusting the axis angle 1 and an adjusted axis angle 2 in S2 until an angle is zero; S4, calculating a radius ratio of motion 1 according to adjusted FIG. 1 and FIG. 2 in S3, and similarly, obtaining a radius ratio of motion 2; S5, obtaining a radius ratio of axis distance 1 according to the radius ratio of motion 1 in S4, and similarly, obtaining a radius ratio of axis distance 2; S6, correcting the FIG. 1 and the FIG. 2 to obtain a FIG. 3 and a FIG. 4 according to the calculation of the radius ratio of axis distance 1 and the radius ratio of axis distance 2 in S5; S7, matching the FIG. 3 in S6 along with the FIG. 1 and matching the FIG. 4 in S6 along with the FIG. 2 to obtain a corrected undistorted image; and S8, outspreading the undistorted image in S7 to obtain an undistorted outspread image according to a polar coordinate formula.

2. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in S2, if the angle of the axis angle 2 is different from the angle of the axis angle 1, obtaining a phase angle diagram 1 from the FIG. 1 and the FIG. 2, and a phase angle difference obtained from a phase angle 1 and a phase angle 2 in the phase angle diagram 1 is equal to an axis angle difference, and rotating the FIG. 2 according to the axis angle difference.

3. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in S3, if the axis angle 1 and the axis angle 2 are not zero, obtaining a phase angle diagram 2 from the FIG. 1 and the rotated FIG. 2, when all trajectory lines in the phase angle diagram 2 intersect, a point with the most trajectory lines is a control point, and obtaining a detection circle 1 when using the control point as a center; obtaining an axis angle 3 from two points with the largest pixel gray value on the detection circle 1, and rotating the FIG. 1 and the rotated FIG. 2 according to the axis angle 3.

4. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in S4, selecting any point in the FIG. 1 after rotation and calculating a radius ratio of motion of this point; calculating a radius ratio diagram of motion 1 from a radius ratio of motion calculated by all points in the FIG. 1 after rotation, and similarly, obtaining a radius ratio diagram of motion 2.

5. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in S5, selecting points with the same pixel gray value in a radius ratio diagram of motion 1 and a radius ratio diagram of motion 2 to obtaining a ring 1 and a ring 2, obtaining the radius ratio of axis distance 1 according to a center and radius of the ring 1, and similarly, obtaining the radius ratio of axis distance 2.

6. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in S6, obtaining a corrected radius 1 and angle 1 according to a radius ratio diagram of motion 1 and a radius ratio diagram of motion 2, and obtaining a corrected FIG. 3 and FIG. 4 from the angle 1 and the radius 1.

7. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein the FIG. 1 and the FIG. 2 both take an image center as an origin, an x-axis is a straight line from the origin to the right, an axis angle is an angle between the x-axis and a line connecting the image center and a hole center, an offset axis is a connection between the image center and the hole center, and a length of the offset axis is an axis distance.

8. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 4, wherein the radius ratio of motion 1 is a ratio of a distance from the point to a control point in the FIG. 1 after rotation to a distance from an endpoint of a motion trajectory to the control point.

9. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 5, wherein the radius ratio of axis distance 1 is a ratio of the radius to a distance from a center of a circle to a center of the image.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG. 1 is a flow chart of the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0041] FIG. 2 is a schematic diagram of FIG. 1 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0042] FIG. 3 is the schematic diagram of FIG. 2 in the undistorted outspread method of the annular images of the inner wall of the borehole with center offset.

[0043] FIG. 4 is a schematic diagram of field 1-2 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0044] FIG. 5 is a schematic diagram of phase angle 1 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0045] FIG. 6 is a schematic diagram of a modular length graph in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0046] FIG. 7 is a schematic diagram of rotated FIG. 2 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0047] FIG. 8 is a schematic diagram of corrected FIG. 3 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0048] FIG. 9 is a calculation diagram in S6 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0049] FIG. 10 is a calculation diagram in S6 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

[0050] FIG. 11 is a calculation diagram in S8 in the undistorted outspread method for annular images of the inner wall of borehole with a center offset.

DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] The following is a further explanation of the technical solution of the invention through drawings and an embodiment.

[0052] Unless otherwise defined, the technical terms or scientific terms used in the invention should be understood by people with general skills in the field to which the invention belongs. first, second, and similar words used in the invention do not mean any order, quantity or importance, but are only used to distinguish different components. Similar words such as include or comprise mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

Embodiment 1

[0053] S1, putting a camera into a hole and pushing the camera inward to carry out a video acquisition;

[0054] S2, selecting two frames of images from the video obtained from S1, namely FIG. 1 and FIG. 2; adjusting axis angle 2 in FIG. 2 to the same angle as axis angle 1 in FIG. 1; FIG. 1 is a frame of the previous moment, FIG. 2 is a frame of the next moment. By using an optical flow method, the moving trajectory of each point from FIG. 2 to FIG. 1 is obtained, which is the motion vector field of FIG. 2 relative to FIG. 1, denoted as field 1-2. The optical flow method is a calculation method in the existing technology, which is not described in detail here.

[0055] Field 1-2 is divided into a row offset graph and a column offset graph, a pixel gray value in the row offset graph is a row offset value of the midpoint of field 1-2, and a pixel gray value in the column offset graph is a column offset value of the midpoint of field 1-2. A tangent value of this point can be obtained from the row offset value and the column offset value, and a phase angle of this point can be obtained by bringing the tangent value into the arctangent function. Phase angle diagram 1 is obtained by the phase angles of all points.

[0056] Converting the row offset graph and the column offset graph into a distance, and the point on the obtained modular length graph is the distance of the trajectory distance of this point.

[0057] Axis angle 2 in FIG. 2 is adjusted to the same angle as axis angle 1 in FIG. 1. If the angle of axis angle 2 is different from that of axis angle 1, FIG. 2 rotates relative to FIG. 1. Taking the image center as the center of the circle and any length as the radius to make a detection circle, a phase angle from the point on the detection circle to the center of the circle is obtained. Then, a phase angle difference between phase angle 2 and phase angle 1 from the endpoint of the trajectory of the point to the center of the circle is obtained, and phase angle difference is an axis angle difference between axis angle 1 and axis angle 2.

[0058] Different diameters are selected to obtain different detection circles, and then the corresponding axial angle differences are obtained, the average value of multiple axial angle differences is taken, and FIG. 2 is rotated according to the average value of the axial angle differences.

[0059] S3, adjusting axis angle 1 and adjusted axis angle 2 in S2 until the angle is zero.

[0060] According to rotated FIG. 2 and FIG. 1, a vector motion field is recalculated as field 1-21. Phase angle diagram 2 and modular length graph 2 are obtained again according to field 1-21. When all trajectory lines in phase angle diagram 2 intersect, a point with the most trajectory lines is the control point.

[0061] A trajectory line is determined according to the coordinates of any point in phase angle diagram 2 and the pixel gray value, the pixel gray value in phase angle diagram 2 is a phase angle of the displacement of the point, the equation of the trajectory line can be determined according to the coordinates of a point on the straight line and the slope of the straight line. A point that has the most intersected trajectory lines is selected as the control point, and then the coordinates of the control point are obtained.

[0062] Taking the control point as the center of the circle, detection circle 1 is generated in modular length graph 2, and the two points with the largest pixel gray value on detection circle 1 are obtained, that is, the two points with the longest displacement. These two points are symmetrical about the offset axis, then axis angle 3 is half of the sum of phase angles of the two points. By setting detection circle 1 of different radii, several axis angles are obtained, and the average value is taken after eliminating the outliers. FIG. 1 and rotated FIG. 2 are rotated according to axis angle three, and rotated FIG. 1 and double rotated FIG. 2 are obtained. At this time, the offset axis is aligned with the x-axis, and the positive direction of the x-axis is from left to right.

[0063] S4, calculating a radius ratio of motion 1 according to adjusted FIG. 1 and FIG. 2 in S3, and similarly, obtaining radius ratio of motion 2;

[0064] radius ratio of motion 1 of any point in rotated FIG. 1 is obtained from rotated FIG. 1 and double rotated FIG. 2, radius ratio of motion 1 is a ratio of the distance from the point to the control point in FIG. 1 after rotation to the distance from the endpoint of the motion trajectory to the control point. From FIG. 2 and FIG. 3 of the next frame, radius ratio of motion 2 of any point in FIG. 2 is adjusted according to S2 and S3. Moreover, radius ratio diagram of motion 1 is obtained according to radius ratio of motion 1, and radius ratio diagram of motion 2 is obtained according to radius ratio of motion 2.

[0065] If the control point coincides with the center of the image, then the center distance of rotated FIG. 1 is equal to that of double rotated FIG. 2. At this time, only obtaining radius ratio diagram of motion 1 is enough.

[0066] S5, obtaining radius ratio of axis distance 1 and radius ratio of axis distance 2 are obtained according to radius ratio of motion 1 and radius ratio of motion 2 in S4, respectively. Because the points on the same motion trajectory are the points on the same depth ring in the physical space, and the radius ratio of motion is a fixed value and related to the physical depth. Therefore, the radius ratio of axis distance in the physical space can be accurately obtained.

[0067] The points with the same pixel gray value are selected from radius ratio diagram of motion 1, and ring 1 with the same depth is obtained, the center coordinates can be obtained from the radius of ring 1 and the points with the same pixel gray value, radius ratio of axis distance 1 is the ratio of the distance from the center of ring 1 to the center of the image to the radius. Several radii and center positions of ring 1 can be obtained, several radius ratios of axis distances can be obtained, and the radius ratios of axis distances of different ring 1 are averaged. Similarly, the average value of radius ratio of axis distance 2 is obtained from radius ratio diagram of motion 2.

[0068] S6, correcting FIG. 1 and FIG. 2 to obtain FIG. 3 and FIG. 4 according to the calculation of radius ratio of axis distance 1 and radius ratio of axis distance 2 in S5;

[0069] Corrected radius: Due to the existence of the axis distance in the physical space, the distance from each group of points to the center of the circle can be obtained from the radius ratio of axis distance, and the radius ratio of axis distance is equal to the radius ratio of axis distance in the physical space. After the corrected center coincides with the image center, the radius value from the point to the image center can be obtained.

[0070] As shown in FIG. 9, the left side is a ring in the plane of the physical space, and the right side is a ring in the plane of the image plane. if there is no lens offset, for a point Ar in the physical space, its corresponding point in the image should be Ap1; If there is a lens offset, the corresponding point in the image should be Ap2.

[00001] ArOr 1 ArOr 2 = Ap 1 Op 1 Ap 2 Op 2 [0071] Or1-Op1 is an axis of the lens in the center of the hole; [0072] Or2-Op2 is an offset axis; [0073] corrected radius Ap1Op1 is denoted by r1; [0074] radius Ap2Op2 before correction is denoted by r2.

[0075] ArOr2 can be transformed into the functions of ArOr1 and Or1Or2 by cosine formula, ArOr2 is related to the radius ratio of axis distance, therefore, the radius ratios before and after correction can be obtained by using the radius ratio of axis distance.

[0076] The angle after correction: due to the existence of the axis distance in the physical space, the functional relationship between the angle before correction and the angle after correction can be obtained from the radius ratio of axis distance.

[0077] There is a phase angle difference between a phase angle from the point to the center of the hole in the physical space and a phase angle from the corresponding point to the center of the image in FIG. 1. Phase angle difference can be obtained by a cosine formula. In the triangle where a phase angle difference is located, the axis distance is one edge of the triangle, and the other two edges are the radii of the hole. The corrected radius is brought in to obtain the relationship between the radius ratio of the axis distance and the angle.

[0078] As shown in FIG. 10, it is an image of a layer of rings, and a coordinate system is established in the positive direction of the x-axis from the center of the hole O1 to the center of the image O2.

[0079] Using the cosine formula for ?? to obtain:

[00002] cos ? = AO 1 2 - O 1 O 2 2 - AO 2 2 2 * O 1 O 2 * AO 2

[0080] Using the cosine formula for ?? to obtain:

[00003] AO 2 2 = AO 1 2 + O 1 O 2 2 - 2 * AO 1 * O 1 O 2 * cos ? [0081] where: point A is a point on the image ring; [0082] angle A-O.sub.2-X axis is denoted by ??; [0083] angle A-O.sub.1-X axis is denoted by ??; [0084] O1O.sub.2 is the axis distance; AO.sub.1 is the radius of the hole.

[0085] Because AO.sub.2 is unknown, O.sub.1O.sub.2 and AO.sub.1 can be known from the radius ratio of axis distance. By taking the cosine formula of ?? into the cosine formula of ??, the functional relationship between ?? and ?? is obtained.

[0086] S7, matching FIG. 3 in S6 along with FIG. 1 and matching FIG. 4 in S6 along with FIG. 2 to obtain a corrected undistorted image.

[0087] The radius and angle after correction are known, according to the polar coordinate formula, the image before correction can correspond to the corrected image one by one, and the corrected image without distortion can be obtained.

[0088] From the correspondence between the length and angle of the image coordinates before and after correction, the mapping of the coordinates before and after correction can be known, the corresponding formula of polar coordinates is as follows:

[00004] { x = W / 2 + r 2 * cos ? y = H / 2 - r 2 * sin ? [0089] Where W is the width of the image; [0090] H is the height of the image; [0091] in this formula, cos ? is the function of AO.sub.1 and O.sub.1O.sub.2 with cos ? in S6.

[0092] S8, outspreading the undistorted image in S7 to obtain an undistorted outspread image according to a polar coordinate formula.

[0093] In the undistorted image, the center of the image is the center of the hole, the projection of a certain section of the image in the hole can be obtained by taking a circle of different radii in the center of the image, the rectangular image is obtained after outspreading by using the polar coordinate formula to outspread.

[0094] As shown in FIG. 11, the coordinates of a point on the ring are (Xc, Yc), and the mapping of points on the rectangular image can be established after outspreading by using the polar coordinate formula. The coordinates of the corresponding points on the rectangular image are (Xr, Yr), the width of the rectangular is 2*?*Rmax and the height of the rectangular is Rmax?Rmin

[00005] { x c = x 0 + ( Rmax - y r ) * cos ( x r / Rmax ) y c = y 0 + ( Rmax - y r ) * sin ( x r / Rmax ) [0095] Where: (Xo, Yo) is the center coordinate; [0096] Rmax is the maximum radius of the ring; [0097] Rmin is the minimum radius of the ring.

[0098] The outspread formula in the above S8 is not unique. It is only one of the outspread methods. The ring coordinates and the rectangular coordinates correspond one by one through the formula.

[0099] After the undistorted image is outspread, the panoramic image of the ring is outspread into a rectangular image that is convenient for stitching and observation, and finally, the undistorted outspread image is obtained.

[0100] Finally, it should be explained that the above embodiment is only used to explain the technical solution of the invention rather than restrict it. Although the invention is described in detail concerning the better embodiment, the ordinary technical personnel in this field should understand that they can still modify or replace the technical solution of the invention, and these modifications or equivalent substitutions cannot make the modified technical solution out of the spirit and protection scope of the technical solution of the invention.