CN112862882A - Target distance measuring method, device, electronic apparatus and storage medium - Google Patents

Target distance measuring method, device, electronic apparatus and storage medium Download PDF

Info

Publication number
CN112862882A
CN112862882A CN202110117982.2A CN202110117982A CN112862882A CN 112862882 A CN112862882 A CN 112862882A CN 202110117982 A CN202110117982 A CN 202110117982A CN 112862882 A CN112862882 A CN 112862882A
Authority
CN
China
Prior art keywords
cloud data
point cloud
region
interest
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110117982.2A
Other languages
Chinese (zh)
Inventor
赵勇
朱立发
林昌伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gelingshentong Information Technology Co ltd
Original Assignee
Beijing Gelingshentong Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gelingshentong Information Technology Co ltd filed Critical Beijing Gelingshentong Information Technology Co ltd
Priority to CN202110117982.2A priority Critical patent/CN112862882A/en
Publication of CN112862882A publication Critical patent/CN112862882A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The embodiment of the application provides a target distance measuring method, a device, electronic equipment and a storage medium; the method comprises the following steps: acquiring a depth map of a current target object and a reference object; acquiring an interest region marked in standard point cloud data of a target object and a reference object; registering the interesting region and point cloud data to be measured to obtain a positioning point set of the target object and a reference object in the point cloud data to be measured, wherein the point cloud data to be measured is point cloud data corresponding to the depth map; and calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object. The target object and the reference object can be accurately positioned in the point cloud data to be measured by registering to obtain a positioning point set, and then the distance between the target object and the reference object is calculated according to the positioning point set, so that the distance between the target object and the reference object can be obtained in a high-precision and objective manner, and the measurement can be effectively finished by replacing manual work.

Description

Target distance measuring method, device, electronic apparatus and storage medium
Technical Field
The present disclosure relates to the field of computer vision technologies, and in particular, to a method and an apparatus for measuring a target distance, an electronic device, and a storage medium.
Background
High-precision distance measurement plays an important role in detecting the health state of industrial parts. When the distance between the industrial part and the reference is not within the expected range, the normal operation of the industrial equipment is potentially dangerous. High-precision distance measurement is necessary for the proper operation of industrial equipment.
However, the current high-precision measurement method is generally manual measurement, since the high-precision measurement often needs to be accurate to millimeter level, when a worker measures industrial parts and reference objects with a ruler, the positioning points are difficult to accurately select, and when the measurement values of the ruler are read, the subjectivity exists, so that the error of the measurement result is increased. And with the increase of measurement tasks, the dependence on manual measurement is not accurate enough, and the efficiency is not high.
Disclosure of Invention
The embodiment of the application provides a target distance measuring method, a target distance measuring device, electronic equipment and a storage medium, which can accurately position a target object and a reference object, calculate the distance between the target object and the reference object with high precision and objectively, and effectively replace manual distance measurement.
According to a first aspect of embodiments of the present application, there is provided a target distance measurement method, including: acquiring a depth map of a current target object and a reference object; acquiring an interest region marked in standard point cloud data of a target object and a reference object; registering the interesting region and point cloud data to be measured to obtain a positioning point set of the target object and a reference object in the point cloud data to be measured, wherein the point cloud data to be measured is point cloud data corresponding to the depth map; and calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
According to a second aspect of embodiments of the present application, there is provided a target distance measuring apparatus including: the first acquisition module is used for acquiring a depth map of a current target object and a reference object; the second acquisition module is used for acquiring an interest region marked in standard point cloud data of a target object and a reference object; the registration module is used for registering the interesting region and point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, and the point cloud data to be measured is point cloud data corresponding to the depth map; and the calculating module is used for calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
According to a third aspect of embodiments of the present application, there is provided an electronic device comprising one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method as applied to an electronic device, as described above.
According to a fourth aspect of the embodiments of the present application, there is provided a computer-readable storage medium having a program code stored therein, wherein the method described above is performed when the program code runs.
By adopting the target distance measuring method provided by the embodiment of the application, the depth maps of the current target object and the reference object are obtained; acquiring an interest region marked in standard point cloud data of a target object and a reference object; and registering the interesting region and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured. And then the distance between the target object and the reference object is calculated according to the positioning point set, so that the distance between the target object and the reference object can be objectively obtained with high precision, and the manual measurement can be effectively replaced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a target distance measuring method according to an embodiment of the present application;
FIG. 2 is a flow chart of a target distance measuring method according to yet another embodiment of the present application;
FIG. 3 is a flow chart of a target distance measuring method according to another embodiment of the present application;
fig. 4 is a flowchart of a target distance measuring method according to still another embodiment of the present application;
FIG. 5 is a functional block diagram of a target distance measuring device according to one embodiment of the present application;
fig. 6 is a block diagram of an electronic device for performing a target distance measurement method according to an embodiment of the present application.
Detailed Description
High precision distance measurement plays an important role in detecting the health status of industrial parts. When the distance between the industrial part of interest, i.e. the target object and the reference object, is not within the expected range, it will bring potential danger to the normal operation of the industrial equipment. For example, in rail transit such as high-speed rail or subway, if the distance between the rails is beyond the expected range, it is difficult to smoothly and safely run the vehicle.
Therefore, high-precision distance measurement is particularly critical in these situations, and the inventor finds in research that high-precision distance measurement is generally performed by manual measurement. Because high-precision measurement often requires accuracy to millimeter level, when a worker uses the ruler to measure a target object and a reference object during manual measurement, corresponding positioning points are selected accurately, so that the measured value is often larger than the true value of the distance, the worker also has subjectivity during reading the measured value of the ruler, and the error between the measured value and the true value of the distance is further increased. Moreover, with the increase of tasks to be measured, the repeatability is high, the fatigue of workers is often caused, the measuring efficiency is low, and the error is further increased.
In order to solve the above problems, an embodiment of the present application provides a target distance measuring method, which obtains an area of interest labeled in standard point cloud data of a target object and a reference object; and registering the interesting region and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured. And then the distance between the target object and the reference object is calculated according to the positioning point set, so that the distance between the target object and the reference object can be objectively obtained with high precision, and the manual measurement can be effectively replaced.
The scheme in the embodiment of the present application may be implemented by using various computer languages, for example, object-oriented programming language Java and transliterated scripting language JavaScript, Python, and the like.
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and are not exhaustive of all embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Referring to fig. 1, an embodiment of the present application provides a target distance measuring method, which is applicable to an electronic device, where the electronic device may be a smart phone, a smart device, a tablet computer, and the like.
Step 110, obtaining a depth map of the current target object and the reference object.
In the distance measurement, the distance between two objects is usually measured, and the target object and the reference object are defined as the two objects in the embodiment of the present application, that is, the distance between the target object and the reference object needs to be measured. Since the distance between the target object and the reference object may vary in real life, the electronic device may acquire a depth map of the current target object and the reference object, and perform distance measurement based on the depth map to acquire the distance between the current target object and the reference object.
In some embodiments, the depth maps of the current target object and the reference object acquired by the electronic device may be acquired by themselves, in which case, the image acquisition device may be integrated on the electronic device, so that the electronic device may directly acquire the depth maps of the target object and the reference object. In other embodiments, the electronic device may be in communication connection with an image capturing device, where the image capturing device captures depth maps of a current target object and a reference object, and sends the captured depth maps of the current target object and the reference object to the electronic device, so that the electronic device may obtain the depth maps of the current target object and the reference object.
It should be noted that, since the depth maps of the target object and the reference object are required to be acquired, the image capturing device may be a high-precision depth camera.
When measuring distance, an object to be measured and a reference object need to be determined, the object to be measured is defined as a target object by the embodiment of the application, and after the object to be measured and the reference object are determined,
and 120, acquiring a region of interest marked in the standard point cloud data of the target object and the reference object.
The standard point cloud data may be point cloud data of a better quality selected from the obtained point cloud data of the target object and the reference object. The region of interest may be a region of the target object, a region of the reference object, or a point of the target object used for calculating the distance and a point of the reference object used for the distance. Of course, the region of interest may be set according to actual needs, and is not particularly limited herein.
In some embodiments, the electronic device may pre-store the region of interest marked in the standard point cloud data, and then the electronic device may directly acquire the region of interest marked in the standard point cloud data.
In some embodiments, the electronic device may be in communication connection with another electronic device storing the region of interest marked in the standard point cloud data, so that the electronic device may acquire the region of interest marked in the standard point cloud data through the other electronic device.
In some embodiments, the electronic device may be a camera configured to acquire standard point cloud data of the target object and a reference; and marking the region of interest of the standard point cloud data. So as to obtain the region of interest marked in the standard point cloud data of the target object and the reference object, thereby utilizing the region of interest for subsequent calculation.
It should be noted that step 120 may also be performed before step 110, that is, the region of interest marked in the standard point cloud data of the target object and the reference object is obtained first, and then the depth map of the current target object and the reference object is obtained.
Step 130, registering the region of interest and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured.
The point cloud data to be measured is obtained by converting the acquired depth maps of the current target object and the reference object. Specifically, the conversion process may be to calculate the point cloud data to be measured by using internal parameters of an image acquisition device that acquires the depth map.
After obtaining the region of interest, the region of interest may be registered with point cloud data to be measured. For the point cloud data to be measured, local-overall registration can be performed to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured. Specifically, the first region of interest and the second region of interest may be respectively registered with the whole point cloud data to be measured, so as to obtain a rotation matrix and a translation vector; and acquiring the positioning point set according to the rotation matrix and the translation vector. The positioning point set comprises a first point set and a second point set, the first point set is the accurate positioning of the target object in the point cloud data to be measured, and the second point set is the accurate positioning of the reference object in the point cloud data to be measured. Thus, the electronic device may calculate the distance using the set of localization points, i.e., the first set of points and the second set of points.
And 140, calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
The target distance is defined as the distance between the target object and the reference object, and after the positioning point set is obtained, the target object and the reference object are accurately positioned in the point cloud data to be measured due to the positioning point set. Thus, the distance between the target object and the reference object, i.e. the target distance, can be calculated from the set of localization points. The positioning point set comprises a first point set and a second point set, the first point set represents the accurate positioning of the target object in the point cloud data to be measured, and the second point set represents the accurate positioning of the reference object in the point cloud data to be measured. When calculating the target distance, a plurality of point-to-point distances may be obtained from the first point set and the second point set; and calculating the distance between the target object and the reference object according to the plurality of point-to-point distances.
Since the first and second sets of points include a plurality of points, the resulting point-to-point distances are a plurality. As an embodiment, when the target distance is calculated from the plurality of point-to-point distances, an average value of the plurality of point-to-point distances may be calculated as the target distance.
As another embodiment, when the target distance is calculated according to the plurality of point-to-point distances, in order to eliminate the influence of noise and achieve accurate measurement, the plurality of point-to-point distances may be sorted to obtain sorted distances; selecting local distances in the sorted distances according to a preset condition; and calculating the mean value of the local distances as the target distance.
According to the target distance measuring method provided by the embodiment of the application, a depth map of a current target object and a reference object is obtained; acquiring an interest region marked in standard point cloud data of a target object and a reference object; registering the region of interest and point cloud data to be measured to obtain a positioning point set of the target object and a reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured; and then, calculating the target distance, namely the distance between the target object and the reference object according to the positioning point set, thereby obtaining the distance between the target object and the reference object with high precision and objectively and effectively replacing manual measurement.
Referring to fig. 2, a further embodiment of the present application provides a target distance measuring method, which focuses on the process of acquiring a region of interest on the basis of the foregoing embodiment, and specifically, the method may include the following steps.
Step 210, obtaining a depth map of the current target object and the reference object.
Step 210 may refer to corresponding parts of the foregoing embodiments, and will not be described herein.
Step 220, standard point cloud data of the target object and the reference object are obtained.
When the standard point cloud data of the target object and the reference object are obtained, the electronic equipment can obtain a depth map of the target object and the reference object; obtaining point cloud data by utilizing internal reference calculation of an image acquisition device for acquiring the depth map; and selecting the standard point cloud data from the point cloud data according to a selection instruction.
Wherein, the obtaining of the depth map can refer to the above description. The electronic device may convert the depth map of the target object and the reference object into point cloud data after acquiring the depth map. Specifically, the conversion process may be to calculate and obtain corresponding point cloud data by using internal parameters of an image acquisition device that acquires the depth map. After the point cloud data is obtained through calculation, data processing can be performed on the point cloud data, the data processing can be filtering, and algorithms adopted by the filtering can be direct-pass filtering, SOR filtering and the like.
The calculated point cloud data corresponds to the target object and the reference object, and after the point cloud data is obtained, standard point cloud data can be selected from the point cloud data of the target object and the reference object, wherein the standard point cloud data can be point cloud data with better quality in the obtained point cloud data. In some embodiments, a user may designate a point cloud data as a standard point cloud data, and specifically, a selected instruction may be sent to the electronic device, and the electronic device selects the standard point cloud data from the point cloud data according to the selected instruction.
In other embodiments, the point cloud data may be selected according to a selection condition. Specifically, the selection condition may be preset, after point cloud data of the target object and the reference object is obtained, whether the obtained point cloud data meets the selection condition is determined, and one of the point cloud data meeting the selection condition is used as the standard point cloud data. Since the standard point cloud data may be point cloud data with good quality, with little or no point cloud loss, the selection condition may be related to the quality of the point cloud data or to the integrity of the point cloud data. Of course, the selection condition may be set according to actual needs, and is not specifically limited herein.
And step 230, marking the region of interest of the standard point cloud data.
After the standard point cloud data is obtained, the point cloud data can be labeled in the region of interest, wherein the labeled point cloud data can be point cloud data of the target object and the reference object in the standard point cloud data, and point cloud data of the target object and the reference object for calculating the distance in the standard point cloud data.
When the electronic device marks the region of interest, the electronic device may cut the standard point cloud data to obtain a first region of interest and a second region of interest, where the first region of interest is point cloud data corresponding to the target object, and the second region of interest is point cloud data corresponding to the reference object; and obtaining a third region of interest and a fourth region of interest based on semantic annotation, wherein the third region of interest is a point of the target object used for calculating the distance, and the fourth region of interest is a point of the reference object used for calculating the distance. Thus, a region of interest may be marked in the standard point cloud data, and the marked region of interest may be used in a subsequent step.
Specifically, the standard point cloud data may be cut based on cloudbuare software, the point cloud data corresponding to the target object and the point cloud data corresponding to the reference object are cut, the point cloud data corresponding to the target object is used as the first region of interest, and the point cloud data corresponding to the reference object is used as the second region of interest. The electronic equipment can also accurately mark out the points of the target object for calculating the distance and the points of the reference object for calculating the distance based on point cloud semantic level marking software. And taking the point of the target object used for calculating the distance as the third interested area, and taking the point of the reference object used for calculating the distance as the fourth interested area.
It should be noted that the region of interest marked in the standard point cloud data can be obtained after the steps 220 and 230 are performed, and can be directly stored in the electronic device, and when the distance between the target object and the reference object is measured again, the marked region of interest can be directly obtained without repeatedly performing the steps 220 and 230.
The noted first, second, third and fourth regions of interest can thus be used in subsequent steps.
And 240, registering the region of interest and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured.
And 250, calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
The steps 240 to 250 can refer to the corresponding parts of the previous embodiments, and are not described herein again.
According to the target distance measuring method provided by the embodiment of the application, standard point cloud data of a target object and a reference object are obtained; and marking the region of interest of the standard point cloud data, so that a target object and a reference object can be accurately determined, and points of the target object and the reference object for calculating the distance can be accurately determined. Registering the region of interest and point cloud data to be measured to obtain a positioning point set of the target object and a reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured; and then, calculating the target distance, namely the distance between the target object and the reference object according to the positioning point set, thereby obtaining the distance between the target object and the reference object with high precision and objectively and effectively replacing manual measurement.
After the region of interest is obtained, the region of interest and the point cloud data to be measured can be registered to obtain the positioning of the target object and the reference object in the point cloud data to be measured, so that the distance can be calculated conveniently. Referring to fig. 3, another embodiment of the present application provides a method for measuring a target distance, which focuses on the process of obtaining a set of positioning points of a target object and a reference object in point cloud data to be measured based on the foregoing embodiment.
In step 310, a depth map of the current target object and the reference object is obtained.
And step 320, acquiring the marked region of interest in the standard point cloud data of the target object and the reference object.
Step 310 and step 320 can refer to the corresponding parts of the previous embodiments, and are not described herein again.
And 330, registering the first region of interest and the second region of interest with the point cloud data to be measured respectively to obtain a rotation matrix and a translation vector.
And in the marked interesting regions, a first interesting region is point cloud data corresponding to the target object, and a second interesting region is point cloud data corresponding to the reference object. For point cloud data to be measured, local-global registration can be performed. Specifically, the first region of interest is registered with the point cloud data to be measured, and the second region of interest is registered with the point cloud data to be measured, so that a rotation matrix and a translation vector can be obtained. The rotation matrix comprises a rotation matrix corresponding to the target object and a rotation matrix corresponding to the reference object; the translation vector comprises a translation vector corresponding to the target object and a translation vector corresponding to the reference object.
That is, since the first region of interest is point cloud data corresponding to the target object, the point cloud data and the point cloud data to be measured are registered, and a rotation matrix and a translation vector corresponding to the target object can be obtained. And registering the point cloud data and the point cloud data to be measured to obtain a rotation matrix and a translation vector corresponding to the reference object.
Step 340, obtaining the positioning point set according to the rotation matrix and the translation vector.
And after the rotation matrix and the translation vector are obtained, acquiring a positioning point set according to the rotation matrix and the translation vector. The rotation matrix and the translation vector can transform the region of interest into a coordinate system which is the same as the point cloud data to be measured. Therefore, the rotation matrix and the translation vector can be respectively applied to the third region of interest and the fourth region of interest to obtain an intermediate point set; and performing neighborhood search in the point cloud data to be measured by utilizing the intermediate point set to obtain a first point set and a second point set, wherein the first point set represents the accurate positioning of a target object in the point cloud data to be measured, and the second point set represents the accurate positioning of a reference object in the point cloud data to be measured.
And the intermediate point set is obtained by transforming a third region of interest and a fourth region of interest in the standard point cloud data to the coordinate system of the point cloud data to be measured. Wherein the intermediate point set comprises a point set corresponding to a target object and a point set corresponding to the reference object. And performing neighborhood search in the point cloud data to be measured by utilizing the intermediate point set to obtain a first point set of the target object in the point cloud data to be measured and a second point set of the reference object in the point cloud data to be measured so as to accurately position the target object and the reference object.
If the point set corresponding to the target object in the middle point set is represented as roi3 ', the point set corresponding to the reference object in the middle point set is represented as roi 4', the point cloud data to be measured is represented as cur, the first point set is represented as target1, and the second point set is represented as target2, then the first point set and the second point set need to satisfy the following conditional expressions.
target1={p∈cur|‖p-q‖2≤δ,q∈roi3`}
target2={p∈cur|‖p-q‖2≤δ,q∈roi4`}
Where δ is a manually set hyper-parameter.
And 350, calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
Step 350 may refer to the corresponding description of the foregoing embodiments, and is not repeated herein.
According to the target distance measuring method provided by the embodiment of the application, a first region of interest and a second region of interest are respectively registered with point cloud data to be measured, so that a rotation matrix and a translation vector are obtained; and acquiring the positioning point set according to the rotation matrix and the translation vector, so that the target object and the reference object can be accurately positioned. And then, calculating the target distance, namely the distance between the target object and the reference object according to the positioning point set, thereby obtaining the distance between the target object and the reference object with high precision and objectively and effectively replacing manual measurement.
Referring to fig. 4, a further embodiment of the present application provides a method for measuring a target distance, which focuses on the process of calculating a target distance according to the positioning point set on the basis of the foregoing embodiment, and specifically, the method may include the following steps.
Step 410, obtaining a depth map of the current target object and the reference object.
Step 420, acquiring the marked region of interest in the standard point cloud data of the target object and the reference object.
And 430, registering the region of interest and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured.
The corresponding parts of the foregoing embodiments can be referred to in steps 410 to 430, and are not described herein again.
Step 440, a plurality of point-to-point distances are obtained from the first set of points and the second set of points.
Step 450, calculating the target distance according to the plurality of point-to-point distances.
Wherein the set of localization points comprises a first set of points representing an accurate localization of a target object in the point cloud data to be measured and a second set of points representing an accurate localization of a reference object in the point cloud data to be measured, then the target distance can be obtained by the first set of points and the second set of points. A plurality of point-to-point distances may be derived from the first set of points and the second set of points, such that the target distance may be calculated from the plurality of point-to-point distances. Assuming that there are 5 points in the first point set and 10 points in the second point set, the number of the corresponding obtained point-to-point distances is 50.
In some embodiments, after solving for the plurality of point-to-point distances, a minimum value of the plurality of point-to-point distances may be selected as the target distance.
In other embodiments, in order to eliminate the influence of noise and achieve accurate measurement, the plurality of point-to-point distances may be sorted to obtain sorted distances; selecting a local distance from the sorted distances according to a preset condition; and calculating the mean value of the local distances as the target distance.
Specifically, the sorting of the plurality of point-to-point distances may be in order from small to large. Obtaining the sorted distance in terms of small to large may be using the sorted function in Python, assuming that the sorted distance is denoted as dists, the first set of points is target1, the second set of points is target2, then dists is sorted { | p-q |)2|p∈target1,q∈target2}。
After the sorted distances are obtained, a local distance may be selected from the sorted distances according to a preset condition, where the preset condition may be preset, and the content may be that a preset proportion or a preset number of the sorted distances are selected as the local distance, or that a preset number of the sorted distances are selected as the local distance. And after the local distance is obtained, calculating the average value of the local distances as the target distance. The preset condition may be a distance with a smaller numerical value among the set distances from the selected point to the point, for example, the preset condition may be that the distance value of the 20 th to 50 th items in the sorted distances is selected as the local distance, or the distance value of the first 2% to 3%% in the sorted distances is selected as the local distance, and then the average value of the local distances is calculated to obtain the target distance.
If the point-to-point distances are sorted in the descending order, the preset condition may be that the distance value of the 50 th to 20 th item in the sorted distances is selected as the local distance, or that the distance value of the last 2% o to 3% o in the sorted distances is selected as the local distance.
According to the target distance measuring method provided by the embodiment of the application, after the positioning point set is obtained through calculation, namely the first point set and the second point set, the target object and the reference object can be accurately positioned, and then the first point set and the second point set are utilized to calculate the target distance, so that the distance between the target object and the reference object can be objectively obtained with high precision, and the measurement can be effectively completed in place of manual work.
Referring to fig. 5, an embodiment of the present application provides a target distance measuring device 500, which can be applied to an electronic device, where the target distance measuring device 500 includes a first obtaining module 510, a second obtaining module 520, a registration module 530, and a calculation module 540. The first obtaining module 510 is configured to obtain a depth map of a current target object and a reference object; a second obtaining module 520, configured to obtain an area of interest labeled in the standard point cloud data of the target object and the reference object; the registration module 530 is configured to register the region of interest and point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, where the point cloud data to be measured is point cloud data corresponding to the depth map; the calculating module 540 is configured to calculate a target distance according to the positioning point set, where the target distance is a distance between the target object and a reference object.
Further, the second obtaining module 520 is further configured to obtain standard point cloud data of the target object and the reference object; and marking the region of interest of the standard point cloud data.
Further, the second obtaining module 520 is further configured to obtain depth maps of the target object and the reference object; obtaining point cloud data by utilizing internal reference calculation of an image acquisition device for acquiring the depth map; and selecting standard point cloud data from the point cloud data according to a selection instruction.
Further, the second obtaining module 520 is further configured to crop the standard point cloud data to obtain a first region of interest and a second region of interest, where the first region of interest is point cloud data corresponding to the target object, and the second region of interest is point cloud data corresponding to the reference object; and obtaining a third region of interest and a fourth region of interest based on semantic annotation, wherein the third region of interest is a point of the target object used for calculating the distance, and the fourth region of interest is a point of the reference object used for calculating the distance.
Further, the registration module 530 is further configured to register the first region of interest and the second region of interest with the point cloud data to be measured, respectively, so as to obtain a rotation matrix and a translation vector; and acquiring the positioning point set according to the rotation matrix and the translation vector.
Further, the registration module 530 is further configured to apply the rotation matrix and the translation vector to the third region of interest and the fourth region of interest, respectively, to obtain an intermediate point set; and performing neighborhood search in the point cloud data to be measured by utilizing the intermediate point set to obtain a first point set and a second point set, wherein the first point set represents the accurate positioning of a target object in the point cloud data to be measured, and the second point set represents the accurate positioning of a reference object in the point cloud data to be measured.
Further, the calculating module 540 is further configured to obtain a plurality of point-to-point distances according to the first point set and the second point set; calculating the target distance from the plurality of point-to-point distances.
Further, the calculating module 540 is further configured to sort the plurality of point-to-point distances to obtain sorted distances; selecting a local distance from the sorted distances according to a preset condition; and calculating the mean value of the local distances as the target distance.
The target distance measuring device provided by the embodiment of the application acquires the depth maps of the current target object and the reference object; acquiring an interest region marked in standard point cloud data of a target object and a reference object; and registering the interesting region and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured. And then the distance between the target object and the reference object is calculated according to the positioning point set, so that the distance between the target object and the reference object can be objectively obtained with high precision, and the manual measurement can be effectively replaced.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working process of the above-described apparatus may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Referring to fig. 6, an embodiment of the present application provides a block diagram of an electronic device, where the electronic device 600 includes a processor 610, a memory 620, and one or more applications, where the one or more applications are stored in the memory 620 and configured to be executed by the one or more processors 610, and the one or more programs are configured to perform the method for measuring the target distance.
The electronic device 600 may be a terminal device capable of running an application, such as a smart phone, a tablet computer, an electronic book, or may be a server. The electronic device 600 in the present application may include one or more of the following components: a processor 610, a memory 620, and one or more applications, wherein the one or more applications may be stored in the memory 620 and configured to be executed by the one or more processors 610, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
The processor 610 may include one or more processing cores. The processor 610, using various interfaces and connections throughout the electronic device 600, performs various functions and processes data for the electronic device 500 by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 620, and invoking data stored in the memory 620. Alternatively, the processor 610 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 610 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 610, but may be implemented by a communication chip.
The Memory 620 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 620 may be used to store instructions, programs, code sets, or instruction sets. The memory 620 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created during use by the electronic device 600 (e.g., phone books, audio-visual data, chat log data), and so forth.
In some embodiments, the electronic device 600 may further include an image capture device that may be used to capture a depth map.
The electronic equipment provided by the embodiment of the application acquires the depth maps of the current target object and the reference object; acquiring an interest region marked in standard point cloud data of a target object and a reference object; and registering the interesting region and the point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, so that the target object and the reference object can be accurately positioned in the point cloud data to be measured. And then the distance between the target object and the reference object is calculated according to the positioning point set, so that the distance between the target object and the reference object can be objectively obtained with high precision, and the manual measurement can be effectively replaced.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (14)

1. A method of measuring a distance to a target, the method comprising:
acquiring a depth map of a current target object and a reference object;
acquiring an interest region marked in standard point cloud data of a target object and a reference object;
registering the interesting region and point cloud data to be measured to obtain a positioning point set of the target object and a reference object in the point cloud data to be measured, wherein the point cloud data to be measured is point cloud data corresponding to the depth map;
and calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
2. The method of claim 1, wherein the acquiring of the marked region of interest in the standard point cloud data of the target object and the reference object comprises:
acquiring standard point cloud data of the target object and a reference object;
and marking the region of interest of the standard point cloud data.
3. The method of claim 2, wherein the obtaining of the standard point cloud data of the target object and the reference object comprises:
acquiring depth maps of a target object and a reference object;
obtaining point cloud data by utilizing internal reference calculation of an image acquisition device for acquiring the depth map;
and selecting standard point cloud data from the point cloud data according to a selection instruction.
4. The method of claim 2, wherein the labeling of the region of interest of the standard point cloud data comprises:
cutting the standard point cloud data to obtain a first region of interest and a second region of interest, wherein the first region of interest is point cloud data corresponding to the target object, and the second region of interest is point cloud data corresponding to the reference object;
and obtaining a third region of interest and a fourth region of interest based on semantic annotation, wherein the third region of interest is a point of the target object used for calculating the distance, and the fourth region of interest is a point of the reference object used for calculating the distance.
5. The method of claim 4, wherein the registering the region of interest with point cloud data to be measured, resulting in a set of localization points of the target object and a reference in the point cloud data to be measured, comprises:
registering the first region of interest and the second region of interest with the point cloud data to be measured respectively to obtain a rotation matrix and a translation vector;
and acquiring the positioning point set according to the rotation matrix and the translation vector.
6. The method of claim 5, wherein said obtaining the set of localization points from the rotation matrix and the translation vector comprises:
respectively acting the rotation matrix and the translation vector on the third region of interest and the fourth region of interest to obtain an intermediate point set;
and performing neighborhood search in the point cloud data to be measured by utilizing the intermediate point set to obtain a first point set and a second point set, wherein the first point set represents the accurate positioning of a target object in the point cloud data to be measured, and the second point set represents the accurate positioning of a reference object in the point cloud data to be measured.
7. The method of claim 6, wherein said calculating a target distance from said set of localization points comprises:
obtaining a plurality of point-to-point distances according to the first point set and the second point set;
calculating the target distance from the plurality of point-to-point distances.
8. The method of claim 7, wherein said calculating the target distance from the plurality of point-to-point distances comprises:
sorting the plurality of point-to-point distances to obtain sorted distances;
selecting a local distance from the sorted distances according to a preset condition;
and calculating the mean value of the local distances as the target distance.
9. An object distance measuring device, characterized in that the device comprises:
the first acquisition module is used for acquiring a depth map of a current target object and a reference object;
the second acquisition module is used for acquiring an interest region marked in standard point cloud data of a target object and a reference object;
the registration module is used for registering the interesting region and point cloud data to be measured to obtain a positioning point set of the target object and the reference object in the point cloud data to be measured, and the point cloud data to be measured is point cloud data corresponding to the depth map;
and the calculating module is used for calculating a target distance according to the positioning point set, wherein the target distance is the distance between the target object and a reference object.
10. The apparatus of claim 9, wherein the second acquisition module is further configured to acquire standard point cloud data of the target object and a reference object; and marking the region of interest of the standard point cloud data.
11. The apparatus of claim 9, wherein the labeling module is further configured to crop the standard point cloud data to obtain a first region of interest and a second region of interest, the first region of interest is point cloud data corresponding to the target object, and the second region of interest is point cloud data corresponding to the reference object; and obtaining a third region of interest and a fourth region of interest based on semantic annotation, wherein the third region of interest is a point of the target object used for calculating the distance, and the fourth region of interest is a point of the reference object used for calculating the distance.
12. The device of claim 11, wherein the registration module is further configured to register the first region of interest and the second region of interest with the point cloud data to be measured, respectively, to obtain a rotation matrix and a translation vector; and acquiring the positioning point set according to the rotation matrix and the translation vector.
13. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory electrically connected with the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-8.
14. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 8.
CN202110117982.2A 2021-01-28 2021-01-28 Target distance measuring method, device, electronic apparatus and storage medium Pending CN112862882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110117982.2A CN112862882A (en) 2021-01-28 2021-01-28 Target distance measuring method, device, electronic apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110117982.2A CN112862882A (en) 2021-01-28 2021-01-28 Target distance measuring method, device, electronic apparatus and storage medium

Publications (1)

Publication Number Publication Date
CN112862882A true CN112862882A (en) 2021-05-28

Family

ID=75987589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110117982.2A Pending CN112862882A (en) 2021-01-28 2021-01-28 Target distance measuring method, device, electronic apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN112862882A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114812391A (en) * 2022-04-19 2022-07-29 广东电网有限责任公司 Method, device, equipment and storage medium for measuring minimum safe distance of power equipment
CN116245776A (en) * 2023-03-06 2023-06-09 北醒(北京)光子科技有限公司 Point cloud data fusion method and device, laser radar and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108413864A (en) * 2017-02-10 2018-08-17 菜鸟智能物流控股有限公司 Object size measuring method and related equipment
CN109990703A (en) * 2019-03-18 2019-07-09 桂林电子科技大学 A kind of size detecting method and system of prefabricated components
CN110068826A (en) * 2019-03-27 2019-07-30 东软睿驰汽车技术(沈阳)有限公司 A kind of method and device of ranging
CN110322553A (en) * 2019-07-10 2019-10-11 广州建通测绘地理信息技术股份有限公司 The method and system of laser radar point cloud mixed reality scene implementation setting-out
CN111612841A (en) * 2020-06-22 2020-09-01 上海木木聚枞机器人科技有限公司 Target positioning method and device, mobile robot and readable storage medium
CN111932676A (en) * 2020-08-24 2020-11-13 华中科技大学 Device and method for quickly measuring railway gauge

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108413864A (en) * 2017-02-10 2018-08-17 菜鸟智能物流控股有限公司 Object size measuring method and related equipment
CN109990703A (en) * 2019-03-18 2019-07-09 桂林电子科技大学 A kind of size detecting method and system of prefabricated components
CN110068826A (en) * 2019-03-27 2019-07-30 东软睿驰汽车技术(沈阳)有限公司 A kind of method and device of ranging
CN110322553A (en) * 2019-07-10 2019-10-11 广州建通测绘地理信息技术股份有限公司 The method and system of laser radar point cloud mixed reality scene implementation setting-out
CN111612841A (en) * 2020-06-22 2020-09-01 上海木木聚枞机器人科技有限公司 Target positioning method and device, mobile robot and readable storage medium
CN111932676A (en) * 2020-08-24 2020-11-13 华中科技大学 Device and method for quickly measuring railway gauge

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114812391A (en) * 2022-04-19 2022-07-29 广东电网有限责任公司 Method, device, equipment and storage medium for measuring minimum safe distance of power equipment
CN114812391B (en) * 2022-04-19 2023-10-20 广东电网有限责任公司 Minimum safe distance measuring method, device, equipment and storage medium for power equipment
CN116245776A (en) * 2023-03-06 2023-06-09 北醒(北京)光子科技有限公司 Point cloud data fusion method and device, laser radar and storage medium
CN116245776B (en) * 2023-03-06 2024-01-23 北醒(北京)光子科技有限公司 Point cloud data fusion method and device, laser radar and storage medium

Similar Documents

Publication Publication Date Title
CN107909107B (en) Fiber detection method and device and electronic equipment
CN109886928B (en) Target cell marking method, device, storage medium and terminal equipment
CN112862882A (en) Target distance measuring method, device, electronic apparatus and storage medium
EP2889835A1 (en) Object discrimination device, object discrimination method, and program
CN110458772B (en) Point cloud filtering method and device based on image processing and storage medium
JP2017508197A (en) Incremental learning for dynamic feature database management in object recognition systems
CN112336342B (en) Hand key point detection method and device and terminal equipment
CN111506731B (en) Method, device and equipment for training field classification model
CN112966711A (en) Pointer instrument indicating number identification method and system based on convolutional neural network
CN115937203B (en) Visual detection method, device, equipment and medium based on template matching
CN112100359A (en) Test case searching method, device, equipment and storage medium
CN115035367A (en) Picture identification method and device and electronic equipment
CN112132812A (en) Certificate checking method and device, electronic equipment and medium
CN105488470A (en) Method and apparatus for determining character attribute information
CN112907671B (en) Point cloud data generation method and device, electronic equipment and storage medium
CN114593681A (en) Thickness measuring method, thickness measuring apparatus, electronic device, and storage medium
CN111507431B (en) Medical image classification method, device, system and readable medium
CN113743254A (en) Sight estimation method, sight estimation device, electronic equipment and storage medium
CN110334174B (en) POS data deviation rectifying method and system
CN110399289B (en) Evaluation method and device for application program test, server and storage medium
CN111141217A (en) Object measuring method, device, terminal equipment and computer storage medium
WO2019128366A1 (en) Test sample notch positioning method and device
JP2019128881A (en) Article classification device, article classification system, article classification method and program
CN113537407B (en) Image data evaluation processing method and device based on machine learning
TWI510942B (en) System and method for outputting measurement codes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210528