Monocular vision-based monument height anti-distortion detection method, device and equipment
By employing a monocular vision-based anti-distortion detection method for marker height, and utilizing a joint regression model of target detection and key points for distortion correction, the accuracy problem of marker height measurement in complex environments using ordinary equipment is solved, achieving high-precision automated measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI OPEN UNIV (HUBEI SCI & TECH VOCATIONAL COLLEGE)
- Filing Date
- 2026-05-06
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, the height detection of pipeline marker stones is limited by the high cost of professional distance measuring equipment and the large measurement error in complex environments. In particular, when shooting from a non-frontal perspective, the perspective distortion is severe, making it difficult to achieve high-precision measurement.
A monocular vision-based anti-distortion detection method for marker height is adopted. By using a pre-trained target detection and key point joint regression model, the detection box and feature surface vertex coordinates of the marker image are obtained, distortion judgment and perspective distortion correction are performed, and the height is calculated in combination with the physical size of the marker.
It enables high-precision measurement of marker height in complex environments and from non-frontal perspectives using ordinary mobile phone photography, reducing equipment dependence and inspection costs, and improving the stability and success rate of detection.
Smart Images

Figure CN122492794A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more particularly to a method, apparatus, and device for detecting the height of a marker with high anti-distortion based on monocular vision. Background Technology
[0002] Currently, there are three main methods for detecting the height of pipeline markers: first, relying on manual on-site measurement with a measuring tape; second, using specialized inspection equipment equipped with lidar or binocular depth cameras for three-dimensional ranging; and third, using images captured by ordinary cameras for pipeline marker identification, i.e., calculating the height by directly extracting the target bounding rectangle of the marker. These existing technologies have several drawbacks: (1) Professional depth cameras or lidar equipment are expensive and bulky, making it difficult to popularize them in the daily work of grassroots inspection personnel. The ordinary smartphones most commonly used by grassroots personnel lack depth information, and existing algorithms cannot directly use their two-dimensional photos for high-precision distance measurement.
[0003] (2) When the patrol personnel take pictures with their mobile phones, it is usually from a non-frontal "side view" or "top view" perspective. At this time, the rectangular marker stone undergoes perspective projection distortion, and the parallel side edges are shortened and no longer parallel in the image. Therefore, the traditional two-dimensional rectangular frame extraction method will contain a large number of useless background pixels, resulting in serious errors in the measurement height of the marker stone.
[0004] (3) Marker stones are often located in the wild environment where weeds grow, mud adheres, and light is strong. The bottom of the marker stone is often blocked, and traditional image edge detection is very easy to fail, making it impossible to accurately locate the benchmark point of the marker stone.
[0005] Therefore, a simple and easy-to-implement method for measuring the height of marker stones is needed, which can achieve automated and high-precision measurement of marker stone height even in complex obstructed environments using only a regular mobile phone or a general-purpose RGB camera. Summary of the Invention
[0006] This invention provides a method, device, and equipment for detecting the height of pipeline markers with anti-distortion based on monocular vision, which solves the technical problem that existing pipeline marker inspection is limited by professional ranging equipment and has large measurement errors in complex field environments and under unconstrained shooting angles.
[0007] A first aspect of this invention provides a method for detecting the height of a marker with high anti-distortion based on monocular vision, comprising the following steps: Step 1: Obtain the image of the target stone; Step 2: Input the image of the target stone to be tested into a pre-trained joint regression model for target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box; Step 3: Based on the vertex coordinates, the feature surface is distorted, and when perspective distortion exists, a preset perspective distortion correction is performed to generate the corresponding standard orthogonal image; Step 4: Based on the distortion-free feature surface image and the preset physical size of the marker stone, determine the mapping ratio between the image pixel scale and the real physical scale, and calculate the current physical height of the marker stone to be measured based on the mapping ratio.
[0008] In a further embodiment, a marker image dataset is constructed, and the joint regression model for target detection and key points is trained based on the marker image dataset. The marker image dataset contains several marker images of scenes with highlights, shadows, weed occlusion, and mud adhesion.
[0009] In a further embodiment, the joint regression model for object detection and keypoints includes an object detection branch and a keypoint prediction branch. The target detection branch is used to perform coarse target localization and background stripping on the target image, and to cut out the target region of interest; The keypoint prediction branch is used to extract the visible geometric features of the target region of interest, and to regress and predict the coordinates of the four vertices of the feature surface in the target region of interest based on the visible geometric features.
[0010] In a further embodiment, distortion determination of the feature surface is performed based on the vertex coordinates, specifically as follows: Step 301: Extract the geometric edge features of the feature surface, calculate the parallelism or convergence of the geometric edge features in the image space. If the parallelism is higher than the first preset threshold or the convergence is lower than the second preset threshold, it is determined to be a frontal view and no distortion correction is required. Proceed directly to step 4. Otherwise, it is determined to be a non-frontal view and step 302 is executed. Step 302: Determine whether there is perspective distortion in the non-frontal view based on the extension and intersection relationship of the geometric edge features in the image space or the polygonal shape of the feature surface, and perform preset perspective distortion correction when perspective distortion exists, and then proceed to step 4.
[0011] In a further embodiment, the preset perspective distortion correction specifically includes: Step 303: Construct a standard orthogonal projection coordinate system based on the prior value of the physical width of the marker stone, and determine the coordinates of the standard rectangle vertices of the corresponding plane without distortion in the standard orthogonal projection coordinate system. Step 304: Establish the mapping relationship between the pixel coordinates of the four vertices of the feature surface with perspective distortion and the vertex coordinates of the standard rectangle, and construct the homography transformation matrix based on the mapping relationship; Step 305: Based on the homography transformation matrix, perform pixel remapping and interpolation processing on the image region of the feature surface to reconstruct the image region of the feature surface into a standard orthogonal image without perspective distortion.
[0012] In a further embodiment, the current physical height of the target stone is calculated as follows: Step 401: Extract the pixel width and pixel height of the target stone in the distortion-free feature surface image; Step 402: Calculate the current mapping ratio based on the pixel width and the prior value of the physical width; Step 403: Based on the current mapping ratio, transform the pixel height into the current physical height of the target stone to be measured; The distortion-free feature surface image includes the original distortion-free feature surface image or a standard orthogonal image that has been corrected for distortion.
[0013] A second aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described monocular vision-based method for detecting the height of a marker with anti-distortion.
[0014] A third aspect of the present invention provides a marker height anti-distortion detection device, including a computer-readable storage medium and a processor, wherein the processor executes a computer program on the computer-readable storage medium to implement the steps of the marker height anti-distortion detection method based on monocular vision described above.
[0015] A fourth aspect of this invention provides a monocular vision-based target height anti-distortion detection device, comprising an image acquisition module, a target detection module, a distortion correction module, and a height output module. The image acquisition module is used to acquire images of the target stone to be tested; The target detection module is used to input the image of the target stone to be tested into a pre-trained joint regression model of target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box; The distortion correction module is used to determine the distortion of the feature surface based on the vertex coordinates, and to perform preset perspective distortion correction when perspective distortion exists, thereby generating a corresponding standard orthogonal image. The height output module is used to determine the mapping ratio between the image pixel scale and the real physical scale based on the distortion-free feature surface image and the preset physical size of the marker stone, and to calculate the current physical height of the marker stone to be measured based on the mapping ratio.
[0016] The beneficial effects of this invention are as follows: This invention provides a method, apparatus, and device for detecting the height of a marker with anti-distortion based on monocular vision, which has the following beneficial effects: (1) It decouples the dependence on special hardware such as lidar and binocular cameras as well as camera intrinsic parameters. Any single RGB two-dimensional photo taken by any type of smartphone, portable camera or ordinary monitoring probe can be directly used for high-precision height measurement as long as it contains a marker stone, which greatly reduces the promotion cost of large-scale deployment.
[0017] (2) An innovative dual-branch adaptive mechanism of “view classification + homography perspective correction” is adopted, so that the inspectors do not need to deliberately find the front alignment angle. Even if it is a side view or top view photo taken casually, the method of this invention can eliminate perspective error through geometric reconstruction and achieve the same accuracy as front view.
[0018] (3) The traditional bottom edge extraction was abandoned and a key point overall regression strategy based on deep learning was adopted. Even under harsh field conditions such as weeds covering the roots of the marker stone, mud on the surface or reflection, the present invention can still predict the accurate reference corner point through overall geometric feature regression, ensuring the stability and success rate of detection.
[0019] To make the above-mentioned objects, features and advantages of the invention more apparent and understandable, preferred embodiments of the invention are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the monocular vision-based anti-distortion detection method for marker height provided in Example 1; Figure 2a This is a schematic diagram of the frontal view of the marker image processing flow in the method provided in Example 1; Figure 2b This is a schematic diagram of the side view marker image processing flow in the method provided in Example 1; Figure 3 This is a schematic diagram of the monocular vision-based anti-distortion detection device for marker height provided in Example 2; Figure 4 This is a schematic diagram of the structure of the marker height anti-distortion detection device provided in Example 3. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0023] It should be noted that, unless otherwise specified, the various features in the embodiments of this invention can be combined with each other, all of which are within the protection scope of this invention. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this invention do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0024] Figure 1 This is a flowchart illustrating a monocular vision-based method for detecting marker height with anti-distortion capabilities, as provided in Example 1. Figure 1 As shown, it includes the following steps: Step 1: Acquire the image of the target stone. The image of the target stone is a digital image acquired by a monocular imaging device. The monocular imaging device includes portable electronic devices, camera devices, or unmanned aerial vehicles with a monocular optical system. That is, RGB target stone images acquired by any type of mobile phone, tablet, monocular camera, or drone monocular lens can be used for target stone height detection using the direction of this embodiment of the invention.
[0025] Step 2: Input the image of the target stone to be tested into a pre-trained joint regression model for target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box, such as the coordinates of the four vertices of the main view surface within the detection box or the coordinates of the four vertices of the side view surface within the detection box.
[0026] Step 3: Based on the vertex coordinates, the feature surface is distorted, and when perspective distortion exists, a preset perspective distortion correction is performed to generate the corresponding standard orthogonal image; Step 4: Based on the preset physical size of the marker stone and the undistorted feature surface image, including the undistorted original feature surface image or the standard orthogonal image after distortion correction, determine the mapping ratio between the image pixel scale and the real physical scale, and calculate the current physical height of the marker stone to be measured based on the mapping ratio.
[0027] The above embodiments provide a monocular vision-based anti-distortion detection method for marker height. By introducing a lightweight target detection and key point joint regression model, it can accurately identify the coordinates of each vertex of the marker target plane, such as the main view plane, even in complex occlusion environments or under non-ideal shooting angles. After distortion and perspective correction, it accurately outputs the true physical height of the marker, realizing automated and high-precision measurement of marker height. It has extremely low equipment dependence and strong environmental robustness, greatly reducing the shooting burden and inspection costs for staff.
[0028] The following specific embodiments will be used to describe each step of the above method in detail.
[0029] In one specific embodiment, the joint target detection and keypoint regression model includes a target detection branch and a keypoint prediction branch. The target detection branch is used to perform coarse target localization and background stripping on the image of the target marker, and to cut out the region of interest (ROI), thereby shielding large areas of cluttered outdoor background at the image level. The keypoint prediction branch is used to extract the visible geometric features of the ROI and reconstruct the feature surfaces of the ROI based on the visible geometric features, such as the front view or side view. This way, even if the bottom of the marker is partially occluded, the coordinates of the four vertices of the complete front view or complete side view of the marker can still be predicted based on the visible geometric features of the upper half of the marker cuboid. Figure 2a and Figure 2b As shown.
[0030] As those skilled in the art will know, the joint target detection and keypoint regression model can employ a mainstream neural network model such as YOLO, including a feature extraction backbone network, a detection head branch, and a keypoint regression branch. The feature extraction backbone network is used to extract deep semantic features from the target stone image, the detection head branch is used to generate the target detection box of the target stone based on the deep semantic features, and the keypoint regression branch is used to directly regress and predict the pixel coordinates of the four vertices of the target stone feature surface within the target detection box based on the deep semantic feature map. The specific neural network structure will not be elaborated here. During the training of the neural network model, images of cuboid target stones in various scenes, including highlights, shadows, weed occlusion, and mud adhesion, are collected and a dataset is constructed to improve the robustness of the neural network model and the accuracy of target stone height detection.
[0031] For example, in a preferred embodiment, a dual-branch adaptive mechanism based on "viewpoint classification + homography perspective correction" is employed. This allows inspectors to eliminate the need to deliberately seek a frontal alignment angle; even casually taken side or top-view photos can have perspective errors eliminated through geometric reconstruction, achieving measurement accuracy equivalent to frontal shots. In specific implementation, distortion determination of the feature surface is performed based on the vertex coordinates, specifically as follows: Step 301: Extract the geometric edge features of the feature surface, calculate the parallelism or convergence of the geometric edge features in the image space. If the parallelism is higher than the first preset threshold or the convergence is lower than the second preset threshold, such as when the vertical edges are parallel, it is determined to be a frontal view and no distortion correction is required. Proceed directly to step 4 to calculate the actual height of the marker stone. Otherwise, it is determined to be a non-frontal view and step 302 is executed. Step 302: Determine the non-frontal view based on the extension and intersection relationship of the geometric edge features in the image space or the polygonal shape of the feature surface. For example, determine whether there is perspective distortion in the side view or top view by whether the polygon is trapezoidal or whether there is a vanishing point. If there is perspective distortion, perform preset perspective distortion correction and then calculate the actual height of the marker stone.
[0032] In one specific embodiment, a preset perspective distortion correction is performed, specifically as follows: Step 303: Construct a standard orthogonal projection coordinate system based on the prior value of the physical width of the marker stone, and determine the coordinates of the standard rectangle vertices of the corresponding plane without distortion in the standard orthogonal projection coordinate system. Step 304: Establish the mapping relationship between the pixel coordinates of the four vertices of the feature surface with perspective distortion and the vertex coordinates of the standard rectangle, and construct the homography transformation matrix based on the mapping relationship; Step 305: Based on the homography transformation matrix, pixel remapping and interpolation processing is performed on the image region of the feature surface to reconstruct the image region of the feature surface into a standard orthogonal image without perspective distortion. Therefore, it is not necessary to obtain the camera intrinsic parameters of the shooting device (including focal length, sensor size, etc.). The perspective transformation of the image is performed only by using the physical prior knowledge of the width of the marker stone, and the quadrilateral perspective distortion caused by the side view is forcibly "flattened" and reconstructed into a standard rectangular image without perspective error.
[0033] In a further preferred embodiment, step 4, calculating the current physical height of the target stone, specifically involves: Step 401: Extract the pixel width of the target stone from the distortion-free feature surface image. and pixel height .
[0034] Step 402, based on the pixel width and the physical width prior value Calculate the current mapping ratio, i.e. The prior value of this physical width It is a known fixed value.
[0035] Step 403, adjust the pixel height based on the current mapping ratio. Transformed into the current physical height of the target stone. ,Right now This allows for high-precision height measurement by directly utilizing two-dimensional photographs of the marker stones.
[0036] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0037] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the monocular vision-based anti-distortion detection method for marker height described above.
[0038] Figure 3 This is a schematic diagram of the monocular vision-based anti-distortion detection device for marker height provided in Example 2, as shown below. Figure 3 As shown, it includes an image acquisition module 100, a target detection module 200, a distortion correction module 300, and a height output module 400. The image acquisition module 100 is used to acquire images of the target stone to be tested; The target detection module 200 is used to input the image of the target stone to be tested into a pre-trained joint regression model of target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box; The distortion correction module 300 is used to determine the distortion of the feature surface based on the vertex coordinates, and to perform preset perspective distortion correction when perspective distortion exists, thereby generating a corresponding standard orthogonal image. The height output module 400 is used to determine the mapping ratio between the image pixel scale and the real physical scale based on the distortion-free feature surface image and the preset physical size of the marker stone, and to calculate the current physical height of the marker stone to be measured based on the mapping ratio.
[0039] The above embodiments provide a monocular vision-based anti-distortion detection device for marker height. By introducing a lightweight target detection and key point joint regression model, it can accurately identify the coordinates of each vertex of the marker target plane, such as the main view plane, even in complex occlusion environments or under non-ideal shooting angles. After distortion and perspective correction, it accurately outputs the true physical height of the marker, realizing automated and high-precision measurement of marker height. It has extremely low equipment dependence and strong environmental robustness, greatly reducing the shooting burden and inspection costs for staff.
[0040] In a preferred embodiment, the distortion correction module 300 specifically includes: The viewpoint determination unit 301 is used to extract the geometric edge features of the feature surface, calculate the parallelism or convergence of the geometric edge features in the image space, and if the parallelism is higher than a first preset threshold or the convergence is lower than a second preset threshold, it is determined to be a frontal viewpoint and no distortion correction is required; otherwise, it is determined to be a non-frontal viewpoint. The distortion determination unit 302 is used to determine whether there is perspective distortion in the non-frontal view based on the extension and intersection relationship of the geometric edge features in the image space or the polygonal shape of the feature surface, and to drive the distortion correction unit 303 when perspective distortion exists.
[0041] In a preferred embodiment, the distortion correction unit 303 specifically includes: The coordinate system construction unit is used to construct a standard orthogonal projection coordinate system based on the prior value of the physical width of the marker stone, and to determine the coordinates of the standard rectangle vertices of the corresponding plane without distortion in the standard orthogonal projection coordinate system. A transformation construction unit is used to establish a mapping relationship between the pixel coordinates of the four vertices of the feature surface with perspective distortion and the vertex coordinates of the standard rectangle, and to construct a homography transformation matrix based on the mapping relationship; The reconstruction unit is used to perform pixel remapping and interpolation processing on the image region of the feature surface based on the homography transformation matrix, and reconstruct the image region of the feature surface into a standard orthogonal image without perspective distortion.
[0042] In a preferred embodiment, the height output module 400 specifically includes: The parameter extraction unit is used to extract the pixel width and pixel height of the target stone in the distortion-free feature surface image; A ratio calculation unit is used to calculate the current mapping ratio based on the pixel width and the prior value of the physical width; The mapping unit is used to transform the pixel height into the current physical height of the target stone based on the current mapping ratio.
[0043] It should be noted that the foregoing explanation of the monocular vision-based marker height anti-distortion detection method embodiment also applies to the monocular vision-based marker height anti-distortion detection device of the above embodiment, and will not be repeated here.
[0044] This invention also provides a marker height anti-distortion detection device, including a computer-readable storage medium and a processor. When the processor executes a computer program on the computer-readable storage medium, it implements the steps of the marker height anti-distortion detection method based on monocular vision described above.
[0045] Figure 4 This is a schematic diagram of the structure of the marker height anti-distortion detection device provided in Embodiment 3 of the present invention, as shown below. Figure 4 As shown, the marker height anti-distortion detection device 8 of this embodiment includes: a processor 80, a readable storage medium 81, and a computer program 82 stored in the readable storage medium 81 and executable on the processor 80. When the processor 80 executes the computer program 82, it implements the steps in the various method embodiments described above, for example... Figure 1 The steps shown. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module in the above-described device embodiments, for example... Figure 3 The functions of the module shown.
[0046] For example, the computer program 82 may be divided into one or more modules, which are stored in the readable storage medium 81 and executed by the processor 80 to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 82 in the benchmark height anti-distortion detection device 8.
[0047] The marker height anti-distortion detection device 8 may include, but is not limited to, a processor 80 and a readable storage medium 81. Those skilled in the art will understand that... Figure 4 This is merely an example of the marker height anti-distortion testing device 8 and does not constitute a limitation on the marker height anti-distortion testing device 8. It may include more or fewer components than shown, or combine certain components, or different components. For example, the marker height anti-distortion testing device may also include a power management module, a computing processing module, input / output devices, network access devices, buses, etc.
[0048] The processor 80 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0049] The readable storage medium 81 can be an internal storage unit of the benchmark height distortion correction detection device 8, such as a hard drive or memory of the benchmark height distortion correction detection device 8. The readable storage medium 81 can also be an external storage device of the benchmark height distortion correction detection device 8, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the benchmark height distortion correction detection device 8. Furthermore, the readable storage medium 81 can include both internal storage units and external storage devices of the benchmark height distortion correction detection device 8. The readable storage medium 81 is used to store the computer program and other programs and data required by the benchmark height distortion correction detection device. The readable storage medium 81 can also be used to temporarily store data that has been output or will be output.
[0050] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0051] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0052] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0053] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0054] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0055] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0056] The present invention is not limited to the description in the specification and embodiments, and thus other advantages and modifications can be readily realized by those skilled in the art. Therefore, the present invention is not limited to the specific details, representative devices and illustrated examples shown and described herein without departing from the spirit and scope of the general concept as defined by the claims and their equivalents.
Claims
1. A method for detecting the height of a marker with high anti-distortion based on monocular vision, characterized in that, Includes the following steps: Step 1: Obtain the image of the target stone; Step 2: Input the image of the target stone to be tested into a pre-trained joint regression model for target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box; Step 3: Based on the vertex coordinates, the feature surface is distorted, and when perspective distortion exists, a preset perspective distortion correction is performed to generate the corresponding standard orthogonal image; Step 4: Based on the distortion-free feature surface image and the preset physical size of the marker stone, determine the mapping ratio between the image pixel scale and the real physical scale, and calculate the current physical height of the marker stone to be measured based on the mapping ratio.
2. The method for detecting the height of a marker with high anti-distortion based on monocular vision according to claim 1, characterized in that, The image of the target stone to be tested is a digital image acquired by a monocular imaging device, which includes a portable electronic device, camera equipment, or unmanned aerial vehicle equipped with a monocular optical system.
3. The method for detecting the height of a marker with high anti-distortion based on monocular vision according to claim 1, characterized in that, A target image dataset is constructed, and the joint regression model for target detection and key points is trained based on the target image dataset. The target image dataset contains several target images in scenes with highlights, shadows, weed occlusion, and mud adhesion.
4. The method for detecting the height of a marker with high anti-distortion based on monocular vision according to claim 1, characterized in that, The joint regression model for object detection and keypoints includes an object detection branch and a keypoint prediction branch. The target detection branch is used to perform coarse target localization and background stripping on the target image, and to cut out the target region of interest; The keypoint prediction branch is used to extract the visible geometric features of the target region of interest, and to regress and predict the coordinates of the four vertices of the feature surface in the target region of interest based on the visible geometric features.
5. The method for detecting the height of a marker based on monocular vision with anti-distortion capability according to any one of claims 1-4, characterized in that, Distortion determination of the feature surface based on the vertex coordinates is specifically as follows: Step 301: Extract the geometric edge features of the feature surface, calculate the parallelism or convergence of the geometric edge features in the image space. If the parallelism is higher than the first preset threshold or the convergence is lower than the second preset threshold, it is determined to be a frontal view and no distortion correction is required. Proceed directly to step 4. Otherwise, it is determined to be a non-frontal view and step 302 is executed. Step 302: Determine whether there is perspective distortion in the non-frontal view based on the extension and intersection relationship of the geometric edge features in the image space or the polygonal shape of the feature surface, and perform preset perspective distortion correction when perspective distortion exists, and then proceed to step 4.
6. The method for detecting the height of a marker with high anti-distortion based on monocular vision according to claim 5, characterized in that, The aforementioned preset perspective distortion correction specifically includes: Step 303: Construct a standard orthogonal projection coordinate system based on the prior value of the physical width of the marker stone, and determine the coordinates of the standard rectangle vertices of the corresponding plane without distortion in the standard orthogonal projection coordinate system. Step 304: Establish the mapping relationship between the pixel coordinates of the four vertices of the feature surface with perspective distortion and the vertex coordinates of the standard rectangle, and construct the homography transformation matrix based on the mapping relationship; Step 305: Based on the homography transformation matrix, perform pixel remapping and interpolation processing on the image region of the feature surface to reconstruct the image region of the feature surface into a standard orthogonal image without perspective distortion.
7. The method for detecting the height of a marker with high anti-distortion based on monocular vision according to claim 6, characterized in that, Calculate the current physical height of the target stone as follows: Step 401: Extract the pixel width and pixel height of the target stone in the distortion-free feature surface image; Step 402: Calculate the current mapping ratio based on the pixel width and the prior value of the physical width; Step 403: Based on the current mapping ratio, transform the pixel height into the current physical height of the target stone to be measured; The distortion-free feature surface image includes the original distortion-free feature surface image or a standard orthogonal image that has been corrected for distortion.
8. A monocular vision-based anti-distortion detection device for marker height, based on the method described in any one of claims 1-7, characterized in that, It includes an image acquisition module, an object detection module, a distortion correction module, and a height output module. The image acquisition module is used to acquire images of the target stone to be tested; The target detection module is used to input the image of the target stone to be tested into a pre-trained joint regression model of target detection and key points to obtain the detection box corresponding to the target stone and the coordinates of several vertices of the feature surface within the detection box; The distortion correction module is used to determine the distortion of the feature surface based on the vertex coordinates, and to perform preset perspective distortion correction when perspective distortion exists, thereby generating a corresponding standard orthogonal image. The height output module is used to determine the mapping ratio between the image pixel scale and the real physical scale based on the distortion-free feature surface image and the preset physical size of the marker stone, and to calculate the current physical height of the marker stone to be measured based on the mapping ratio.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the monocular vision-based anti-distortion detection method for marker height as described in any one of claims 1-7.
10. A marker height anti-distortion detection device, comprising a computer-readable storage medium and a processor, characterized in that, When the processor executes the computer program on the computer-readable storage medium, it implements the steps of the monocular vision-based marker height anti-distortion detection method according to any one of claims 1-7.