Undistorted outspread method for annular images of the inner wall of borehole with a center offset
12152482 ยท 2024-11-26
Assignee
Inventors
Cpc classification
G06T3/40
PHYSICS
International classification
G06T3/40
PHYSICS
G06V10/24
PHYSICS
Abstract
An undistorted outspread method for annular images of the inner wall of borehole with center offset comprises putting camera into borehole and pushing camera inward to carry out video acquisition; selecting two frames of images, first image and second image, from the video obtained; adjusting second axis angle in second image to same angle as first axis angle in first image; adjusting first axis angle and adjusted second axis angle in S2 until difference between angle is zero; calculating first radius ratio of motion according to adjusted first image and second image, and obtaining second radius ratio of motion; obtaining first radius ratio of axis distance according to first radius ratio of motion, and obtaining second radius ratio of axis distance; correcting first radius ratio of axis distance and second radius ratio of axis distance to obtain third image and fourth image; outspreading undistorted image to obtain undistorted outspread image.
Claims
1. An undistorted outspread method for annular images of the inner wall of borehole with a center offset, comprising: a step S1 of putting a camera into the borehole and pushing the camera inward to carry out a video acquisition; a step S2 of selecting at least two frames of images, a first image and a second image, from the video obtained from the step S1; adjusting a second axis angle in the second image to an angle same as a first axis angle in the first image to obtain an adjusted second axis angle; a step S3 of adjusting the first axis angle and the adjusted second axis angle in the step S2 until difference between said angles is zero; a step S4 of calculating a first radius ratio of motion according to adjusted first image and second image in the step S3, and obtaining a second radius ratio of motion; a step S5 of obtaining a first radius ratio of axis distance according to the first radius ratio of motion in the step S4, and obtaining a second radius ratio of axis distance, wherein the first radius ratio of axis distance is ratio of the radius to a distance from a center of a circle to a center of the image; a step S6 of correcting the first image and the second image to obtain a corrected third image and a corrected fourth image according to the calculation of the first radius ratio of axis distance and the second radius ratio of axis distance in the step S5; a step S7 of matching the corrected third image in the step S6 along with the first image and matching the corrected fourth image in the step S6 along with the second image to obtain corrected undistorted images; and a step S8 of outspreading the corrected undistorted images from the step 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 the step S2, if the angle of the second axis angle is different from the angle of the first axis angle, obtaining a first phase angle diagram from the first image and the second image, and a phase angle difference obtained from a first phase angle and a second phase angle in the first phase angle diagram is equal to an axis angle difference, and rotating the second image 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 2, wherein in the step S3, obtaining a second phase angle diagram from the first image and the rotated second image, for the first axis angle and the second axis angle being non-zero, wherein all trajectory lines in the second phase angle diagram intersect, and a point with the most trajectory lines is a control point, and a first detection circle is determined using the control point as a center; obtaining a third axis angle from two points with the largest pixel gray value on the first detection circle, and rotating the first image and the rotated second image according to the third axis angle.
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 the step S4, selecting any point in the first image after rotation and calculating a radius ratio of motion for said selected point; calculating a first radius ratio diagram of motion from a radius ratio of motion calculated by all points in the first image after rotation, and obtaining a second radius ratio diagram of motion.
5. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 4, wherein the first radius ratio of motion is a ratio of distance from said selected point to a control point in the first image after rotation to distance from an endpoint of a motion trajectory to the control point.
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 the step S5, selecting points with the same pixel gray value in a first radius ratio diagram of motion and a second radius ratio diagram of motion to obtaining a first ring and a second ring, respectively, obtaining the first radius ratio of axis distance according to a center and radius of the first ring, and obtaining the second radius ratio of axis distance.
7. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein in the step S6, obtaining a corrected first radius and first angle according to a first radius ratio diagram of motion and a second radius ratio diagram of motion, and obtaining the corrected third image and corrected fourth image from the first angle and the first radius.
8. The undistorted outspread method for the annular images of the inner wall of borehole with the center offset according to claim 1, wherein the first image and the second image both take an image center as an origin, an x-axis is a straight line from the origin to the right, wherein axis angle is an angle between the x-axis and a line connecting the image center and the borehole center, an offset axis is a connection between the image center and the borehole center, and a length of the offset axis is the axis distance.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
DETAILED DESCRIPTION OF THE EMBODIMENTS
(17) The following is a further explanation of the technical solution of the invention through drawings and an embodiment.
(18) 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
(19) S1, putting a camera into a hole and pushing the camera inward to carry out a video acquisition at step 102;
(20) S2, selecting two frames of images from the video obtained from S1 at step 104, namely
(21) 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.
(22) 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.
(23) Axis angle 2 in
(24) 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
(25) S3, adjusting axis angle 1 and adjusted axis angle 2 in S2 until the angle is zero. At step 110, it is checked whether axis angle 1 and axis angle 2 are zero.
(26) According to rotated
(27) 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.
(28) 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 calculated at step 112 as 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.
(29) S4, calculating a radius ratio of motion 1 according to adjusted
(30) At step 118 radius ratio of motion 1 of any point in rotated
(31) At step 116, it is checked whether the control point coincides with the image center. If the control point coincides with the center of the image, then the center distance of rotated
(32) S5, at step 126 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.
(33) 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.
(34) S6, correcting
(35) 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.
(36) As shown in
(37)
(38) ArOr2 can be transformed into the functions of ArOr1 and Or1Or2 by cosine formula provided as equation (1), 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.
(39) 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.
(40) 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
(41) As shown in
(42) Using the cosine formula for to obtain:
(43)
(44) Using the cosine formula for to obtain:
(45)
(46) 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.
(47) S7, matching
(48) 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.
(49) 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:
(50)
(51) S8, outspreading the undistorted image in S7 to obtain an undistorted outspread image according to a polar coordinate formula.
(52) 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.
(53) As shown in
(54)
(55) 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.
(56) 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.
(57) 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.