A method and system for calculating the mileage of a detector in a pipeline based on image information
Through the method based on image information, the mileage of the detector in the oil and gas pipeline is calculated, which solves the problems of inaccurate measurement and high cost of mechanical mileage wheel sensors, achieving more accurate mileage measurement and reducing detection costs.
Patent Information
- Application Number
- CN202411109864.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-14
AI Technical Summary
The existing mechanical mileage wheel sensors have problems such as inaccurate measurement results and high detection costs in the detection of oil and gas pipelines, especially when there is insufficient friction when there is a viscous substance attached to the inner wall of the pipeline or when the measurement is inaccurate when passing through the weld.
Using the in-pipe detector mileage calculation method based on image information, the shooting unit is set to the center position of the detector in the pipeline, the pipeline image is obtained, the conversion ratio and image matching correlation coefficient between the image and the pipeline space are calculated, and the detector's The displacement mileage is used and error correction is performed by fitting the curve function to generate the target mileage result.
It improves the accuracy of mileage calculation, reduces detection costs, avoids errors and high cost problems of mechanical mileage wheel sensors, and ensures accurate positioning of detectors in the pipeline.
Smart Images

Figure CN118640929B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for calculating the mileage of a detector in a pipeline based on image information. Background Art
[0002] Oil and gas pipelines are important channels for transporting high-pressure, flammable and explosive media, and are a key link in the energy chain. Damage and leakage of oil and gas pipelines will not only cause direct casualties and environmental pollution, but also lead to production interruptions and increased maintenance costs, causing significant losses to companies and affecting the stable operation of society and the economy. In-pipeline detection can help detect corrosion, cracks and other problems in the pipeline as early as possible, reduce the impact of leakage accidents on the environment, and ensure the continuity and stability of oil and gas production. In-pipeline detection requires precise perception of the location of pipeline defects, so it is necessary to accurately measure the mileage data of the detector.
[0003] The existing method for calculating the mileage of an internal detector generally adopts a mechanical mileage wheel sensor. The mechanical mileage wheel sensor makes the mileage wheel contact the inner wall of the pipe through an arm structure and an elastic component. When the detector moves in the pipe, the mileage wheel rotates under the action of friction. The rotation sensor detects the rotation and generates a corresponding signal. The distance corresponding to each rotation signal is calculated. By accumulating the distance corresponding to each rotation signal, the cumulative moving distance of the internal detector in the pipe is calculated.
[0004] Although mechanical odometer wheel sensors can measure mileage data, there are large errors. The reasons are: when the inner wall of the pipeline is attached with viscous transport materials such as oil, the friction between the odometer wheel and the pipe wall is insufficient, and slippage is likely to occur, resulting in the measured mileage data being lower than the actual mileage; when the detector passes through the weld in the pipeline, the odometer wheel may bounce off the inner wall of the pipeline, resulting in inaccurate mileage measurement results; in addition, the measurement method based on mechanical odometer wheel sensors requires professional mechanical and electronic components, which increases the cost of pipeline detection. Summary of the invention
[0005] The present application provides a method and system for calculating the mileage of an in-pipe detector based on image information, so as to solve the technical problem that the existing mechanical mileage wheel sensor can measure mileage data, but the measurement results are inaccurate and the detection cost is high.
[0006] The present application provides a method for calculating the mileage of an in-pipe detector based on image information, which is applied to the in-pipe detector; the in-pipe detector is provided with a shooting unit; the shooting unit is always located at the center of the pipeline to be tested during the detection process of the in-pipe detector; the shooting unit shoots the pipeline to be tested according to a preset time;
[0007] The method comprises:
[0008] Acquiring a pipeline image of the pipeline to be tested;
[0009] Based on the pipeline image, calculating a conversion ratio between the pipeline image and the pipeline space to be measured;
[0010] Based on the pipeline image, obtaining a grayscale matrix of an analysis window in the pipeline image;
[0011] Based on the grayscale matrix, calculating the image matching mutual correlation coefficient;
[0012] Based on the conversion scale and the image matching correlation coefficient, the displacement mileage of the detector in the pipeline within the preset time is calculated and accumulated to generate a target mileage result.
[0013] In some embodiments, the calculating, based on the pipeline image, a conversion ratio between the pipeline image and the pipeline space to be measured comprises:
[0014] Based on the pipeline image, image parameters are obtained; the image parameters are: the number of pixels occupied in the vertical direction on the pipeline image, and the center distance of the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction on the focal plane;
[0015] Based on the image parameters, the conversion scale between the pipeline image and the pipeline space to be measured is calculated; the conversion scale is:
[0016] ;
[0017] In the formula, N y is the number of pixels occupied in the vertical direction on the pipeline image; r It is the center distance of the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction on the focal plane.
[0018] In some embodiments, acquiring a grayscale matrix of an analysis window in the pipeline image based on the pipeline image comprises:
[0019] Based on the pipeline image, obtaining a 1 / 4 pixel position in the middle of the pipeline image in a vertical direction;
[0020] Taking the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction as the center, an analysis window is obtained; the analysis window is a rectangular window, and the number of pixels in the horizontal and vertical directions in the analysis window is 32;
[0021] Based on the analysis window, a grayscale matrix is obtained.
[0022] In some embodiments, the calculating the image matching mutual correlation coefficient based on the grayscale matrix comprises:
[0023] Based on the grayscale matrix, a first grayscale matrix and a second grayscale matrix are obtained; the shooting time of the pipeline image corresponding to the first grayscale matrix and the second grayscale matrix differs by a preset time;
[0024] Based on the first grayscale matrix and the second grayscale matrix, obtaining pixel difference values in the horizontal direction and the vertical direction within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix;
[0025] Based on the first grayscale matrix, the second grayscale matrix, and the pixel difference, the image matching mutual correlation coefficient is calculated; the image matching mutual correlation coefficient is:
[0026] ;
[0027] In the formula, I 1 and I 2 represent the first grayscale matrix and the second grayscale matrix respectively; i and j The labels representing the accumulation calculations in the horizontal and vertical directions respectively; X i and Y j Respectively represent the pixel positions in the horizontal and vertical directions; Δ X and Δ Y Respectively represent the pixel differences in the horizontal direction and the vertical direction within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix; N Indicates the search range of the analysis window.
[0028] In some embodiments, the calculation of the displacement mileage of the detector in the pipeline within the preset time based on the conversion scale and the image matching correlation coefficient includes:
[0029] Based on the image matching mutual correlation coefficient, the horizontal and vertical displacements of the pixels corresponding to the mutual correlation peak are obtained; the horizontal and vertical displacements are:
[0030] ;
[0031] Based on the horizontal and vertical displacements and the conversion scale, the corresponding distance of the displacement of the detector in the pipeline on the focal plane is calculated; the corresponding distance is:
[0032] ;
[0033] Obtain the distance between the circular plane and the mirror surface, the focal length of the lens, and the radius of the pipeline corresponding to the 1 / 4 pixel in the vertical direction in the middle of the pipeline image;
[0034] Based on the distance between the circular plane corresponding to 1 / 4 pixel in the middle vertical direction of the pipeline image and the mirror, the focal length of the lens, the pipeline radius, and the corresponding distance of the displacement of the detector in the pipeline on the focal plane, the displacement mileage of the detector in the pipeline within the preset time is calculated; the displacement mileage is:
[0035] ;
[0036] In the formula, L The distance between the circular plane and the mirror surface corresponding to 1 / 4 pixel in the middle of the pipeline image in the vertical direction; L 0 is the focal length of the lens; R is the pipe radius.
[0037] In some embodiments, calculating and accumulating the displacement mileage of the detector in the pipeline within the preset time includes:
[0038] Based on the displacement mileage, the total displacement mileage of the in-pipe detector from the initial time to the target time is obtained; the total displacement mileage is:
[0039] ;
[0040] In the formula, S t represents the displacement mileage of the in-pipe detector in the pipeline to be tested at the target time, and the corresponding initial position is the position of the in-pipe detector at the initial time; t 0 is the target time; Δ t is the preset time.
[0041] In some embodiments, the method further comprises:
[0042] Obtaining the total displacement mileage of the detector in the pipeline at each time;
[0043] Construct fitting curve function;
[0044] Based on the total displacement mileage, the total displacement mileage is corrected according to the fitting curve function to generate a target total displacement mileage.
[0045] In some embodiments, generating the target mileage result includes:
[0046] Based on the target total displacement mileage, construct a composite vector of time and target total displacement mileage;
[0047] Based on the composite vector, a target mileage result is generated.
[0048] The second aspect of the present application provides a pipeline detector mileage calculation system based on image information, comprising:
[0049] The pipeline detector body is provided with a shooting unit; the shooting unit is always located at the center of the pipeline to be tested during the detection process of the pipeline detector body; the shooting unit shoots the pipeline to be tested according to a preset time;
[0050] A computing unit, the computing unit is communicatively connected with the photographing unit; the computing unit is configured to:
[0051] Acquiring a pipeline image of the pipeline to be tested;
[0052] Based on the pipeline image, calculating a conversion ratio between the pipeline image and the pipeline space to be measured;
[0053] Based on the pipeline image, obtaining a grayscale matrix of an analysis window in the pipeline image;
[0054] Based on the grayscale matrix, calculating the image matching mutual correlation coefficient;
[0055] Based on the conversion scale of the pipeline image and the pipeline space to be measured and the image matching correlation coefficient, the displacement mileage of the detector in the pipeline within the preset time is calculated and accumulated to generate a target mileage result.
[0056] In some embodiments, the system further comprises:
[0057] A correction unit, the correction unit is communicatively connected to the calculation unit, and the correction unit is configured to:
[0058] Obtaining the total displacement mileage of the detector in the pipeline at each time;
[0059] Construct fitting curve function;
[0060] Based on the total displacement mileage, the total displacement mileage is corrected according to the fitting curve function to generate a target total displacement mileage;
[0061] The computing unit is further configured to:
[0062] Based on the target total displacement mileage, construct a composite vector of time and target total displacement mileage;
[0063] Based on the composite vector, a target mileage result is generated.
[0064] The present application provides a method and system for calculating the mileage of an in-pipe detector based on image information, which is applied to the in-pipe detector; the in-pipe detector is provided with a shooting unit; the shooting unit is always in the center of the pipeline to be tested during the detection process of the in-pipe detector; the shooting unit shoots the pipeline to be tested according to a preset time; the method comprises: obtaining a pipeline image of the pipeline to be tested; based on the pipeline image, calculating a conversion scale between the pipeline image and the space of the pipeline to be tested; based on the pipeline image, obtaining a grayscale matrix of an analysis window in the pipeline image; based on the grayscale matrix, calculating an image matching mutual correlation coefficient; based on the conversion scale and the image matching mutual correlation coefficient, calculating and accumulating the displacement mileage of the in-pipe detector within the preset time to generate a target mileage result, so as to solve the problem that although the current mechanical mileage wheel sensor can measure mileage data, the measurement result is inaccurate and the detection cost is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0066] Figure 1 This is a flow chart of the method for calculating the mileage of a pipeline detector based on image information in this application;
[0067] Figure 2 A schematic diagram of an analysis window in a pipeline image in this application;
[0068] Figure 3 is a schematic diagram of the grayscale matrix in this application;
[0069] Figure 4 A schematic diagram of calculating the displacement mileage of a detector in a pipeline within a preset time in this application;
[0070] Figure 5 This is a schematic diagram of the target mileage result curve before and after error correction in this application;
[0071] Figure 6 This is a schematic diagram of the target mileage results in this application;
[0072] Figure 7 This is a schematic diagram of the structure of the in-pipe detector in this application. DETAILED DESCRIPTION
[0073] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0074] In some technologies, although the mechanical odometer wheel sensor can measure mileage data, the measurement result is inaccurate and the detection cost is high. In order to solve this technical problem, the present application provides a method and system for calculating the mileage of a pipeline detector based on image information. The method and system for calculating the mileage of a pipeline detector based on image information are described below:
[0075] For example, the existing internal detector mileage calculation method generally adopts a mechanical mileage wheel sensor. The mechanical mileage wheel sensor makes the mileage wheel contact with the inner wall of the pipeline through the support arm structure and the elastic member. When the detector moves in the pipeline, the mileage wheel rotates under the action of friction. The rotation sensor will detect the rotation and generate a corresponding signal. The distance corresponding to each rotation signal is calculated. By accumulating the distance corresponding to each rotation signal, the cumulative movement distance of the internal detector in the pipeline is calculated. Although the mechanical mileage wheel sensor can measure mileage data, there is a large error. The reason is that when the inner wall of the pipeline is attached with viscous transport materials such as oil, the friction between the mileage wheel and the pipe wall is insufficient, and slippage occurs, and the measured mileage data is lower than the actual mileage; when the detector in the pipeline passes through the weld, the mileage wheel bounces up and detaches from the inner wall of the pipeline, resulting in inaccurate mileage measurement. In addition, the measurement method based on the mechanical mileage wheel sensor needs to be equipped with professional mechanical and electronic components, which increases the cost of pipeline detection.
[0076] In response to the above problems, Figure 1 It can be seen that the first aspect of the present application provides a method for calculating the mileage of a pipeline detector based on image information, which is applied to the pipeline detector; the pipeline detector moves along the pipeline under the impetus of natural gas to complete the pipeline detection operation; the pipeline detector is provided with a shooting unit; the shooting unit is always in the center of the pipeline to be tested during the detection process of the pipeline detector; the shooting unit shoots the pipeline to be tested according to a preset time. The present application sets a shooting unit, and the shooting unit is set at the front end of the pipeline detector, such as Figure 7As shown, the in-pipe detector eliminates the setting of the mechanical odometer wheel sensor, thereby avoiding the inaccurate odometer measurement caused by the slipping of the odometer wheel; because the shooting unit is arranged at the front end of the in-pipe detector, even if the in-pipe detector bounces up when encountering a weld, the front end of the in-pipe detector will not bounce up, thereby ensuring that the shooting unit is always in the center of the pipeline to be tested. The use process of the in-pipe detector provided in the present application is as follows: first, place the in-pipe detector in the pipeline ball launching barrel, and the in-pipe detector fits the pipe wall of the pipeline to be tested; introduce natural gas into the pipeline to be tested, so that the in-pipe detector moves in the pipeline, and wait for the in-pipe detector to move to the ball receiving barrel of the pipeline to be tested, and complete the detection of the pipeline to be tested. In the embodiment of the present application, the preset time is 0.02s; the preset time is:
[0077] ;
[0078] In the formula, f p is the shooting frequency of the shooting unit. The shooting rate of the camera unit in this application is maintained at 50 Hz.
[0079] The method comprises the following steps:
[0080] S100: Acquire the pipeline image of the pipeline to be tested; when the pipeline detector is running in the pipeline, the camera unit installed on the pipeline detector continuously shoots the pipeline image, and the camera is located at the center of the pipeline, and the distance from the pipeline circumference is a constant value, and the constant value is 85mm. The pipeline inner wall image is formed on the focal plane of the camera, and the shooting rate of the camera unit remains unchanged during the movement of the pipeline detector. The pipeline image is saved in .jpg format.
[0081] S200: Based on the pipeline image, a conversion scale between the pipeline image and the pipeline space to be measured is calculated; the proportional relationship between the pipeline image and the displacement of the detector in the pipeline can be obtained by using the conversion scale; that is, the displacement of the detector in the pipeline within the preset time period can be obtained by using two groups of pipeline images taken within adjacent time intervals, that is, within the preset time period.
[0082] The method of calculating the conversion scale between the pipeline image and the pipeline space to be measured based on the pipeline image comprises the following sub-steps: S210: acquiring image parameters based on the pipeline image; the image parameters are: the number of pixels occupied in the vertical direction on the pipeline image, and the center distance of the 1 / 4 pixel position in the vertical direction in the middle of the pipeline image on the focal plane; S220: calculating the conversion scale between the pipeline image and the pipeline space to be measured based on the image parameters; the conversion scale is:
[0083] ;
[0084] In the formula, N y is the number of pixels occupied in the vertical direction on the pipeline image; r It is the center distance of the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction on the focal plane.
[0085] S300: Based on the pipeline image, a grayscale matrix of an analysis window in the pipeline image is obtained; the grayscale matrix is a square matrix of 32×32 pixels. The grayscale matrix is used to obtain image displacement information.
[0086] The step of acquiring the grayscale matrix of the analysis window in the pipeline image based on the pipeline image comprises the following sub-steps:
[0087] S310: Based on the pipeline image, obtain the 1 / 4 pixel position in the middle vertical direction of the pipeline image; the image displacement information can be better obtained through the 1 / 4 pixel position in the middle vertical direction of the pipeline image, which is more representative and has the best effect; it can be understood that the position at the center of the pipeline image in the two pipeline images taken by the shooting unit within a preset time will not change much, while there is a big difference between the positions near the edges of the two pipeline images, so this application selects the 1 / 4 pixel position in the middle vertical direction of the pipeline image as the center to obtain the analysis window, so that the final target mileage result is more accurate. S320: Get the analysis window with the 1 / 4 pixel position in the middle vertical direction of the pipeline image as the center, such as Figure 2 As shown; the analysis window is a rectangular window, and the number of pixels in the horizontal and vertical directions of the analysis window is 32. Figure 3 As shown; S330: Based on the analysis window, a grayscale matrix is obtained. The grayscale matrix is expressed as:
[0088] ;
[0089] In the formula, I 0 represents a grayscale matrix with a specific dimension of 32×32 pixels; ( X 0, Y S ) represents the 1 / 4 pixel position in the middle vertical direction of the pipeline image.
[0090] S400: Based on the grayscale matrix, calculate the image matching mutual correlation coefficient; the mutual correlation coefficient is a method for measuring the similarity between two images; in the calculation result of the mutual correlation coefficient, the peak value represents the maximum similarity between the two images. By calculating the mutual correlation function of the two images, similar areas or feature points in the images can be found. The peak value of the mutual correlation function represents the maximum similarity between the two images, and the matching degree between the two images can be determined by comparing the peak values at different positions.
[0091] The calculation of the image matching mutual correlation coefficient based on the grayscale matrix includes the following sub-steps: S410: based on the grayscale matrix, obtaining a first grayscale matrix and a second grayscale matrix; the shooting time of the pipeline image corresponding to the first grayscale matrix and the second grayscale matrix differs by a preset time; S420: based on the first grayscale matrix and the second grayscale matrix, obtaining the pixel difference in the horizontal and vertical directions within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix; S430: based on the first grayscale matrix, the second grayscale matrix, and the pixel difference, calculating the image matching mutual correlation coefficient; the image matching mutual correlation coefficient is:
[0092] ;
[0093] In the formula, I 1 and I 2 represent the first grayscale matrix and the second grayscale matrix respectively; i and j The labels representing the accumulation calculations in the horizontal and vertical directions respectively; X i and Y j Respectively represent the pixel positions in the horizontal and vertical directions; Δ X and Δ Y Respectively represent the pixel differences in the horizontal direction and the vertical direction within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix; N Indicates the search range of the analysis window.
[0094] S500: Based on the conversion scale and the image matching correlation coefficient, the displacement mileage of the detector in the pipeline within the preset time is calculated and accumulated to generate a target mileage result. The target mileage result is displayed in the form of a time-mileage vector, such as Figure 6 shown.
[0095] The calculation of the displacement mileage of the detector in the pipeline within the preset time based on the conversion scale and the image matching mutual correlation coefficient includes the following sub-steps: S510: Based on the image matching mutual correlation coefficient, the horizontal and vertical displacements of the pixels corresponding to the mutual correlation peak are obtained; the pixels corresponding to the mutual correlation peak are the pixels with the greatest similarity in the two pipeline images within the preset time. It can be understood that the two pixels with the greatest similarity correspond to the same position of the pipeline, and the image displacement information within the preset time can be obtained by obtaining the displacement of the same pipeline position of the two pipeline images; the horizontal and vertical displacements are:
[0096] ;
[0097] S520: Based on the displacement in the horizontal and vertical directions and the conversion scale, the corresponding distance of the displacement of the detector in the pipeline on the focal plane is calculated; the corresponding distance can be obtained according to the displacement in the horizontal and vertical directions, and the corresponding distance is:
[0098] ;
[0099] S530: Figure 4 The figure shows the displacement mileage diagram, which is used to obtain the distance between the circular plane and the mirror surface corresponding to 1 / 4 pixel in the vertical direction in the middle of the pipeline image. L Distance, lens focal length L 0. Pipe radius R ; S540: Based on the distance between the circular plane corresponding to 1 / 4 pixel in the vertical direction in the middle of the pipeline image and the mirror surface L Distance, lens focal length L 0. Pipe radius R , the corresponding distance of the detector displacement in the pipeline on the focal plane dr , calculate the displacement mileage of the detector in the pipeline within the preset time; the displacement mileage is:
[0100] ;
[0101] In the formula, L The distance between the circular plane and the mirror surface corresponding to 1 / 4 pixel in the middle of the pipeline image in the vertical direction; L 0 is the focal length of the lens; R is the pipe radius.
[0102] The step of calculating and accumulating the displacement mileage of the detector in the pipeline within the preset time includes the following sub-steps:
[0103] S550: Based on the displacement mileage, the total displacement mileage of the in-pipe detector from the initial time to the target time is obtained; the total displacement mileage is:
[0104] ;
[0105] In the formula, S t represents the displacement mileage of the in-pipe detector in the pipeline to be tested at the target time, and the corresponding initial position is the position of the in-pipe detector at the initial time; t 0 is the target time; Δ t is the preset time.
[0106] The method further includes: S600: obtaining the total displacement mileage of the detector in the pipeline at each time; that is, the total displacement mileage of the shooting unit when shooting at each time, that is, S 1. S 2. S 3. … S i . S700: Construct a fitting curve function; the fitting curve is a curve drawn based on discrete data points, which is used to solve the problem that the data obtained in engineering design or scientific experiments is often a table of discrete data points, and there is no analytical expression to describe the xy relationship. The so-called curve fitting method is to establish a data relationship (mathematical model) based on given discrete data points, and find a series of tiny straight line segments to connect these interpolation points into a curve. As long as the interval of the interpolation points is properly selected, a smooth curve can be formed. The fitting curve function is:
[0107] ;
[0108] In the formula, a and φ They are all intermediate process parameters introduced in the calculation process.
[0109] Based on the fitting curve function, the fitting function relationship of the total displacement mileage is determined:
[0110] ;
[0111] The partial derivative of the fitting function δ is calculated and set to be equal to zero, which is expressed as:
[0112] .
[0113] S800: Based on the total displacement mileage, the total displacement mileage is corrected according to the fitting curve function to generate a target total displacement mileage. , the total displacement mileage is error corrected, and the corrected total displacement mileage, i.e. the target total displacement mileage, is: .like Figure 5The target mileage result curve before and after error correction is shown. The corrected target mileage result curve generates a smooth curve, thereby expanding the range and accuracy of the target mileage result; the influence of noise and interference in the target total displacement mileage on the data is reduced by fitting the curve, thereby improving the reliability of the data.
[0114] The generating target mileage result includes the following sub-steps: S560: constructing a composite vector of time and target total displacement mileage based on the target total displacement mileage; the composite vector is: ; S570: Generate a target mileage result based on the composite vector. The target mileage result is stored in the composite vector form of the above formula, the number of composite vector units is t, and the target mileage result is output, such as Figure 6 As shown, the mileage calculation process of the pipeline detector based on image information is completed. The composite vector form described in the above formula can accurately obtain how many miles the pipeline detector has traveled in the pipeline at a precise time point, so as to accurately locate the pipeline detector. For example: the pipeline detector finds that there is a problem in the pipeline during the detection process. The staff only needs to obtain the time when the pipeline detector finds the problem, so as to obtain the mileage of the pipeline detector in the pipeline, so as to accurately locate the problem location, so as to accurately repair the location of the pipeline problem.
[0115] The present application proposes a method for calculating the mileage of a detector in a pipeline based on image information, which eliminates the setting of the arm structure, elastic member, rotation sensor and other components in the mechanical mileage wheel sensor, thereby reducing the cost of pipeline detection; generating a pipeline image by setting a shooting unit to shoot the pipeline to be tested; calculating the conversion scale between the pipeline image and the pipeline space to be tested; defining a pipeline image analysis window to obtain the grayscale matrix of the analysis window in the pipeline image; calculating the image matching mutual correlation coefficient; calculating the displacement mileage of the detector in the pipeline at a single moment; accumulating the mileage of the detector in the pipeline to obtain the total displacement mileage; performing error correction on the total displacement mileage; and finally obtaining the target total displacement mileage and outputting it. The present application uses the collected image information to realize the accurate calculation of the mileage of the detector in the pipeline, improves the accuracy of the mileage calculation results, and thus reduces the difficulty of positioning the detector in the pipeline, which is of great significance to improving the accuracy of the mileage calculation results of the detector in the pipeline.
[0116] The second aspect of the present application provides a pipeline detector mileage calculation system based on image information, including: a pipeline detector body, on which a shooting unit is provided; the shooting unit is always in the center of the pipeline to be tested during the detection process of the pipeline detector body; the shooting unit shoots the pipeline to be tested according to a preset time; a calculation unit, the calculation unit is connected to the shooting unit in communication; the calculation unit is configured to: obtain a pipeline image of the pipeline to be tested; based on the pipeline image, calculate the conversion scale of the pipeline image and the pipeline space to be tested; based on the pipeline image, obtain the grayscale matrix of the analysis window in the pipeline image; based on the grayscale matrix, calculate the image matching mutual correlation coefficient; based on the conversion scale of the pipeline image and the pipeline space to be tested and the image matching mutual correlation coefficient, calculate the displacement mileage of the pipeline detector within the preset time and accumulate it to generate a target mileage result. The effects of each part of the above system operation can be referred to the above method embodiment, which will not be repeated here.
[0117] In this embodiment, the system further includes: a correction unit, the correction unit is configured to: obtain the total displacement mileage of the detector in the pipeline at each moment; construct a fitting curve function; based on the total displacement mileage, correct the total displacement mileage according to the fitting curve function to generate a target total displacement mileage; the calculation unit is also configured to: based on the target total displacement mileage, construct a composite vector of the moment and the target total displacement mileage; based on the composite vector, generate a target mileage result. The effects of each part when the above system is running can be found in the above method embodiment, which will not be repeated here.
[0118] The above specific implementation methods further explain in detail the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above are only specific implementation methods of the embodiments of the present application and are not used to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A pipeline detector mileage calculation method based on image information, applied to pipeline detectors; It is characterized in that The pipeline detector is provided with a shooting unit; the shooting unit is always located at the center of the pipeline to be tested during the detection process of the pipeline detector; the shooting unit shoots the pipeline to be tested according to a preset time; The method comprises: Acquiring a pipeline image of the pipeline to be tested; Based on the pipeline image, calculating a conversion ratio between the pipeline image and the pipeline space to be measured; Based on the pipeline image, obtaining a grayscale matrix of an analysis window in the pipeline image; Based on the grayscale matrix, calculating the image matching mutual correlation coefficient; Based on the image matching mutual correlation coefficient, the horizontal and vertical displacements of the pixels corresponding to the mutual correlation peak are obtained; the horizontal and vertical displacements are: ; Based on the horizontal and vertical displacements and the conversion scale, the corresponding distance of the displacement of the detector in the pipeline on the focal plane is calculated; the corresponding distance is: ; Obtain the distance between the circular plane and the mirror surface, the focal length of the lens, and the radius of the pipeline corresponding to the 1 / 4 pixel in the vertical direction in the middle of the pipeline image; Based on the distance between the circular plane corresponding to 1 / 4 pixel in the middle vertical direction of the pipeline image and the mirror, the focal length of the lens, the pipeline radius, and the corresponding distance of the displacement of the detector in the pipeline on the focal plane, the displacement mileage of the detector in the pipeline within the preset time is calculated and accumulated to generate the target mileage result; the displacement mileage is: ; In the formula, L The distance between the circular plane and the mirror surface corresponding to 1 / 4 pixel in the middle of the pipeline image in the vertical direction; L 0 is the focal length of the lens; R is the pipe radius; The step of calculating the conversion ratio between the pipeline image and the pipeline space to be measured based on the pipeline image includes: Based on the pipeline image, image parameters are obtained; the image parameters are: the number of pixels occupied in the vertical direction on the pipeline image, and the center distance of the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction on the focal plane; Based on the image parameters, the conversion scale between the pipeline image and the pipeline space to be measured is calculated; the conversion scale is: ; In the formula, N y is the number of pixels occupied in the vertical direction on the pipeline image; r The center distance of the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction on the focal plane; The calculating of the image matching mutual correlation coefficient based on the grayscale matrix comprises: Based on the grayscale matrix, a first grayscale matrix and a second grayscale matrix are obtained; the shooting time of the pipeline image corresponding to the first grayscale matrix and the second grayscale matrix differs by a preset time; Based on the first grayscale matrix and the second grayscale matrix, obtaining pixel difference values in the horizontal direction and the vertical direction within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix; Based on the first grayscale matrix, the second grayscale matrix, and the pixel difference, the image matching mutual correlation coefficient is calculated; the image matching mutual correlation coefficient is: ; In the formula, I 1 and I 2 Respectively represented as a first grayscale matrix and a second grayscale matrix; i and j The labels representing the accumulation calculations in the horizontal and vertical directions respectively; X i and Y j Respectively represent the pixel positions in the horizontal and vertical directions; Δ X and Δ Y Respectively represent the pixel differences in the horizontal direction and the vertical direction within the analysis window corresponding to the first grayscale matrix and the second grayscale matrix; N Indicates the search range of the analysis window.
2. According to the method for calculating the mileage of a pipeline detector based on image information according to claim 1, It is characterized in that The acquiring, based on the pipeline image, a grayscale matrix of an analysis window in the pipeline image comprises: Based on the pipeline image, obtaining a 1 / 4 pixel position in the middle of the pipeline image in a vertical direction; Taking the 1 / 4 pixel position in the middle of the pipeline image in the vertical direction as the center, an analysis window is obtained; the analysis window is a rectangular window, and the number of pixels in the horizontal and vertical directions in the analysis window is 32; Based on the analysis window, a grayscale matrix is obtained.
3. According to the method for calculating the mileage of a pipeline detector based on image information in claim 1, It is characterized in that The calculating and accumulating the displacement mileage of the detector in the pipeline within the preset time includes: Based on the displacement mileage, the total displacement mileage of the in-pipe detector from the initial time to the target time is obtained; the total displacement mileage is: ; In the formula, S t represents the displacement mileage of the in-pipe detector in the pipeline to be tested at the target time, and the corresponding initial position is the position of the in-pipe detector at the initial time; t 0 is the target time; Δ t is the preset time.
4. According to the method for calculating the mileage of a pipeline detector based on image information according to claim 3, It is characterized in that The method further comprises: Obtaining the total displacement mileage of the detector in the pipeline at each time; Construct fitting curve function; Based on the total displacement mileage, the total displacement mileage is corrected according to the fitting curve function to generate a target total displacement mileage; Based on the target total displacement mileage, a composite vector of time and target total displacement mileage is constructed; the composite vector is: ; In the formula, S 1 * , S 2 * , S t * is the target total displacement mileage; Based on the composite vector, a target mileage result is generated.
5. A pipeline detector mileage calculation system based on image information, applied to a pipeline detector mileage calculation method based on image information as described in any one of claims 1 to 4 above, It is characterized in that include: The pipeline detector body is provided with a shooting unit; the shooting unit is always located at the center of the pipeline to be tested during the detection process of the pipeline detector body; the shooting unit shoots the pipeline to be tested according to a preset time; A computing unit, the computing unit is communicatively connected with the photographing unit; the computing unit is configured to: Acquiring a pipeline image of the pipeline to be tested; Based on the pipeline image, calculating a conversion ratio between the pipeline image and the pipeline space to be measured; Based on the pipeline image, obtaining a grayscale matrix of an analysis window in the pipeline image; Based on the grayscale matrix, calculating the image matching mutual correlation coefficient; Based on the conversion scale of the pipeline image and the pipeline space to be measured and the image matching correlation coefficient, the displacement mileage of the detector in the pipeline within the preset time is calculated and accumulated to generate a target mileage result.
6. The pipeline detector mileage calculation system based on image information according to claim 5, It is characterized in that The system further comprises: A correction unit, the correction unit is communicatively connected to the calculation unit, and the correction unit is configured to: Obtaining the total displacement mileage of the detector in the pipeline at each time; Construct fitting curve function; Based on the total displacement mileage, the total displacement mileage is corrected according to the fitting curve function to generate a target total displacement mileage; The computing unit is further configured to: Based on the target total displacement mileage, construct a composite vector of time and target total displacement mileage; Based on the composite vector, a target mileage result is generated.
