Ranging method, device, electronic device and storage medium

By generating a distance measurement image including target information and depth information in scanning mode, and calculating the distance measurement results of the target object using the generation model, the problem of inaccurate distance measurement of the laser rangefinder is solved, and higher distance measurement accuracy is achieved.

CN115097480BActive Publication Date: 2025-08-15IBE ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210522532.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2025-08-15
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

Existing laser rangefinders have the problem of inaccurate distance measurement, especially when the user positioning is inaccurate, the measurement results are prone to misjudging the distance of other objects.

Method used

By transmitting and receiving ranging signals in scanning mode, a ranging image including target information and depth information is generated, and the category and depth of the target object are judged using the pre-trained generative model, and the ranging results of the target object are calculated and displayed.

Benefits of technology

The distance measurement accuracy of the target object is improved and the problem of inaccurate distance measurement of existing laser rangefinders is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115097480B_ABST
    Figure CN115097480B_ABST
Patent Text Reader

Abstract

The present disclosure provides a ranging method, apparatus, electronic device, and storage medium. The ranging method comprises: acquiring a ranging signal emitted in a scanning mode and a received echo signal; calculating a ranging signal in the scanning mode based on the ranging signal and the echo signal; generating a ranging image at each moment based on the ranging signal, wherein the ranging image includes target information and depth information; and obtaining a ranging result for the target object based on the ranging image. The present invention can determine whether a target object appears in a category image and its location based on the target information, and can extract the depth of the target object based on the depth information to calculate the ranging result for the target object. At this time, a prompt is issued and the corresponding ranging value is displayed, thereby improving the ranging accuracy of the target object, thereby resolving the problem of inaccurate ranging with existing laser rangefinders.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distance measurement technology, and in particular to a distance measurement method, device, electronic equipment and storage medium. Background Art

[0002] Miniaturized portable laser rangefinders are a development trend in civilian laser rangefinders. Due to their portability, handheld laser rangefinders are widely used in engineering projects such as construction and transportation, and are also widely used in various distance measurement scenarios in leisure activities such as golf and hunting. However, most existing laser rangefinders use single-point distance measurement. After observing the object of interest through the eyepiece, the user clicks the rangefinder's distance switch once to measure the distance. This distance measurement method often requires the user to locate the target object through the eyepiece. If the user's positioning is accurate, the measurement result is the distance value of the target object. If the user's positioning is inaccurate, the measurement result is the distance value of other objects. Therefore, existing laser rangefinders have the problem of inaccurate distance measurement. Summary of the Invention

[0003] Embodiments of the present invention provide a ranging method, apparatus, electronic device, and storage medium. After acquiring a ranging signal emitted in a scanning mode and a received echo signal, the ranging signal in the scanning mode is calculated, and a corresponding ranging image is generated based on the ranging signal. The ranging image includes target information and depth information. Whether a target object appears in a category image and the location of the target object can be determined based on the target information. The depth information can be used to extract the depth of the target object and calculate the ranging result of the target object. At this time, a prompt is issued and the corresponding ranging value is displayed, thereby improving the ranging accuracy of the target object and solving the problem of inaccurate ranging in existing laser rangefinders.

[0004] In a first aspect, an embodiment of the present invention provides a ranging method, the method comprising:

[0005] Acquire the transmitted signal and received echo signal in scanning mode;

[0006] Calculating a ranging signal in the scanning mode according to the transmitted signal and the echo signal;

[0007] Generating a ranging image at each moment according to the ranging signal, wherein the ranging image includes target information and depth information;

[0008] Based on the ranging image, a ranging result of the target object is obtained.

[0009] Furthermore, the step of acquiring the transmission signal emitted in the scanning mode and the received echo signal includes:

[0010] After receiving the scanning mode start instruction, start the scanning mode;

[0011] In the scanning mode, continuous transmission signals are transmitted and continuous echo signals are received.

[0012] Furthermore, the step of calculating the ranging signal in the scanning mode according to the transmitted signal and the echo signal includes:

[0013] The ranging signal in the scanning mode is calculated according to the transmission signal and the echo signal in combination with a pre-stored target optical path structure.

[0014] Furthermore, the step of generating a ranging image at each moment according to the ranging signal includes:

[0015] The ranging signal at each moment is input into the pre-trained generation model to generate the ranging image corresponding to each moment.

[0016] Furthermore, the generative model includes a category generative network and a distance generative network. The step of inputting the ranging signal at each moment into the pre-trained generative model to generate the ranging image corresponding to each moment includes:

[0017] Input the ranging signal at each moment into the pre-trained generation model;

[0018] Generate a category image of the target object through the category generation network;

[0019] Generate a depth image of the target object through the distance generation network, wherein the category image and the depth image have the same size parameter;

[0020] The category image and the depth image are channel-fused to obtain the ranging image corresponding to each moment.

[0021] Furthermore, before the step of inputting the ranging signal at each moment into a pre-trained generation model to generate the ranging image corresponding to each moment, the method further includes:

[0022] Obtaining a model to be trained, wherein the model to be trained includes a generator and a discriminator, and the generator includes a category generation network and a distance generation network;

[0023] The model to be identified is trained using a pre-prepared data set to obtain a trained generator as a pre-trained generation model.

[0024] Furthermore, the step of obtaining a ranging result of the target object based on the ranging image includes:

[0025] performing target recognition on the ranging image;

[0026] If the ranging image includes the target object, extracting depth information of the target object from the ranging image;

[0027] Calculate the distance measurement result of the target object according to the depth information of the target object.

[0028] In a second aspect, a distance measuring device is provided, the device comprising:

[0029] A first acquisition module is used to acquire the transmission signal emitted and the echo signal received in the scanning mode;

[0030] a calculation module, configured to calculate a ranging signal in the scanning mode according to the transmitted signal and the echo signal;

[0031] A generating module, configured to generate a ranging image at each moment according to the ranging signal, wherein the ranging image includes target information and depth information;

[0032] The processing module is used to obtain a ranging result of the target object based on the ranging image.

[0033] In a third aspect, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the ranging method as described in any one of the embodiments of the present invention are implemented.

[0034] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the ranging method as described in any one of the embodiments of the present invention are implemented.

[0035] In an embodiment of the present invention, a transmission signal emitted in a scanning mode and a received echo signal are acquired; a ranging signal in the scanning mode is calculated based on the transmission signal and the echo signal; a ranging image is generated at each moment based on the ranging signal, the ranging image including target information and depth information; and a ranging result of the target object is obtained based on the ranging image. After acquiring the ranging signal emitted in the scanning mode and the received echo signal, the ranging signal in the scanning mode is calculated, and a corresponding ranging image is generated based on the ranging signal. The ranging image includes target information and depth information. The presence and location of the target object in the category image can be determined based on the target information. The depth information can be used to extract the depth of the target object and calculate the ranging result of the target object. At this time, a prompt is issued and the corresponding ranging value is displayed, thereby improving the ranging accuracy of the target object, thereby resolving the problem of inaccurate ranging with existing laser rangefinders. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 It is a flow chart of a distance measurement method.

[0038] Figure 2 It is a structural diagram of a distance measuring device. DETAILED DESCRIPTION

[0039] The following describes in detail embodiments of the present invention, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0040] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "circumferential", "radial", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the present invention.

[0041] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0042] In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "connect," "fixed," etc. should be understood broadly. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0043] In the present invention, unless otherwise expressly specified or limited, a first feature being "above" or "below" a second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Furthermore, a first feature being "above," "above," and "above" a second feature may include the first feature being directly above or obliquely above the second feature, or may simply mean that the first feature is higher in level than the second feature. A first feature being "below," "below," and "below" a second feature may include the first feature being directly below or obliquely below the second feature, or may simply mean that the first feature is lower in level than the second feature.

[0044] See also Figure 1 , Figure 1 A distance measurement method provided in this application includes:

[0045] 101. Acquire a transmission signal transmitted and a received echo signal in a scanning mode.

[0046] In an embodiment of the present invention, the above-mentioned ranging method can be applied to a ranging device such as a ranging camera or a laser rangefinder. The ranging device is provided with a single-point ranging mode and a scanning mode. The single-point ranging mode can be understood as the user single-clicking the ranging button to perform ranging, and the scanning mode can be understood as the user continuously pressing the ranging button to perform continuous ranging.

[0047] The transmission signal may be a laser transmission signal, and the echo signal is a laser signal returned after the transmission signal encounters an object.

[0048] Optionally, in the step of acquiring the transmission signal emitted and the echo signal received in the scanning mode, the scanning mode can be turned on after receiving the scanning mode start instruction; in the scanning mode, continuous transmission signals are emitted and continuous echo signals are received.

[0049] The scanning mode start instruction may be an instruction generated when the user continuously presses the distance measurement button. After the user turns on the scanning mode, the user may slowly move the distance measurement device to perform scanning.

[0050] The transmission signal can be transmitted by a signal transmitter, which can be a laser transmitter, and transmits a continuous ranging signal. The echo signal can be received by a signal receiver. Since the signal transmitter transmits a continuous ranging signal, the echo signal is also a continuous echo signal.

[0051] 102. Calculate and obtain a ranging signal in a scanning mode according to the transmitted signal and the echo signal.

[0052] In an embodiment of the present invention, the above-mentioned transmission signal can be a transmission surface in the form of a light spot, and the above-mentioned echo signal can be a receiving surface in the shape of a light spot. The light spot shape of the above-mentioned transmission signal is preset and modulated, and can be a circular, square or other shape or a derivative thereof. Since there are different objects in the scanning area, the receiving surface of the above-mentioned echo signal and the emitting surface of the transmission signal can be different shapes.

[0053] It should be noted that the above-mentioned spot shape refers to the signal area shape of the transmitted signal or the echo signal, rather than the signal wave shape of the transmitted signal or the echo signal.

[0054] The above-mentioned ranging signal may be a combination of a transmission signal and an echo signal, or may be a difference in light spot shape between the transmission signal and the echo signal.

[0055] 103. Generate a ranging image at each moment based on the ranging signal.

[0056] In the embodiment of the present invention, the aforementioned ranging signal may be a combination of a transmission signal and an echo signal, or may be a difference in spot shape between the transmission signal and the echo signal.

[0057] It should be noted that the combination of the transmitted signal and the echo signal implicitly includes the amount of information change affected by the scanned area during the transition from the transmitted signal to the echo signal. Similarly, the difference in spot shape between the transmitted signal and the echo signal also implicitly includes the amount of information change affected by the scanned area during the transition from the transmitted signal to the echo signal.

[0058] The ranging image at each moment can be generated based on the information variation implicit in the ranging signal. The ranging image includes target information and depth information.

[0059] The target information may be target object information, which may include information such as the category of the target object, the position of the target object in the ranging image, etc. The target object may be a flagpole, a benchmark, a target, etc.

[0060] The above-mentioned depth information refers to the depth value information of each resolution unit in the ranging image, and can also be understood as the depth value information of each pixel in the ranging image.

[0061] 104. Obtain a ranging result of the target object based on the ranging image.

[0062] In an embodiment of the present invention, the ranging image includes target information and depth information. The depth value of each target can be calculated based on the depth information, and then the depth value of each target is converted into a ranging value of each target to obtain a ranging result of each target.

[0063] When a target object appears in the ranging image, a depth value of the target object can be calculated based on the depth information, and then the depth value of the target object is converted into a ranging value of the target object to obtain a ranging result of the target object.

[0064] In an embodiment of the present invention, a transmission signal emitted in a scanning mode and a received echo signal are acquired; a ranging signal in the scanning mode is calculated based on the transmission signal and the echo signal; a ranging image is generated at each moment based on the ranging signal, the ranging image including target information and depth information; and a ranging result of the target object is obtained based on the ranging image. After acquiring the transmission signal emitted in the scanning mode and the received echo signal, the ranging signal in the scanning mode is calculated, and a corresponding ranging image is generated based on the ranging signal. The ranging image includes target information and depth information. The presence and location of the target object in the category image can be determined based on the target information. The depth information can be used to extract the depth of the target object and calculate the ranging result of the target object. At this time, a prompt is issued and the corresponding ranging value is displayed, thereby improving the ranging accuracy of the target object, thereby resolving the problem of inaccurate ranging in existing laser rangefinders.

[0065] Optionally, a ranging signal in a scanning mode is calculated based on the transmitted signal and the echo signal.

[0066] In an embodiment of the present invention, in scanning mode, the distance to the object in front is measured at every moment. The targets of the ranging include the background and the object. The foreground and the object have different spatial positions and therefore have different distances, which results in different signal return times, thereby calculating different ranging values.

[0067] The ranging in the scanning mode can be understood as performing a single-point ranging at each moment, and the length of the above moment can be the time length of the single-point ranging.

[0068] In the scanning mode, the distance measurement signal may be a combination of a transmission signal and an echo signal, or may be a difference in spot shape between the transmission signal and the echo signal.

[0069] It's important to note that the combination of the transmitted and echo signals implicitly captures the amount of information change in the scanned area from the time the signal is transmitted to the time the signal is returned. Similarly, the difference in spot shape between the transmitted and echo signals also implicitly captures the amount of information change in the scanned area from the time the signal is transmitted to the time the signal is returned. Therefore, the aforementioned ranging signal implicitly captures the amount of information change in the scanned area.

[0070] Furthermore, in the step of calculating the ranging signal in the scanning mode based on the transmitted signal and the echo signal, the transmitted signal and the echo signal in the scanning mode can also be preprocessed based on the transmitted signal and the echo signal in combination with the pre-stored target optical path diagram structure to obtain the ranging signal in the scanning mode.

[0071] Specifically, the target optical path graph structure includes nodes and edges, with nodes connected by edges. The target optical path graph structure can be obtained based on the optical path structure of the ranging device. The optical path structure includes lenses and the distances between lenses. Each lens has optical parameters, such as curvature and refractive index. Lenses can be used as nodes of the target optical path graph structure, and the distances between lenses as edges of the target optical path graph structure, thereby generating the target optical path graph structure.

[0072] The target optical path diagram structure includes a first optical path diagram structure and a second optical path diagram structure. The first optical path diagram structure and the second optical path diagram structure are connected by a weighted edge formed by environmental variables. In the step of calculating the ranging signal in the scanning mode based on the transmitted signal and the echo signal in combination with the pre-stored target optical path diagram structure, the first optical path diagram structure can be generated according to the transmitted optical path structure of the ranging signal, and the second optical path diagram structure can be generated according to the received optical path structure of the echo signal; the environmental variables are obtained, and the weighted edge is generated according to the environmental variables; the end point of the first optical path diagram structure is connected to the starting point of the second optical path diagram structure through the weighted edge to obtain the target optical path diagram structure; the transmitted signal, the echo signal and the target optical path diagram structure are input into a preset calculation model for filtering calculation to obtain the ranging signal in the scanning mode.

[0073] It should be noted that the transmission optical path structure of the above-mentioned transmission signal is different from the receiving optical path structure of the echo signal.

[0074] In the step of generating a first optical path diagram structure based on the transmitting optical path structure of the transmitting signal, the first lens in the transmitting optical path structure can be used as the first node, and the optical parameters of the first lens and the distance between the first lenses can be used as the first relationship edge to generate the first optical path diagram structure. The first nodes in the first optical path diagram structure are connected by the first relationship edge, the first first lens in the first optical path diagram structure serves as the starting point of the first optical path diagram structure, and the last first lens in the first optical path diagram structure serves as the end point of the first optical path diagram structure.

[0075] In the step of generating a second optical path diagram structure based on the receiving optical path structure of the echo signal, the second lens in the receiving optical path structure can be used as the second node, and the optical parameters of the second lens and the distance between the second lenses can be used as the second relationship edge to generate the second optical path diagram structure. The second nodes in the second optical path diagram structure are connected by the second relationship edge. The first second lens in the second optical path diagram structure serves as the starting point of the second optical path diagram structure, and the last second lens in the second optical path diagram structure serves as the end point of the second optical path diagram structure.

[0076] In a possible embodiment, both the first relationship edge and the second relationship edge have weight values, and the weight values of the relationship edges can be calculated using the following formula:

[0077]

[0078]

[0079] Among them, the above a n Represents the weight value of the first relationship edge between the nth node and the n-1th node in the first light path graph structure. k Represents the weight value of the second relationship edge between the kth node and the k-1th node in the second light path graph structure. Represents the prior value of the first optical path structure, the above Represents the prior value of the second optical path structure, Greater than and It can be set manually. n Represents the optical parameters of the nth first lens in the first optical path structure. The above λ k Represents the optical parameters of the kth first lens in the second optical path diagram structure. n Represents the distance between the nth node and the n-1th node in the first optical path structure. The above d k Represents the distance between the kth node and the k-1th node in the second light path diagram structure.

[0080] In the step of obtaining environmental variables and generating weighted edges based on the environmental variables, the environmental variables can be calculated based on the difference between the transmitted signal, the echo signal, and the ranging value at any two times during the pre-startup period; and the weighted edges can be generated based on the environmental variables. The pre-startup period refers to a period of time before the actual ranging is performed, which is used to collect environmental variables.

[0081] The above-mentioned arbitrary two moments may be any two moments in the pre-start period. Preferably, the above-mentioned arbitrary two moments may be any two adjacent moments in the pre-start period.

[0082] Specifically, a first time required for the signal to return can be calculated based on the ranging signal and echo signal at one moment. A second time required for the signal to return can be calculated based on the ranging signal and echo signal at another moment. The time difference between the first and second times can be calculated. The signal propagation speed can be calculated based on this time difference and the difference between the ranging values. The medium of signal propagation in the current environment can be estimated based on the signal propagation speed, thereby obtaining the corresponding environmental variable. The relationship between the environmental variable and the medium is preset.

[0083] In one possible embodiment, the ranging results in the scanning mode can be calculated by a lightweight neural network. The above-mentioned lightweight neural network can be built based on the SSDLite network, and the parameters in the network can be quantified, thereby greatly reducing the number of parameters. It can then be deployed in an embedded processor, so that the ranging device can also be equipped with a neural network corresponding to the calculation of the ranging results.

[0084] Specifically, the transmitted signal, the echo signal and the target optical path diagram structure can be used as three inputs and input into a lightweight neural network. The lightweight neural network can include three branch networks, which are used to process the transmitted signal, the echo signal and the target optical path diagram structure respectively. The outputs of the three branch networks are connected to a fusion network, which is used to fuse the implicit features extracted by the three branch networks to obtain fused high-level features. The fused high-level features are then convolved through the convolution network to further extract higher-level features. Finally, the higher-level features are linearly regressed through the output network to obtain the ranging signal at the current moment.

[0085] Optionally, in the step of generating the ranging image at each moment according to the ranging signal, the ranging signal at each moment may be input into a pre-trained generation model to generate the ranging image corresponding to each moment.

[0086] In an embodiment of the present invention, the above-mentioned preset trained generative model may be a generative model based on a generative adversarial network, which takes the ranging signal at each moment as input to the generative model and generates a corresponding ranging image through the generative model.

[0087] In this way, the pre-trained generation model can be used to take the ranging signal corresponding to each moment as the input signal to obtain the ranging image at each moment, without the need to set up an additional image acquisition device on the rangefinder.

[0088] Optionally, the generative model includes a category generative network and a distance generative network. When the ranging signal at each moment is input into the pre-trained generative model, the step of generating a ranging image corresponding to each moment includes: inputting the ranging signal at each moment into the pre-trained generative model; generating a category image of the target object through the category generative network; generating a depth image of the target object through the distance generative network, wherein the category image and the depth image have the same size parameters; and performing channel fusion on the category image and the depth image to obtain the ranging image corresponding to each moment.

[0089] In an embodiment of the present invention, the category generation network is used to generate a category image of the target object. The category generation network may be a deconvolution network based on deep learning. Specifically, in an embodiment of the present invention, the categories that the category generation network can generate are determined according to user needs. For example, when the rangefinder is used on a golf course, the categories that the category generation network can generate include foreground and background, where the foreground may be a flagpole, a flag, a tree, etc., and the background may be grass and sky, etc.

[0090] It should be noted that the above-mentioned target objects are objects of the foreground category, such as flagpoles or flags.

[0091] The above distance generation network is used to generate a depth image, that is, to generate a depth value for each pixel in the ranging image.

[0092] In the above-mentioned category generation network, by extracting the variation of category information implicit in the ranging signal and generating a corresponding classification image, objects in the scanned area can be classified more accurately.

[0093] In the above distance generation network, the distance distribution of the scanned area can be obtained by extracting the distance information variation implicit in the ranging signal and generating a corresponding depth image.

[0094] The output of the class generation network and the output of the distance generation network have the same size parameters. For example, if the size of the class image is 512×512, the size of the depth image is also 512×512. After aligning the class image and the depth image, the class image and the depth image can be channel-fused to obtain the distance measurement image corresponding to each time.

[0095] Optionally, before inputting the ranging signal at each moment into a pre-trained generative model to generate the ranging image corresponding to each moment, a model to be trained may be obtained, where the model to be trained includes a generator and a discriminator, and the generator includes a category generation network and a distance generation network. The model to be identified is trained using a pre-prepared data set to obtain a trained generator as the pre-trained generative model.

[0096] In an embodiment of the present invention, the model to be trained can be a generative model based on a generative adversarial network, comprising a generator and a discriminator. The generator is used to generate ranging images, and the discriminator is used to distinguish between the generated ranging images and real images. If the discriminator fails the identification, the generator parameters are adjusted to make the generator generate ranging images closer to the real images. If the discriminator passes the identification, the discriminator parameters are adjusted to improve the discriminator's identification accuracy.

[0097] The pre-selected dataset includes annotated images and sample inputs. The sample inputs are the ranging signals from the annotated images, also known as ground truth images. The annotated images are images with depth information obtained by photographing and annotating the scanned area using a 3D camera. The sample inputs are the ranging signals obtained by scanning the same scanned area using a rangefinder.

[0098] The labeled image includes the labels of the foreground and background. For example, the labeled image includes the foreground labels of flagpoles, flags, and trees, and the background labels of grass and sky.

[0099] Specifically, the annotations of the foreground and background in the annotated image are used to guide the category generation network to generate category images, and the depth information in the annotated image is used to guide the distance generation network to generate depth images.

[0100] During the training process, the discriminator identifies the category image and depth image generated by the generator respectively, and calculates the first loss between the category image and the annotated image, and the second loss between the depth image and the depth information of the annotated image. The parameters of the category generation network are adjusted according to the first loss, and the parameters of the distance generation network are adjusted by the second loss, so that the generator can generate a ranging image close to the annotated image, that is, the category image generated by the generator is basically consistent with the annotated image, and the depth image generated is basically consistent with the depth information of the annotated image.

[0101] After the iterative training reaches a preset number of times or the trained model converges, the training can be stopped and the trained generator can be obtained as the pre-trained generative model.

[0102] Optionally, in the step of obtaining the ranging result of the target object based on the ranging image, target recognition can be performed on the ranging image; if the ranging image includes the target object, depth information of the target object is extracted from the ranging image; and the ranging result of the target object is calculated based on the depth information of the target object.

[0103] In an embodiment of the present invention, after obtaining a ranging image, target recognition can be performed on the ranging image using a target recognition model to determine whether the ranging image includes a target object, such as a flagpole or a flag. If the ranging image includes the target object, it indicates that the target object is currently within the scanned area and has been scanned by the rangefinder. If the ranging image does not include the target object, it indicates that the target object is currently within the scanned area or has not yet been scanned by the rangefinder, and the scanning process continues at the next moment.

[0104] If the ranging image includes the target object, the depth information of the target object is extracted from the ranging image. Since each pixel in the ranging image corresponds to a depth value, the position of the target object in the ranging image is used as the target image area. The average depth value of each pixel in the target image area is calculated as the depth value of the target object. The depth value of the target object is converted into the target object's ranging value to obtain the ranging result of the target object.

[0105] After obtaining the ranging result of the target object, a preset prompt can be issued. The prompt can be a red light prompt in the eyepiece, or a buzzer prompt, or a prompt through red light and buzzer at the same time, or the position of the target object in the ranging image is displayed on the display screen in the eyepiece.

[0106] In a possible embodiment, a first ranging value of the background can be directly measured based on the transmitted signal and the echo signal, a second ranging value of the background can be obtained through the ranging image, and the error between the first ranging value and the second ranging value can be calculated. The ranging value of the target object obtained based on the ranging image can be corrected based on the error, thereby obtaining a more accurate ranging result.

[0107] See also Figure 2 , Figure 2 A distance measuring device provided in this application includes:

[0108] The first acquisition module 201 is used to acquire the transmission signal emitted and the received echo signal in the scanning mode;

[0109] A calculation module 202, configured to calculate a ranging signal in the scanning mode according to the transmitted signal and the echo signal;

[0110] A generating module 203 is configured to generate a ranging image at each moment according to the ranging signal, wherein the ranging image includes target information and depth information;

[0111] The processing module 204 is configured to obtain a ranging result of the target object based on the ranging image.

[0112] Furthermore, the first acquisition module 201 includes:

[0113] A first receiving submodule is configured to start the scanning mode after receiving a scanning mode start instruction;

[0114] The second receiving submodule is configured to transmit continuous transmission signals and receive continuous echo signals in the scanning mode.

[0115] Furthermore, the calculation module 202 includes:

[0116] The first calculation submodule is used to calculate the ranging signal in the scanning mode according to the transmission signal and the echo signal in combination with a pre-stored target optical path diagram structure.

[0117] Furthermore, the generating module 203 includes:

[0118] The generation submodule is used to input the ranging signal at each moment into the pre-trained generation model to generate the ranging image corresponding to each moment.

[0119] Furthermore, the generation model includes a category generation network and a distance generation network, and the generation submodule includes:

[0120] The input unit is used to input the ranging signal at each moment into the pre-trained generation model;

[0121] A first generating unit, configured to generate a category image of the target object through the category generation network;

[0122] A second generating unit is configured to generate a depth image of the target object through the distance generation network, wherein the category image and the depth image have the same size parameter;

[0123] The fusion unit is used to perform channel fusion on the category image and the depth image to obtain the ranging image corresponding to each moment.

[0124] Furthermore, the device further comprises:

[0125] A second acquisition module is used to acquire a model to be trained, wherein the model to be trained includes a generator and a discriminator, and the generator includes a category generation network and a distance generation network;

[0126] The training module is used to train the model to be identified using a pre-prepared data set to obtain a trained generator as a pre-trained generation model.

[0127] Furthermore, the processing module 204 includes:

[0128] an identification submodule, configured to perform target identification on the ranging image;

[0129] a judgment submodule, configured to extract depth information of the target object from the ranging image if the ranging image includes the target object;

[0130] The second calculation submodule is configured to calculate a distance measurement result of the target object according to the depth information of the target object.

[0131] An embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any ranging method described in the above method embodiments.

[0132] An embodiment of the present invention further provides an electronic device, comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps of any ranging method described in the above method embodiments.

[0133] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0134] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0135] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components 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 through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0136] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0137] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software program modules.

[0138] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0139] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0140] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A distance measurement method, characterized in that: The method comprises: Acquire the transmitted signal and received echo signal in scanning mode; Calculating a ranging signal in the scanning mode according to the transmitted signal and the echo signal; Generating a ranging image at each moment according to the ranging signal, wherein the ranging image includes target information and depth information; Obtaining a distance measurement result of the target object based on the distance measurement image; The step of generating a ranging image at each moment according to the ranging signal comprises: Input the ranging signal at each moment into the pre-trained generative model to generate the ranging image corresponding to each moment; The generation model includes a category generation network and a distance generation network. The step of inputting the ranging signal at each moment into the pre-trained generation model to generate the ranging image corresponding to each moment includes: Input the ranging signal at each moment into the pre-trained generation model; Generate a category image of the target object through the category generation network; Generate a depth image of the target object through the distance generation network, wherein the category image and the depth image have the same size parameter; The category image and the depth image are channel-fused to obtain the ranging image corresponding to each moment.

2. The method according to claim 1, characterized in that The step of acquiring the transmitted signal and the received echo signal in the scanning mode includes: After receiving the scanning mode start instruction, starting the scanning mode; In the scanning mode, continuous transmission signals are transmitted and continuous echo signals are received.

3. The method according to claim 2, characterized in that The step of calculating the ranging signal in the scanning mode according to the transmitted signal and the echo signal includes: The ranging signal in the scanning mode is calculated according to the transmission signal and the echo signal in combination with a pre-stored target optical path structure.

4. The method according to claim 1, wherein Before the step of inputting the ranging signal at each moment into the pre-trained generation model to generate the ranging image corresponding to each moment, the method further includes: Obtaining a model to be trained, wherein the model to be trained includes a generator and a discriminator, and the generator includes a category generation network and a distance generation network; The recognition model is trained using a pre-prepared dataset to obtain a trained generator as a pre-trained generation model.

5. The method according to claim 4, characterized in that The step of obtaining a ranging result of the target object based on the ranging image includes: performing target recognition on the ranging image; If the ranging image includes the target object, extracting depth information of the target object from the ranging image; Calculate the distance measurement result of the target object according to the depth information of the target object.

6. A distance measuring device, characterized in that: The device comprises: A first acquisition module is used to acquire the transmission signal emitted and the echo signal received in the scanning mode; a calculation module, configured to calculate a ranging signal in the scanning mode according to the transmitted signal and the echo signal; A generating module, configured to generate a ranging image at each moment according to the ranging signal, wherein the ranging image includes target information and depth information; A processing module, configured to obtain a ranging result of the target object based on the ranging image; The generation module includes: The generation submodule is used to input the ranging signal at each moment into the pre-trained generation model to generate the ranging image corresponding to each moment; The generation model includes a category generation network and a distance generation network, and the generation submodule includes: The input unit is used to input the ranging signal at each moment into the pre-trained generation model; A first generating unit, configured to generate a category image of the target object through the category generation network; A second generating unit is configured to generate a depth image of the target object through the distance generation network, wherein the category image and the depth image have the same size parameter; The fusion unit is used to perform channel fusion on the category image and the depth image to obtain the ranging image corresponding to each moment.

7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the ranging method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the ranging method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Depth distance measurement method and device, storage medium and electronic equipment

    CN110488311A

  • Laser ranging imaging method and device, electronic equipment and storage medium

    CN113393508A