Distance measurement method, device, system and equipment and readable storage medium
By setting up a light emitting body on the target and using image acquisition components and image processing technology, the problems of low accuracy and complex operation of traditional distance measurement methods are solved, and efficient and accurate distance measurement is achieved.
Patent Information
- Application Number
- CN202411997191.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-13
AI Technical Summary
The traditional distance measurement method has problems such as low measurement efficiency, low accuracy and complex operation.
By setting at least two luminescent bodies on the target, the target image is acquired using the image acquisition component, and the distance between the target and the image acquisition component is determined in combination with image processing technology and geometric principles.
Remote high-precision distance measurement is realized, the measurement process is simplified, the measurement efficiency is improved, and the dependence on the external environment is reduced.
Smart Images

Figure CN119984170A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distance measurement technology, and in particular to a distance measurement method, device, system, equipment and readable storage medium. Background Art
[0002] In modern engineering surveying, geographic surveying and other fields, distance measurement is a vital task.
[0003] Traditional distance measurement methods include tape measure measurement, laser rangefinder measurement, and total station measurement.
[0004] Among them, tape measures are only suitable for close-range measurements. For long-distance measurements, the operation is not only cumbersome but also extremely inefficient. Laser rangefinders can achieve long-distance measurements to a certain extent, but are easily affected by the atmospheric environment (such as haze, rain, fog, high temperature, etc.) or lighting conditions, resulting in low measurement accuracy. Total station measurements require certain professional knowledge and operating skills, and the measurement process is relatively complicated. Summary of the invention
[0005] The present application provides a distance measurement method, device, system, equipment and readable storage medium, which can solve the technical problems of low measurement efficiency, low accuracy and complex operation in traditional distance measurement methods.
[0006] In a first aspect, the present application provides a distance measurement method, which is applied to a distance measurement device, wherein the distance measurement device includes an image acquisition component; the method includes:
[0007] Acquire a target image acquired by an image acquisition component; at least two luminous bodies are arranged on the surface of the target;
[0008] Determine the center coordinates of at least two luminous bodies in the target image;
[0009] Determine the distance value between the at least two luminous bodies in the target image according to the central coordinates;
[0010] The distance between the target and the image acquisition component is determined according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameters of the image acquisition component.
[0011] In some embodiments, the above-mentioned determining the center coordinates of the at least two luminous bodies in the target image includes:
[0012] Preprocessing the target image, and extracting the luminous body images corresponding to the at least two luminous bodies from the preprocessed target image;
[0013] Performing integer pixel edge detection on the luminous body image using an integer pixel edge detection algorithm to determine integer pixel level edge points of the luminous body image;
[0014] Performing sub-pixel edge detection on the integer-pixel edge points of the luminous body image using a sub-pixel edge detection algorithm to determine the sub-pixel edge points of the luminous body image;
[0015] The center coordinates of the light source are determined based on the sub-pixel edge points of the light source image.
[0016] In some embodiments, the method of determining the center coordinates of the luminous body according to the sub-pixel edge points of the luminous body image includes:
[0017] Using a least squares ellipse fitting algorithm to fit the sub-pixel edge points of the luminous body image, and determine the ellipse parameters of the ellipse edge corresponding to the luminous body image;
[0018] According to the ellipse parameters, the grayscale value of each sub-pixel edge point on the ellipse edge is determined;
[0019] According to the grayscale values of each sub-pixel edge point on the elliptical edge, a weighted centroid algorithm is used to determine the centroid position of the elliptical edge;
[0020] Based on the above-mentioned center of mass position, the center coordinates of the above-mentioned light source are determined.
[0021] In some embodiments, before acquiring the target image acquired by the image acquisition component, the method further includes:
[0022] Acquire multiple chessboard images acquired by the image acquisition component; different chessboard images are acquired by the image acquisition component when the preset chessboard is at different positions and / or at different angles;
[0023] Based on the above-mentioned multiple chessboard images, the above-mentioned image acquisition parameters are determined using Zhang Zhengyou calibration algorithm; the above-mentioned image acquisition parameters include focal length.
[0024] In some embodiments, the image acquisition parameters further include distortion coefficients; and the method of determining the image acquisition parameters based on the plurality of checkerboard images using the Zhang Zhengyou calibration algorithm includes:
[0025] Detecting corner points of the checkerboard in the checkerboard image;
[0026] Match the detected corner points with the corner points of the above chessboard;
[0027] Determine the above-mentioned distortion coefficient by using the matched corner point coordinates and the size of the above-mentioned chessboard; the above-mentioned distortion coefficient includes a radial distortion coefficient and / or a tangential distortion coefficient;
[0028] Before determining the distance between the target and the image acquisition component according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameter of the image acquisition component, the method further includes:
[0029] The above-mentioned distortion coefficient is used to correct the above-mentioned distance value and the spacing between the above-mentioned at least two light emitters on the target.
[0030] In some embodiments, the above method further comprises:
[0031] Acquire a training data set; the training data set includes a plurality of training samples; the training samples include the measured distance between the target and the image acquisition component, the actual distance between the target and the image acquisition component, and meteorological data during the measurement process;
[0032] The training model is trained based on the training data set to obtain an atmospheric refraction correction model;
[0033] After determining the distance between the target and the image acquisition component, the method further includes:
[0034] The meteorological data of the current measurement environment is obtained, and the distance between the determined target and the image acquisition component is corrected using the atmospheric refraction correction model according to the meteorological data of the current measurement environment.
[0035] In a second aspect, an embodiment of the present application provides a distance measurement device, the device comprising:
[0036] An image acquisition component is used to acquire a target image of a target; at least two luminous bodies are arranged on the surface of the target;
[0037] An acquisition module, used for acquiring a target image;
[0038] A determination module, used to determine the center coordinates of the at least two luminous bodies in the target image;
[0039] A detection module, used to determine the distance value between the at least two luminous bodies in the target image according to the central coordinates;
[0040] The calculation module is used to determine the distance between the target and the image acquisition component according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameters of the image acquisition component.
[0041] In a third aspect, an embodiment of the present application provides a distance measurement system, comprising: a distance measurement device and a target; at least two luminous bodies are arranged on the surface of the target;
[0042] The above-mentioned distance measuring device is the distance measuring device provided by the second aspect.
[0043] In some embodiments, the system further comprises a first stabilizing device and a second stabilizing device, and the first stabilizing device and the second stabilizing device both comprise a leveling base;
[0044] The distance measuring device is fixed on the first stabilizing device, and the target is fixed on the second stabilizing device.
[0045] In some embodiments, the image acquisition component in the distance measuring device includes a telecentric lens having a focal length range of 50 mm to 150 mm; and the light emitting body includes an infrared light emitting diode.
[0046] In a fourth aspect, an embodiment of the present application provides a distance measurement device, including: an image acquisition component, a memory, and a processor;
[0047] The memory is used to store computer programs;
[0048] The processor is used to execute the computer program stored in the memory to implement the distance measurement method provided in the first aspect.
[0049] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable storage medium is stored computer-executable instructions, which, when executed by a processor, are used to implement the distance measurement method provided in the first aspect.
[0050] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the distance measurement method provided in the first aspect.
[0051] The distance measurement method, device, system, equipment and readable storage medium provided in the present application can realize accurate measurement of the distance between the target and the image acquisition component by capturing the target image of the target and utilizing the light-emitting body on the target in combination with image processing technology and geometric principles. The entire measurement process is simple and fast and is not easily affected by the external environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0053] Figure 1A schematic diagram of the architecture of a distance measurement system provided in an embodiment of the present application;
[0054] Figure 2 A flow chart of a distance measurement method provided in an embodiment of the present application;
[0055] Figure 3 It is another schematic diagram of the architecture of a distance measurement system provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a program module of a distance measurement device provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of the hardware structure of a distance measurement device provided in an embodiment of the present application.
[0058] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0059] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0060] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0061] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first stabilizing device and the second stabilizing device are only used to distinguish between different stabilizing devices, and do not limit their order. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0062] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0063] Traditional distance measurement methods include tape measure, laser rangefinder and total station. Among them, tape measure is only suitable for close-range measurement, and for long-distance measurement, it is not only cumbersome to operate but also extremely inefficient; laser rangefinder can achieve long-distance measurement to a certain extent, but it is easily affected by the atmospheric environment (such as haze, rain, fog, high temperature, etc.) or lighting conditions, resulting in low measurement accuracy; total station measurement requires certain professional knowledge and operating skills, and the measurement process is relatively complicated.
[0064] In view of the above technical problems, a distance measurement method is provided in an embodiment of the present application. The method is based on machine vision technology, can realize remote high-precision distance measurement, and overcomes the defects of existing distance measurement methods such as low accuracy and complex operation in remote measurement.
[0065] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0066] Reference Figure 1 , Figure 1 1 is a schematic diagram of the architecture of a distance measurement system provided in an embodiment of the present application; the distance measurement system includes a distance measurement device 100 and a target 200 .
[0067] In some embodiments, the distance measuring device 100 includes an image acquisition component 101 , which can be used to acquire an image of the target 200 for subsequent analysis and distance calculation.
[0068] In some embodiments, the image acquisition component 101 may use a high-resolution measurement camera, and the number of pixels of the high-resolution measurement camera may be selected to be 12 million or more. Among them, the high number of pixels can ensure that a distant target has sufficient details in the target image, and the sensor size is large, which can receive more light and ensure the imaging quality under different lighting conditions.
[0069] In some embodiments, the image acquisition component 101 may include a telecentric lens with a focal length range of 50 to 150 mm. The telecentric lens can clearly image distant objects on the camera image sensor, reduce perspective deformation, and have small distortion, which is conducive to improving measurement accuracy.
[0070] In some embodiments, the distance measuring device 100 further includes a control module, which can be run on a computer connected to the image acquisition component 101 and is used to control the operation of the image acquisition component 101. For example, the parameters of the high-resolution measurement camera are set, including but not limited to trigger mode, exposure time, aperture size, sensitivity, etc. In addition, a real-time image preview function can be provided to facilitate operators to judge and adjust the image acquisition quality.
[0071] In some embodiments, at least two light emitters 201 are disposed on the surface of the target 200 .
[0072] Optionally, the surface of the target 200 may also be provided with a reference ruler, which may be used to provide a known physical size so as to facilitate determination of the actual physical distance between any two light emitters 201 on the target.
[0073] Optionally, the light emitting body may be an infrared light emitting diode.
[0074] In some implementations, a specific optical structure may be used to concentrate the infrared radiation of the infrared light emitting diodes in a certain direction and range.
[0075] For example, a convex lens can be used to focus the light emitted by the above-mentioned light source to a point or a line to form a parallel beam or a conical beam. By adjusting the focal length and position of the convex lens, the divergence angle and direction of the light beam can be controlled.
[0076] Optionally, the luminous intensity of the above-mentioned luminous body is adjustable and has the ability to penetrate rain and fog.
[0077] The distance measurement method provided in the embodiment of the present application can be executed by the distance measurement device 100 in the above-mentioned distance measurement system.
[0078] Reference Figure 2 , Figure 2This is a flow chart of a distance measurement method provided in an embodiment of the present application. In some embodiments of the present application, the distance measurement method may include:
[0079] S201, acquiring a target image captured by an image acquisition component; at least two light-emitting bodies are arranged on the surface of the target.
[0080] During the measurement process, the distance measuring device and the target can be placed at appropriate positions according to the measurement task, for example, the distance measuring device and the target can be placed at the measurement start point and the measurement end point respectively. In addition, it is also necessary to ensure that the image acquisition component and the target are at the correct angle, and there is no obstruction between the image acquisition component and the target, so that the image acquisition component can clearly and completely capture the target image on the target surface.
[0081] For example, in some embodiments, the image acquisition component can be adjusted to aim at the target according to the measurement task. During the aiming process, the real-time preview function of the image acquisition component can be used to accurately adjust the azimuth and pitch angle of the image acquisition component to ensure that the target is located in the center area of the image. Then, the target image is acquired according to the preset parameters (such as exposure time, resolution, etc.).
[0082] In some embodiments, the collected target image may be preprocessed, for example, by using a filtering algorithm to reduce noise. The signal-to-noise ratio of the preprocessed image may be increased by 20%-30%, providing more reliable data for subsequent processing.
[0083] In some embodiments, the distance between any two light emitters on the target can be predetermined and input into the distance measuring device in advance.
[0084] S202: Determine the center coordinates of the at least two luminous bodies in the target image.
[0085] In some embodiments, the luminous bodies in the target image may be identified first, and then an edge detection algorithm may be used to identify the edges of the luminous bodies. For each luminous body identified, the coordinates of its centroid (or geometric center) are calculated, and the coordinates are the center coordinates of the luminous body.
[0086] S203. Determine the distance value between the at least two light emitters in the target image according to the center coordinates.
[0087] In some embodiments, assuming that two luminous bodies are disposed on the surface of the target, and the center coordinates of the two luminous bodies in the target image are (x1, y1) and (x2, y2), respectively, then the distance value d between the two luminous bodies in the target image can be calculated by the following formula:
[0088]
[0089] The distance value d is in pixels.
[0090] S204: Determine the distance between the target and the image acquisition component according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameters of the image acquisition component.
[0091] In some embodiments, the image acquisition parameter is the focal length of the image acquisition component.
[0092] In some implementations, the unit of the distance value d may be converted into the same unit as the distance between the two light emitters on the target based on the pixel size of the image acquisition component to obtain the distance value d'.
[0093] In some embodiments, the distance D between the target and the image acquisition component can be calculated based on the principle of similar triangles according to the distance value d', the spacing L between the at least two light emitters on the target, and the focal length f of the image acquisition component.
[0094] Exemplarily, the distance D can be calculated by the following formula:
[0095]
[0096] The distance measurement method provided in the embodiment of the present application can accurately measure the distance between the target and the image acquisition component by capturing the target image of the target and utilizing the light-emitting body on the target in combination with image processing technology and geometric principles. The entire measurement process is simple and fast and is not easily affected by the external environment.
[0097] Based on the contents described in the above embodiments, in some embodiments, determining the center coordinates of at least two illuminants in the target image in the above step S202 specifically includes:
[0098] s1. Preprocess the target image and extract luminous body images corresponding to at least two luminous bodies from the preprocessed target image.
[0099] Optionally, in some embodiments, the above pretreatment includes but is not limited to:
[0100] Grayscale conversion: Convert the color target image to a grayscale image. Grayscale images only contain brightness information, not color information, which helps to simplify subsequent processing.
[0101] Noise removal: Apply filters (such as Gaussian filters) to smooth the image, reduce noise and interference, and improve the recognition accuracy of light sources.
[0102] Contrast enhancement: Contrast enhancement techniques can be used to increase the contrast between the light source and the background, making the light source easier to identify.
[0103] Binarization: Convert the above grayscale image into a binary image, which contains only black and white colors. By setting a suitable threshold, the luminous area can be separated from the background area.
[0104] In some embodiments, all connected regions can be identified and marked in the binary image. The connected region refers to a set of pixels that are connected to each other in the image (in the binary image, pixels with a pixel value of 1 are connected to each other). Based on the size, shape and other characteristics of the connected region, at least two connected regions that meet the characteristics of the luminous body are screened out. For each screened connected region, the corresponding luminous body image is extracted from the original grayscale image or color image.
[0105] s2. Perform integer pixel edge detection on the above-mentioned luminous body image using an integer pixel edge detection algorithm to determine the integer pixel level edge points of the above-mentioned luminous body image.
[0106] In some implementations, an integer pixel edge detection algorithm, such as Canny edge detection, Sobel edge detection, or Prewitt edge detection, may be preselected, and integer pixel level edge points of the luminous object image may be detected based on the selected edge detection algorithm.
[0107] s3. Perform sub-pixel edge detection on the integer-pixel edge points of the above-mentioned luminous body image using a sub-pixel edge detection algorithm to determine the sub-pixel edge points of the above-mentioned luminous body image.
[0108] In some implementations, a sub-pixel edge detection algorithm may be selected as needed, such as a moment method, an interpolation method, a fitting method, etc. The sub-pixel edge points of the luminous body image are detected using the selected sub-pixel edge detection algorithm.
[0109] Among them, the above-mentioned sub-pixel edge detection can provide more accurate edge position information, thereby improving the calculation accuracy of the center coordinates.
[0110] s4. Determine the center coordinates of the above-mentioned light source based on the sub-pixel edge points of the above-mentioned light source image.
[0111] In some embodiments, for each sub-pixel edge point of a light emitter, its centroid (or geometric center) may be calculated as the center coordinate of the light emitter. The centroid coordinate may be obtained by calculating the weighted average of the edge point coordinates.
[0112] In some embodiments, the method of determining the center coordinates of the luminous body according to the sub-pixel edge points of the luminous body image includes:
[0113] s4.1. Use the least squares ellipse fitting algorithm to fit the sub-pixel edge points of the above-mentioned luminous body image, and determine the ellipse parameters of the elliptical edge corresponding to the above-mentioned luminous body image.
[0114] In some embodiments, a least squares ellipse fitting algorithm may be used to fit the sub-pixel edge points of the luminous body image, and the least squares ellipse fitting algorithm may find an optimal ellipse such that the distances from these points to the ellipse are minimized (under a certain metric).
[0115] After the fitting is completed, the least squares ellipse fitting algorithm can output the parameters of the ellipse, including the coordinates of the center of the ellipse, the lengths of the major axis and the minor axis, and the rotation angle of the ellipse.
[0116] s4.2. Determine the grayscale value of each sub-pixel edge point on the edge of the ellipse according to the ellipse parameters.
[0117] In some implementations, since the sub-pixel edge points may not be integer pixel coordinates, it is necessary to obtain the grayscale values of these points through interpolation (such as bilinear interpolation).
[0118] s4.3. According to the grayscale values of each sub-pixel edge point on the elliptical edge, a weighted centroid algorithm is used to determine the centroid position of the elliptical edge.
[0119] In some embodiments, a weighted centroid algorithm may be used to calculate the centroid position of the elliptical edge. Optionally, the weight of each sub-pixel edge point may be set to the grayscale value (or a function of the grayscale value) of the sub-pixel edge point to reflect its contribution to the centroid position.
[0120] s4.4. Determine the center coordinates of the above-mentioned light source based on the above-mentioned center of mass position.
[0121] In some embodiments, the centroid position obtained by the weighted centroid algorithm can more accurately reflect the actual center of the above-mentioned light source.
[0122] Through the above embodiments, the center coordinates of the light source can be accurately determined with an accuracy of 1 / 10 pixel.
[0123] Based on the contents described in the above embodiments, in some embodiments of the present application, before measuring, the above image acquisition parameters may also be calibrated, including:
[0124] Acquire multiple checkerboard images acquired by the image acquisition component; different checkerboard images are acquired by the image acquisition component when the preset checkerboard is at different positions and / or different angles; based on the above multiple checkerboard images, use Zhang Zhengyou calibration algorithm to determine the image acquisition parameters of the above image acquisition component.
[0125] In some embodiments, a chessboard of known size may be placed at different distances and angles, and photographed multiple times using the image acquisition component. The photographed images may be analyzed and image acquisition parameters of the image acquisition component may be calculated using a specific mathematical model.
[0126] For example, within a distance range of 20-30m, a checkerboard is placed every 1m for shooting, and the checkerboard is rotated 10-30 degrees each time. By processing these image data, accurate image acquisition parameters of the above-mentioned image acquisition component can be obtained, and its accuracy can reach within 0.1%.
[0127] Optionally, the chessboard may use black and white square grids, and the size of each grid is known and precise.
[0128] Optionally, the above-mentioned image acquisition parameters may include focal length, principal point coordinates, distortion coefficient, etc.
[0129] In some embodiments, the corner points of the chessboard in the above-mentioned chessboard image can be detected; the detected corner points are matched with the corner points of the above-mentioned chessboard; the above-mentioned distortion coefficient is determined using the matched corner point coordinates and the size of the chessboard; the above-mentioned distortion coefficient includes a radial distortion coefficient and / or a tangential distortion coefficient.
[0130] Since the positions of the corners of the chessboard in the real world are known (based on the size and number of squares in the chessboard), the detected corners can be matched to these known positions. Once the positions of the corners in the image and the real world are matched, the position information can be used to calculate the distortion coefficients of the measurement camera.
[0131] Radial distortion is caused by imperfections in the shape of the lens (such as barrel distortion or pincushion distortion), which makes straight lines in the image appear bent, while tangential distortion is caused by imperfect alignment between the lens and the image sensor, which makes straight lines in the image appear tilted.
[0132] Optionally, in order to calculate the above-mentioned distortion coefficient, a Zhang Zhengyou calibration algorithm can be used, which can use multiple checkerboard images at different positions and / or angles, and corresponding corner point coordinates to determine the above-mentioned distortion coefficient.
[0133] Through the above implementation, the image acquisition parameters of the above image acquisition component can be determined, and these image acquisition parameters can be used in subsequent image correction and measurement processes to help improve the accuracy and reliability of measurement.
[0134] In some embodiments, before determining the distance between the target and the image acquisition component, the distortion coefficient may be used to correct the distance value and the spacing between the at least two light emitters on the target.
[0135] Through the above implementation, the image acquisition component can be accurately calibrated, thereby eliminating measurement errors caused by factors such as camera distortion and installation errors, improving the accuracy and reliability of subsequent measurements, and enabling measurement accuracy to reach millimeter level.
[0136] Based on the contents described in the above embodiments, in some embodiments of the present application, after the measurement results are obtained, the measurement results may be verified and optimized.
[0137] In some embodiments, a variety of methods may be used to verify the measurement results. For example, a laser rangefinder may be used to measure a target at the same location, and the obtained measurement results may be compared with the measurement results measured by the distance measurement device to determine whether the measurement results measured by the distance measurement device are accurate.
[0138] In some embodiments, the distance measuring device is optimized according to the verification of the measurement result. For example, if the measurement result measured by the distance measuring device has a large deviation, the system can be recalibrated to check whether the image acquisition parameters have changed.
[0139] In some implementations, related image processing algorithms may also be optimized, for example, edge detection thresholds may be adjusted, feature extraction methods may be improved, and the like.
[0140] In some implementations, the impact of environmental factors (such as light changes, atmospheric refraction, etc.) on the measurement can also be considered, and corresponding compensation measures can be taken, such as using a light compensation algorithm, establishing an atmospheric refraction correction model, etc., to continuously improve the accuracy and reliability of the measurement system.
[0141] Specifically, in some embodiments, a training data set can be obtained; the training data set includes multiple groups of training samples; the training samples include the measured distance between the target and the image acquisition component, the actual distance between the target and the image acquisition component, and meteorological data during the measurement process; the training model is trained based on the above training data set to obtain an atmospheric refraction correction model.
[0142] After determining the distance between the target and the image acquisition component, the meteorological data of the current measurement environment is obtained, and the determined distance between the target and the image acquisition component is corrected based on the meteorological data of the current measurement environment using the above-mentioned atmospheric refraction correction model.
[0143] Optionally, the above-mentioned meteorological data may include temperature, humidity, air pressure, etc.
[0144] In some embodiments of the present application, the distance measurement device may further include a data visualization and reporting module, which may be used to display the measurement results in an intuitive manner after obtaining the measurement results. For example, an image of the measurement target may be displayed through a graphical interface, measurement points and measurement results may be marked, and a measurement report may be generated.
[0145] Optionally, the above measurement report may include basic information of the measurement target, measurement time, measurement distance, measurement accuracy, etc., and may be saved in a text file, PDF, etc. format to facilitate user recording, analysis and archiving.
[0146] Reference Figure 3 , Figure 3 Another architectural schematic diagram of a distance measurement system provided in an embodiment of the present application; in some embodiments, the distance measurement system also includes a first stabilizing device 300 and a second stabilizing device 400, the first stabilizing device 300 includes a leveling base 301 and a bracket 302, and the second stabilizing device 400 includes a leveling base 401 and a bracket 402.
[0147] The distance measuring device 100 is fixed on the first stabilizing device 300 , and the target 200 is fixed on the second stabilizing device 400 .
[0148] The leveling base 301 can be used to adjust the levelness of the distance measuring device 10 to ensure that the distance measuring device 10 remains stable and accurate during use.
[0149] The leveling base 401 can be used to adjust the level of the target 200 to ensure that the target 200 remains stable and accurate during use.
[0150] Optionally, the leveling base 301 and the leveling base 401 may include a plummet.
[0151] In some embodiments, the leveling base 301 can adjust the distance measuring device 10 to a desired level by means of an adjustment mechanism (such as a screw). Optionally, the leveling base 301 may include a bracket, an adjustment screw, and a level gauge. By rotating the adjustment screw, the height of the base can be changed, thereby adjusting the level of the distance measuring device 10. The level gauge is used to indicate the current level state, helping the user to make precise adjustments.
[0152] The principle of the leveling base 401 is similar to that of the leveling base 301 .
[0153] The first stabilizing device 300 can provide stable support for the distance measuring device 100. The bracket 302 has sufficient strength and stability to bear the weight of the image acquisition component 101 and to maintain the stability of the image acquisition component 101 under external environmental interference (such as wind, vibration, etc.).
[0154] Similarly, the second stabilizing device 400 can provide stable support for the target 200. The bracket 402 also has sufficient strength and stability to bear the weight of the target 200 and maintain the stability of the target 200 under external environmental interference (such as wind, vibration, etc.).
[0155] The distance measurement method provided by the embodiment of the present application is described in detail above with reference to a plurality of drawings. The distance measurement device provided by the embodiment of the present application is described below with reference to the drawings.
[0156] Reference Figure 4 , Figure 4 Schematic diagram of a program module of a distance measuring device provided in an embodiment of the present application. In some embodiments, the distance measuring device 40 includes:
[0157] The image acquisition component 401 is used to acquire a target image of a target; at least two light emitters are arranged on the surface of the target.
[0158] The acquisition module 402 is used to acquire a target image.
[0159] The determination module 403 is used to determine the center coordinates of the at least two light sources in the target image.
[0160] The detection module 404 is used to determine the distance value between the at least two light emitters in the target image according to the central coordinates.
[0161] The calculation module 405 is used to determine the distance between the target and the image acquisition component according to the distance value, the distance between the at least two light emitters on the target, and the image acquisition parameters of the image acquisition component.
[0162] In some implementations, the determination module 403 is specifically configured to:
[0163] Preprocessing the target image, and extracting the luminous body images corresponding to the at least two luminous bodies from the preprocessed target image;
[0164] Performing integer pixel edge detection on the luminous body image using an integer pixel edge detection algorithm to determine integer pixel level edge points of the luminous body image;
[0165] Performing sub-pixel edge detection on the integer-pixel edge points of the luminous body image using a sub-pixel edge detection algorithm to determine the sub-pixel edge points of the luminous body image;
[0166] The center coordinates of the light source are determined based on the sub-pixel edge points of the light source image.
[0167] In some implementations, the determination module 403 is specifically configured to:
[0168] Using a least squares ellipse fitting algorithm to fit the sub-pixel edge points of the luminous body image, and determine the ellipse parameters of the ellipse edge corresponding to the luminous body image;
[0169] According to the ellipse parameters, the grayscale value of each sub-pixel edge point on the ellipse edge is determined;
[0170] According to the grayscale values of each sub-pixel edge point on the elliptical edge, a weighted centroid algorithm is used to determine the centroid position of the elliptical edge;
[0171] Based on the above-mentioned center of mass position, the center coordinates of the above-mentioned light source are determined.
[0172] In some embodiments, the distance measurement device further includes a calibration module, which is used to:
[0173] Acquire multiple chessboard images acquired by the image acquisition component; different chessboard images are acquired by the image acquisition component when the preset chessboard is at different positions and / or at different angles;
[0174] Based on the above-mentioned multiple chessboard images, the above-mentioned image acquisition parameters are determined using Zhang Zhengyou calibration algorithm; the above-mentioned image acquisition parameters include focal length.
[0175] In some implementations, the image acquisition parameters further include distortion coefficients; and the calibration module is specifically used for:
[0176] Detecting corner points of the checkerboard in the checkerboard image;
[0177] Match the detected corner points with the corner points of the above chessboard;
[0178] Determine the above-mentioned distortion coefficient by using the matched corner point coordinates and the size of the above-mentioned chessboard; the above-mentioned distortion coefficient includes a radial distortion coefficient and / or a tangential distortion coefficient;
[0179] Before determining the distance between the target and the image acquisition component according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameter of the image acquisition component, the method further includes:
[0180] The above-mentioned distortion coefficient is used to correct the above-mentioned distance value and the spacing between the above-mentioned at least two light emitters on the target.
[0181] In some embodiments, the distance measurement device further includes a correction module, which is used to:
[0182] Acquire a training data set; the training data set includes a plurality of training samples; the training samples include the measured distance between the target and the image acquisition component, the actual distance between the target and the image acquisition component, and meteorological data during the measurement process;
[0183] The training model is trained based on the training data set to obtain an atmospheric refraction correction model;
[0184] After determining the distance between the target and the image acquisition component, the method further includes:
[0185] The meteorological data of the current measurement environment is obtained, and the distance between the determined target and the image acquisition component is corrected using the atmospheric refraction correction model according to the meteorological data of the current measurement environment.
[0186] It should be noted that the specific contents and beneficial effects of the distance measurement device 40 can be found in the various steps of the distance measurement method described in the above embodiment, which will not be described in detail here.
[0187] Furthermore, based on the contents described in the above embodiments, a distance measurement device is also provided in an embodiment of the present application, which includes the above-mentioned image acquisition component, and at least one processor and a memory; wherein the memory stores a computer program; the above-mentioned at least one processor executes the computer program stored in the memory to implement the various steps in the distance measurement method described in the above embodiments.
[0188] In order to better understand the embodiments of the present application, refer to Figure 5 , Figure 5 A schematic diagram of the hardware structure of a distance measurement device provided in an embodiment of the present application.
[0189] like Figure 5 As shown, the distance measurement device 50 of this embodiment includes: a processor 501 and a memory 502; wherein:
[0190] Memory 502, used to store computer-executable instructions;
[0191] The processor 501 is configured to execute the computer-executable instructions stored in the memory to implement the various steps in the distance measurement method described in the above embodiment.
[0192] Optionally, the memory 502 may be independent or integrated with the processor 501 .
[0193] When the memory 502 is independently provided, the device further includes a bus 503 for connecting the memory 502 and the processor 501 .
[0194] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, each step in the distance measurement method described in the above embodiment is implemented.
[0195] A computer program product is also provided in an embodiment of the present application, including a computer program. When the computer program is executed by a processor, each step in the distance measurement method described in the above embodiment is implemented.
[0196] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0197] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of each solution in this embodiment.
[0198] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0199] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.
[0200] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0201] The memory may include high-speed memory, and may also include non-volatile storage, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0202] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0203] The storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The storage medium may be any available medium that can be accessed by a general or special purpose computer.
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A distance measurement method, characterized in that: Applied in a distance measuring device, the distance measuring device includes an image acquisition component; the method includes: Acquire a target image acquired by the image acquisition component; at least two luminous bodies are arranged on the surface of the target; Determining the center coordinates of the at least two luminous bodies in the target image; Determining a distance value between the at least two luminous bodies in the target image according to the center coordinates; The distance between the target and the image acquisition component is determined according to the distance value, the spacing between the at least two light emitters on the target, and the image acquisition parameters of the image acquisition component.
2. The method according to claim 1, characterized in that Determining the center coordinates of the at least two luminous bodies in the target image includes: Preprocessing the target image, and extracting luminous body images corresponding to the at least two luminous bodies from the preprocessed target image; Performing integer pixel edge detection on the luminous body image using an integer pixel edge detection algorithm to determine integer pixel level edge points of the luminous body image; Performing sub-pixel edge detection on the integer-pixel edge points of the luminous body image using a sub-pixel edge detection algorithm to determine the sub-pixel edge points of the luminous body image; The center coordinates of the luminous body are determined according to the sub-pixel edge points of the luminous body image.
3. The method according to claim 2, characterized in that The step of determining the center coordinates of the luminous body according to the sub-pixel edge points of the luminous body image comprises: Fitting the sub-pixel edge points of the luminous body image using a least squares ellipse fitting algorithm to determine the ellipse parameters of the ellipse edge corresponding to the luminous body image; Determining the grayscale value of each sub-pixel edge point on the edge of the ellipse according to the ellipse parameters; Determine the centroid position of the elliptical edge by using a weighted centroid algorithm according to the grayscale value of each sub-pixel edge point on the elliptical edge; The center coordinates of the light source are determined according to the center of mass position.
4. The method according to claim 1, characterized in that: Before acquiring the target image acquired by the image acquisition component, the method further includes: Acquire a plurality of chessboard images acquired by the image acquisition component; different chessboard images are acquired by the image acquisition component when the preset chessboard is at different positions and / or at different angles; The image acquisition parameters are determined according to the multiple checkerboard images using Zhang Zhengyou calibration algorithm; the image acquisition parameters include focal length.
5. The method according to claim 4, characterized in that The image acquisition parameters also include distortion coefficients; the image acquisition parameters are determined based on the multiple checkerboard images using the Zhang Zhengyou calibration algorithm, including: Detecting corner points of a checkerboard in the checkerboard image; Matching the detected corner points with the corner points of the chessboard; Determine the distortion coefficient using the matched corner point coordinates and the size of the chessboard; the distortion coefficient includes a radial distortion coefficient and / or a tangential distortion coefficient; Before determining the distance between the target and the image acquisition component according to the distance value, the distance between the at least two illuminants on the target, and the image acquisition parameter of the image acquisition component, the method further includes: The distance value and the spacing between the at least two light emitters on the target are corrected using the distortion coefficient.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Acquire a training data set; the training data set includes a plurality of training samples; the training samples include the measured distance between the target and the image acquisition component, the actual distance between the target and the image acquisition component, and meteorological data during the measurement process; Training a model to be trained based on the training data set to obtain an atmospheric refraction correction model; After determining the distance between the target and the image acquisition component, the method further includes: Acquire meteorological data of the current measurement environment, and correct the determined distance between the target and the image acquisition component using the atmospheric refraction correction model according to the meteorological data of the current measurement environment.
7. A distance measuring device, characterized in that: The device comprises: An image acquisition component, used for acquiring a target image of a target; at least two luminous bodies are arranged on the surface of the target; An acquisition module, used for acquiring the target image; A determination module, used to determine the center coordinates of the at least two luminous bodies in the target image; A detection module, used to determine the distance value between the at least two luminous bodies in the target image according to the center coordinates; A calculation module is used to determine the distance between the target and the image acquisition component according to the distance value, the spacing between the at least two light-emitting bodies on the target, and the image acquisition parameters of the image acquisition component.
8. A distance measurement system, characterized in that: include: A distance measuring device and a target; at least two luminous bodies are arranged on the surface of the target; The distance measuring device is the distance measuring device according to claim 7.
9. The system according to claim 8, characterized in that The system further comprises a first stabilizing device and a second stabilizing device, wherein the first stabilizing device and the second stabilizing device each comprise a leveling base; The distance measuring device is fixed on the first stabilizing device, and the target is fixed on the second stabilizing device.
10. The system according to claim 8 or 9, characterized in that The image acquisition component in the distance measuring device includes a long-focus telecentric lens, and the focal length range of the long-focus telecentric lens is 50mm to 150mm; the light-emitting body includes an infrared light-emitting diode.
11. A distance measuring device, characterized in that: include: Image acquisition components, memory and processors; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory to implement the distance measurement method according to any one of claims 1 to 6.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the distance measurement method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Apparatus of ranging laser point of remote ranging system and positioning method based on paralleling of laser and camera
CN102445183A
Monocular distance measurement method based on pseudo-image distance
CN104215217A
Monocular-vision distance measuring method on basis of lane planar geometric model drive for forward vehicles
CN107796373A
Heading machine positioning method and system based on inertial navigation and laser radar three-point distance measurement
CN111637889A
Distance measurement method based on MFK hybrid filtering and multi-input BP neural network
CN114280536A