[go: up one dir, main page]

CN117826167A - A distance measurement method, device, equipment and medium - Google Patents

A distance measurement method, device, equipment and medium Download PDF

Info

Publication number
CN117826167A
CN117826167A CN202311861937.3A CN202311861937A CN117826167A CN 117826167 A CN117826167 A CN 117826167A CN 202311861937 A CN202311861937 A CN 202311861937A CN 117826167 A CN117826167 A CN 117826167A
Authority
CN
China
Prior art keywords
image
telecentric lens
preset
calibration
measured
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
CN202311861937.3A
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 Boshixiangyuan Technology Co ltd
Original Assignee
Beijing Boshixiangyuan 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 Boshixiangyuan Technology Co ltd filed Critical Beijing Boshixiangyuan Technology Co ltd
Priority to CN202311861937.3A priority Critical patent/CN117826167A/en
Publication of CN117826167A publication Critical patent/CN117826167A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/02Systems using the reflection of electromagnetic waves other than radio waves
    • G01S17/06Systems determining position data of a target
    • G01S17/08Systems determining position data of a target for measuring distance only
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/88Lidar systems specially adapted for specific applications
    • G01S17/89Lidar systems specially adapted for specific applications for mapping or imaging
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S7/00Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
    • G01S7/48Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S17/00
    • G01S7/497Means for monitoring or calibrating

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Electromagnetism (AREA)
  • Measurement Of Optical Distance (AREA)

Abstract

The invention discloses a ranging method, a ranging device, ranging equipment and ranging media, wherein the ranging method comprises the following steps: collecting a first image of an object to be measured at a first calibration position in the depth of field range of a telecentric lens; collecting a second image of the object to be measured at a second calibration position; collecting a third image of the object to be measured at a third calibration position; respectively acquiring a difference value of the first image and the second image and a difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image; substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured. According to the invention, the images of the object to be measured at different positions are acquired for three times, higher performance computing hardware is not needed, and higher ranging precision can be obtained only by acquiring the images of the object to be measured at different calibration positions.

Description

Ranging method, device, equipment and medium
Technical Field
The present invention relates to the field of three-dimensional ranging technologies, and in particular, to a ranging method, apparatus, device, and medium.
Background
Three-dimensional ranging is an important technique for acquiring three-dimensional spatial information of an object, including distance, height, shape and position. The continued development and innovation in this area has had profound effects in numerous application areas such as machine vision, autopilot, industrial automation, medical imaging, and virtual reality. The three-dimensional ranging technology which is widely applied comprises the technologies of laser radar, structured light, time-of-flight photography, stereoscopic vision, millimeter wave radar, sonar and the like, and different methods are corresponding to different application scenes.
With the development of computer vision and image sensor technology, more and more depth measurement methods are developed to facilitate three-dimensional ranging of scenes. Time of flight (TOF) measures the phase difference between the emitted and reflected infrared waves to estimate the depth from each sensor pixel to the object. It has been applied to many fields of robot navigation, gesture recognition, etc. Another popular and efficient method is structured light technology. The modulated light is projected onto the object, and the scene depth can be accurately obtained through decoding analysis of the reflected image. The technology is mainly used for games and 3D scanning, and particularly for industrial automation. Both of these methods are sensitive to ambient light and are not suitable for outdoor applications.
The passive depth measurement is to obtain the scene depth by utilizing the natural light image obtained by the imaging system and utilizing the image characteristics such as parallax, ambiguity and the like, so that the application environment and the application scene are wider. However, prior art methods require high performance computing hardware to achieve real-time depth estimation, but may be sensitive to illumination conditions and lens parameters. Under different lighting conditions, or when using different types of lenses, their performance may be affected.
Disclosure of Invention
The invention provides a ranging method, a device, equipment and a medium, which can acquire high ranging precision by acquiring images of an object to be measured at different positions for three times without higher-performance computing hardware and only acquiring images of the object to be measured at different calibration positions.
In a first aspect, an embodiment of the present invention provides a ranging method, including:
collecting a first image of an object to be measured at a first calibration position in the depth of field range of a telecentric lens;
controlling an electric displacement table to move the object to be measured to a second calibration position by a preset distance in a direction approaching to the telecentric lens, wherein the second calibration position enables the object to be measured to be positioned between the depth of field of the near end of the telecentric lens and the surface of the telecentric lens, which is close to one side of the object to be measured;
collecting a second image of the object to be measured at the second calibration position;
controlling the electric displacement table to move the object to be measured to a third calibration position in a direction away from the telecentric lens, wherein the third calibration position enables the object to be measured to be positioned at one side of the far-end depth of field of the telecentric lens, which is away from the telecentric lens, and the distance from the first calibration position is the preset distance;
collecting a third image of the object to be measured at the third calibration position;
respectively acquiring a difference value of the first image and the second image and a difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image;
substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured.
Optionally, the method for acquiring the preset nonlinear polynomial model includes:
respectively acquiring fourth images of the calibration flat plate at different first preset positions in the depth of field range of the telecentric lens;
respectively acquiring fifth images of the calibration flat plate, which are positioned at different second preset positions smaller than the depth of field of the telecentric lens;
respectively acquiring sixth images of the calibration flat plate, which are positioned at different third preset positions larger than the depth of field of the telecentric lens;
respectively acquiring differences between the fourth image at different first preset positions and the fifth image at corresponding different second preset positions and differences between the fourth image at different first preset positions and the sixth image at corresponding different third preset positions to obtain corresponding different gray difference image groups;
respectively obtaining the difference value of the fourth image and the corresponding fifth image in different gray difference value image groups and dividing the difference value of the fourth image and the corresponding sixth image to form different data sets;
substituting different distances between the first preset positions and the depth of field of the near end of the telecentric lens and different data sets into a preset overdetermined equation set to obtain the value of an unknown parameter;
substituting the unknown parameters into a preset nonlinear polynomial to obtain the preset nonlinear polynomial model.
Optionally, before separately acquiring the fifth image of the calibration plate at a different second preset position smaller than the depth of field of the telecentric lens, the method further comprises:
and controlling the electric displacement platform to move the calibration flat plate from the first preset position to the side close to the telecentric lens by the preset distance, so that the calibration flat plate is positioned at the second preset position.
Optionally, the method further includes respectively acquiring sixth images of the calibration flat plate at different third preset positions greater than the depth of field of the telecentric lens, and further includes:
and controlling the electric displacement platform to move the calibration flat plate from the first preset position to the side far away from the telecentric lens by the preset distance, so that the calibration flat plate is positioned at the second preset position.
Optionally, the preset overestimated equation set includes:wherein x1-xn is different data sets, k1-kn is an unknown parameter, and H1-Hn is different distances between the first preset position and the surface of the telecentric lens, which is close to one side of the calibration plane.
Optionally, substituting different distances between the first preset position and the near-end depth of field of the telecentric lens and different data sets into a preset oversubstance equation set, and calculating the value of the unknown parameter includes:
order theSimplifying the set of overdetermined equations to ak=b;
calculating the unknown parameter k= (a) by a least squares fitting algorithm T A) -1 A T b。
Optionally, substituting the unknown parameter into a preset nonlinear polynomial to obtain the preset nonlinear polynomial model includes:
and substituting the unknown parameters into the preset nonlinear polynomial to obtain the preset nonlinear polynomial model, wherein the degree of the highest order term of the preset nonlinear polynomial is 2.
In a second aspect, an embodiment of the present invention further provides a ranging apparatus, including:
the image acquisition module is used for acquiring a first image of an object to be detected at a first calibration position within the depth of field of the telecentric lens, acquiring a second image of the object to be detected at a second calibration position and acquiring a third image of the object to be detected at a third calibration position;
the electronic displacement platform control module is used for controlling the electronic displacement platform to move the object to be detected to a second calibration position in a direction approaching to the telecentric lens, controlling the electronic displacement platform to move the object to be detected to a third calibration position in a direction away from the telecentric lens, wherein the second calibration position enables the object to be detected to be positioned between the depth of field of the near end of the telecentric lens and the surface of the telecentric lens, which is close to one side of the object to be detected, and the third calibration position enables the object to be detected to be positioned on one side of the telecentric lens, which is far away from the telecentric lens, and the distance from the first calibration position is the preset distance;
the gray difference image acquisition module is used for respectively acquiring the difference value of the first image and the second image and the difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image;
and the distance acquisition module is used for substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured.
In a third aspect, an embodiment of the present invention further provides a ranging apparatus, including: the camera, the telecentric lens, the annular light source and the calibration flat plate are coaxially arranged in sequence along the direction close to one side of the electric displacement table;
the ranging apparatus further comprises at least one processor; and a memory communicatively coupled to the at least one processor;
the camera, the annular light source and the electric displacement table are all connected with the processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the ranging method as described in the first aspect.
In a fourth aspect, embodiments of the present invention also provide a computer readable storage medium storing computer instructions for causing a processor to implement the ranging method according to the first aspect when executed.
The embodiment of the invention provides a ranging method, a ranging device, ranging equipment and ranging media, wherein the ranging method comprises the following steps: collecting a first image of an object to be measured at a first calibration position in the depth of field range of a telecentric lens; controlling the electric displacement table to move the object to be measured to a second calibration position in a direction approaching the telecentric lens by a preset distance, wherein the second calibration position enables the object to be measured to be positioned between the depth of field of the near end of the telecentric lens and the surface of one side of the telecentric lens approaching the object to be measured; collecting a second image of the object to be measured at a second calibration position; controlling the electric displacement table to move the object to be measured to a third calibration position in a direction away from the telecentric lens, wherein the third calibration position enables the object to be measured to be positioned at one side of the far-end depth of field of the telecentric lens, which is away from the telecentric lens, and the distance from the first calibration position is a preset distance; collecting a third image of the object to be measured at a third calibration position; respectively acquiring a difference value of the first image and the second image and a difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image; substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured. According to the invention, the images of the object to be measured at different positions are acquired for three times, higher performance computing hardware is not needed, and higher ranging precision can be obtained only by acquiring the images of the object to be measured at different calibration positions.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a ranging method according to an embodiment of the present invention;
fig. 2 is a schematic partial structure of a ranging apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a calibration position according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for obtaining a preset nonlinear polynomial model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a preset position according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus for verifying accuracy of a three-dimensional object height detection method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a ranging device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another ranging apparatus according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a portion of another ranging apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a ranging method according to an embodiment of the present invention, where the method may be applied to a situation where height calculation is performed on an object within a small depth of field, for example, height detection of a Ball Grid Array (BGA) solder paste, height detection of a sealing nail, etc., and the method may be implemented by using a ranging device, which may be implemented in a hardware and/or software form, and the ranging device may be configured in a processor.
For example, fig. 2 is a schematic partial structure diagram of a ranging apparatus according to an embodiment of the present invention, and referring to fig. 2, the apparatus includes a camera 1, a telecentric lens 2, an annular light source 3, a calibration flat plate 4, and an electric displacement platform 5, where the camera 1, the telecentric lens 2, the annular light source 3, and the calibration flat plate 4 are coaxially disposed in sequence along a direction approaching to one side of the electric displacement platform 5.
Wherein the camera 1 may comprise a high-speed industrial camera and the motorized displacement platform 5 may comprise a high-precision motorized displacement platform. It will be appreciated that the calibration plate 4 is only used when acquiring a predetermined nonlinear polynomial model.
With continued reference to fig. 1, the ranging method provided by the embodiment of the present invention includes the following steps:
s110, collecting a first image of an object to be measured at a first calibration position in the depth of field range of the telecentric lens.
The depth of field range is the area between the near-end depth of field of the telecentric lens and the far-end depth of field of the telecentric lens.
S120, controlling the electric displacement table to move the object to be measured to a second calibration position by a preset distance in a direction approaching the telecentric lens, wherein the second calibration position enables the object to be measured to be positioned between the depth of field of the near end of the telecentric lens and the surface of the telecentric lens on the side approaching the object to be measured.
The preset distance may be a depth of field distance of the telecentric lens, that is, a distance between a near-end depth of field of the telecentric lens and a far-end depth of field of the telecentric lens.
S130, collecting a second image of the object to be measured at a second calibration position.
S140, controlling the electric displacement table to move the object to be measured to a third calibration position in a direction away from the telecentric lens, wherein the third calibration position enables the object to be measured to be located at one side of the telecentric lens, far away from the telecentric lens, of the far-end depth of field, and the distance from the first calibration position is a preset distance.
S150, collecting a third image of the object to be measured at a third calibration position.
It will be appreciated that images acquired within the depth of field of the telecentric lens are sharp and images measured outside the depth of field of the telecentric lens are blurred.
S160, respectively obtaining a difference value of the first image and the second image and a difference value of the first image and the third image, and obtaining a first gray level difference image and a second gray level difference image.
S170, substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured.
Wherein the preset nonlinear polynomial model is thatWherein H is the distance between the object to be measured and the surface of the telecentric lens, which is close to the object to be measured, k1-kn are unknown parameters, Δg1 is a first gray difference image, Δg2 is a second gray difference image, and the first gray difference image and the second gray difference image are substituted into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to the object to be measured, so that a pair of height maps H Map can be obtained.
Fig. 3 is a schematic diagram of a calibration position according to an embodiment of the present invention, referring to fig. 2-3, a first calibration position 41 is located within a depth of field of the telecentric lens 2, a second calibration position 42 is located between a depth of field of a proximal end of the telecentric lens 2 and a surface 21 of the telecentric lens 2 near a side of the calibration plate 4, and a third calibration position 43 is located at a side of a depth of field of a distal end of the telecentric lens 2 far from the telecentric lens 2. The second calibration position 42 can be reached by controlling the electric displacement table 5 to move the object to be measured from the first calibration position 41 by a preset distance d in a direction approaching the telecentric lens 2, and the third calibration position 43 can be reached by controlling the electric displacement table 5 to move the object to be measured from the first calibration position 41 by a preset distance d in a direction far away from the telecentric lens 2.
According to the embodiment of the invention, the images of the object to be measured at different positions are acquired for three times, higher performance computing hardware is not needed, and higher ranging precision can be obtained only by acquiring the images of the object to be measured at different calibration positions.
Fig. 4 is a flowchart of a method for obtaining a preset nonlinear polynomial model according to an embodiment of the present invention, and optionally, on the basis of the above embodiment, referring to fig. 4, the method for obtaining a preset nonlinear polynomial model includes the following steps:
s210, respectively acquiring fourth images of the calibration flat plate at different first preset positions in the depth of field range of the telecentric lens.
S220, respectively acquiring fifth images of the calibration flat plate at different second preset positions smaller than the depth of field of the telecentric lens.
S230, respectively acquiring sixth images of the calibration flat plate at different third preset positions which are larger than the depth of field of the telecentric lens.
S240, respectively obtaining differences between the fourth image at different first preset positions and the fifth image at corresponding different second preset positions, and differences between the fourth image at different first preset positions and the sixth image at corresponding different third preset positions, so as to obtain corresponding different gray level difference image groups.
S250, respectively obtaining the difference value of the fourth image and the corresponding fifth image in the different gray level difference image groups and dividing the difference value of the fourth image and the corresponding sixth image to form different data sets.
S260, substituting different first preset positions and distances between the depth of field of the near end of the telecentric lens and different data sets into a preset overdetermined equation set to obtain values of unknown parameters.
S270, substituting the unknown parameters into a preset nonlinear polynomial to obtain a preset nonlinear polynomial model.
Optionally, with continued reference to fig. 4 based on the foregoing embodiment, before step S220, the method further includes:
s310, controlling the electric displacement table to move the calibration flat plate from the first preset position to the side close to the telecentric lens by a preset distance, so that the calibration flat plate is positioned at the second preset position.
Optionally, with continued reference to fig. 4 based on the foregoing embodiment, before step S230, the method further includes:
s320, controlling the electric displacement table to move the calibration flat plate from the first preset position to a side far away from the telecentric lens by a preset distance, so that the calibration flat plate is positioned at a third preset position.
Fig. 5 is a schematic diagram of a preset position provided in the embodiment of the present invention, referring to fig. 5, a different second preset position A2 is obtained by moving a corresponding first preset position A1 by a preset distance d toward a surface 21 of the telecentric lens 2 near to the calibration flat plate 4, and a different third preset position A3 is obtained by moving a corresponding first preset position A1 by a preset distance d toward a side of the distal depth of field far from the telecentric lens 2.
It will be appreciated that solving the n unknowns requires m sets of data sets (m > =n), one of which contains images of corresponding first, second and third preset positions, the first preset position being required to be within the depth of field.
Optionally, on the basis of the above embodiment, the preset overestimated equation set includes:wherein x1-xn are different data sets, k1-kn are unknown parameters, and H1-Hn are distances between different first preset positions and the surface of the telecentric lens, which is close to one side of the calibration plate.
Optionally, on the basis of the foregoing embodiment, substituting the distances between the different first preset positions and the near-end depth of field of the telecentric lens and the different data sets into the preset oversubstance equation set, and calculating the value of the unknown parameter includes:
order theSimplifying the overdetermined equation set to ak=b; calculating an unknown parameter k= (a) by a least squares fitting algorithm T A) -1 A T b。
Optionally, on the basis of the foregoing embodiment, substituting the unknown parameter into the preset nonlinear polynomial to obtain the preset nonlinear polynomial model includes: and substituting the unknown parameters into the preset nonlinear polynomial to obtain a preset nonlinear polynomial model, wherein the degree of the highest degree term of the preset nonlinear polynomial is 2.
It can be understood that experiments prove that when the degree of the highest order term of the preset nonlinear polynomial is 2, only 3 groups of pictures (9 pictures) need to be shot at minimum.
Fig. 6 is a schematic diagram of a device for verifying the accuracy of a three-dimensional object height detection method according to an embodiment of the present invention, referring to fig. 6, a step block 6 with 4 steps and a high-accuracy standard height difference is placed on an electric displacement table 5, a height map HMap is obtained by using the ranging method provided by the above embodiment, 4 rectangular step areas are extracted from the obtained height map, 6 height differences are shared correspondingly, the height difference of the area mean value is calculated by the height map, and the accuracy is evaluated by taking the difference with the high-accuracy standard height difference. Through the test, when the precision of the lifting platform is 0.1 micrometer, the distance measurement precision can reach 0.5 micrometer, and the higher the precision of the lifting platform is, the higher the distance measurement precision is.
The ranging method provided by the embodiment of the invention constructs a model by three photographing, comprising a clear position and two symmetrical fuzzy positions and depending on the gray level difference value and the distance of the image. Compared with the existing complex model with numerous parameters, the model has the advantages of small calculated amount and quick and convenient calibration process. Compared with the similar method, the method has the advantages that the requirements on hardware such as cameras and telecentric lenses are not strict, higher-performance computing hardware is not needed, and the ultra-high ranging accuracy can be obtained by only requiring a high-accuracy electric lifting table, which can reach 0.5 micrometer at most. The method is insensitive to illumination conditions and parameters of the camera and the telecentric lens, and the performance of the method is not affected under different illumination conditions or different lenses. Compared with the prior art, the technical scheme provided by the invention simplifies a complex and complicated out-of-focus ranging model, and can obtain the distance of an object by only shooting three images with different heights, so that the device is convenient to use and easy to program. This approach does not require additional high precision hardware devices to aid in imaging. The scheme is insensitive to illumination conditions, camera and telecentric lens parameters, can be applied to more measurement scenes, and has wide application range. In addition, the scheme has high precision, and the highest distance measurement precision can reach 0.5 micrometer when the ultra-high precision electric lifting table is used.
Fig. 7 is a schematic structural diagram of a ranging apparatus according to an embodiment of the present invention, and referring to fig. 7, the apparatus includes: an image acquisition module 710, an electric displacement table control module 720, a gray scale difference image acquisition module 730, and a distance acquisition module 740.
In the embodiment of the present invention, the image acquisition module 710 is configured to acquire a first image of an object to be measured at a first calibration position within a depth of field of the telecentric lens, acquire a second image of the object to be measured at a second calibration position, and acquire a third image of the object to be measured at a third calibration position. The electric displacement table control module 720 is used for controlling the electric displacement table to move the object to be measured to a second calibration position in a direction close to the telecentric lens, controlling the electric displacement table to move the object to be measured to a third calibration position in a direction far away from the telecentric lens, enabling the object to be measured to be located between the near-end depth of field of the telecentric lens and the surface of the telecentric lens, which is close to one side of the object to be measured, enabling the object to be measured to be located on one side of the telecentric lens, which is far away from the telecentric lens, and enabling the distance from the first calibration position to be a preset distance. The gray difference image obtaining module 730 is configured to obtain a difference between the first image and the second image and a difference between the first image and the third image, respectively, to obtain a first gray difference image and a second gray difference image. The distance obtaining module 740 is configured to substitute the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain a distance between the object to be measured and a surface of the telecentric lens, which is close to the object to be measured.
Optionally, based on the foregoing embodiment, the image acquisition module 710 is further configured to respectively acquire fourth images of the calibration flat plate located at different first preset positions within the depth of field of the telecentric lens, respectively acquire fifth images of the calibration flat plate located at different second preset positions smaller than the depth of field of the telecentric lens, and respectively acquire sixth images of the calibration flat plate located at different third preset positions larger than the depth of field of the telecentric lens. The gray difference image obtaining module 730 is further configured to obtain differences between the fourth image at the different first preset position and the fifth image at the corresponding different second preset position, and differences between the fourth image at the different first preset position and the sixth image at the corresponding different third preset position, respectively, so as to obtain corresponding different gray difference image groups.
Fig. 8 is a schematic structural diagram of another ranging apparatus according to an embodiment of the present invention, and optionally, based on the ranging apparatus in fig. 7, referring to fig. 8, the apparatus further includes: a data set acquisition module 810, an unknown parameter acquisition module 820, and a preset nonlinear polynomial acquisition module 830.
In the embodiment of the present invention, the data set obtaining module 810 is configured to obtain the difference between the fourth image and the corresponding fifth image in the different gray level difference image groups divided by the difference between the fourth image and the corresponding sixth image, respectively, to form different data sets. The unknown parameter obtaining module 820 is configured to substitute different first preset positions and distances between the near-end depth of field of the telecentric lens and different data sets into a preset overdetermined equation set to obtain values of the unknown parameters. The preset nonlinear polynomial acquisition module 830 is configured to substitute different first preset positions and distances between the near-end depth of field of the telecentric lens and different data sets into a preset overexposed equation set to obtain values of unknown parameters.
Optionally, based on the above embodiment, the electric displacement stage control module 720 is further configured to control the electric displacement stage to move the calibration flat plate from the first preset position to a side close to the telecentric lens by a preset distance, so that the calibration flat plate is located at the second preset position, and control the electric displacement stage to move the calibration flat plate from the first preset position to a side far from the telecentric lens by a preset distance, so that the calibration flat plate is located at the third preset position.
The ranging device provided by the embodiment of the invention can execute the ranging method provided by any embodiment of the invention, has corresponding functional modules and beneficial effects of the execution method, and is not described in detail in the embodiment of the invention, and reference is made to the ranging method provided by the embodiment.
Fig. 9 is a partial schematic diagram of another ranging apparatus provided by an embodiment of the present invention, which is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The ranging device may also represent various forms of mobile apparatuses such as personal digital processing, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing apparatuses. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 9, the ranging apparatus 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the ranging apparatus 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
It will be appreciated that the camera 1, the annular light source 3 and the motorized displacement stage 5 of fig. 2 are all connected to the processor 11 of fig. 9 (not shown in the figures).
The various components in ranging device 10 are connected to I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. Communication unit 19 allows ranging device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a ranging method.
In some embodiments, the ranging method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the ranging device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the ranging method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the ranging method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a ranging device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user may provide input to the ranging apparatus. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A ranging method, comprising:
collecting a first image of an object to be measured at a first calibration position in the depth of field range of a telecentric lens;
controlling an electric displacement table to move the object to be measured to a second calibration position by a preset distance in a direction approaching to the telecentric lens, wherein the second calibration position enables the object to be measured to be positioned between the depth of field of the near end of the telecentric lens and the surface of the telecentric lens, which is close to one side of the object to be measured;
collecting a second image of the object to be measured at the second calibration position;
controlling the electric displacement table to move the object to be measured to a third calibration position in a direction away from the telecentric lens, wherein the third calibration position enables the object to be measured to be positioned at one side of the far-end depth of field of the telecentric lens, which is away from the telecentric lens, and the distance from the first calibration position is the preset distance;
collecting a third image of the object to be measured at the third calibration position;
respectively acquiring a difference value of the first image and the second image and a difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image;
substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured.
2. The ranging method as defined in claim 1, wherein the method for obtaining the preset nonlinear polynomial model comprises:
respectively acquiring fourth images of the calibration flat plate at different first preset positions in the depth of field range of the telecentric lens;
respectively acquiring fifth images of the calibration flat plate, which are positioned at different second preset positions smaller than the depth of field of the telecentric lens;
respectively acquiring sixth images of the calibration flat plate, which are positioned at different third preset positions larger than the depth of field of the telecentric lens;
respectively acquiring differences between the fourth image at different first preset positions and the fifth image at corresponding different second preset positions and differences between the fourth image at different first preset positions and the sixth image at corresponding different third preset positions to obtain corresponding different gray difference image groups;
respectively obtaining the difference value of the fourth image and the corresponding fifth image in different gray difference value image groups and dividing the difference value of the fourth image and the corresponding sixth image to form different data sets;
substituting different distances between the first preset positions and the depth of field of the near end of the telecentric lens and different data sets into a preset overdetermined equation set to obtain the value of an unknown parameter;
substituting the unknown parameters into a preset nonlinear polynomial to obtain the preset nonlinear polynomial model.
3. The ranging method as recited in claim 2 wherein prior to separately acquiring fifth images of the calibration plate at different second preset positions less than the depth of field of the telecentric lens, further comprising:
and controlling the electric displacement platform to move the calibration flat plate from the first preset position to the side close to the telecentric lens by the preset distance, so that the calibration flat plate is positioned at the second preset position.
4. The ranging method as recited in claim 2 wherein separately capturing a sixth image of the calibration plate at a different third predetermined location greater than the depth of field of the telecentric lens further comprises:
and controlling the electric displacement platform to move the calibration flat plate from the first preset position to the side far away from the telecentric lens by the preset distance, so that the calibration flat plate is positioned at the third preset position.
5. The ranging method as defined in claim 2 wherein the set of predetermined equations comprises:wherein x1-xn is different data sets, k1-kn is an unknown parameter, and H1-Hn is different distances between the first preset position and the surface of the telecentric lens, which is close to one side of the calibration plane.
6. The ranging method as defined in claim 5 wherein substituting the different distances between the first predetermined location and the near-end depth of field of the telecentric lens and the different data sets into a predetermined set of overestimated equations to obtain the value of the unknown parameter comprises:
order theSimplifying the set of overdetermined equations to ak=b;
calculating the unknown parameter k= (a) by a least squares fitting algorithm T A) -1 A T b。
7. The ranging method as defined in claim 6, wherein substituting the unknown parameters into a predetermined nonlinear polynomial to obtain the predetermined nonlinear polynomial model comprises:
and substituting the unknown parameters into the preset nonlinear polynomial to obtain the preset nonlinear polynomial model, wherein the degree of the highest order term of the preset nonlinear polynomial is 2.
8. A ranging apparatus, comprising:
the image acquisition module is used for acquiring a first image of an object to be detected at a first calibration position within the depth of field of the telecentric lens, acquiring a second image of the object to be detected at a second calibration position and acquiring a third image of the object to be detected at a third calibration position;
the electronic displacement platform control module is used for controlling the electronic displacement platform to move the object to be detected to a second calibration position in a direction approaching to the telecentric lens, controlling the electronic displacement platform to move the object to be detected to a third calibration position in a direction away from the telecentric lens, wherein the second calibration position enables the object to be detected to be positioned between the depth of field of the near end of the telecentric lens and the surface of the telecentric lens, which is close to one side of the object to be detected, and the third calibration position enables the object to be detected to be positioned on one side of the telecentric lens, which is far away from the telecentric lens, and the distance from the first calibration position is the preset distance;
the gray difference image acquisition module is used for respectively acquiring the difference value of the first image and the second image and the difference value of the first image and the third image to obtain a first gray difference image and a second gray difference image;
and the distance acquisition module is used for substituting the first gray level difference image and the second gray level difference image into a preset nonlinear polynomial model to obtain the distance between the object to be measured and the surface of the telecentric lens, which is close to one side of the object to be measured.
9. A ranging apparatus, the ranging apparatus comprising: the camera, the telecentric lens, the annular light source and the calibration flat plate are coaxially arranged in sequence along the direction close to one side of the electric displacement table;
the ranging apparatus further comprises at least one processor; and a memory communicatively coupled to the at least one processor;
the camera, the annular light source and the electric displacement table are all connected with the processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the ranging method of any of claims 1-7.
10. A computer readable storage medium, characterized in that it stores computer instructions for causing a processor to implement the ranging method of any of claims 1-7 when executed.
CN202311861937.3A 2023-12-29 2023-12-29 A distance measurement method, device, equipment and medium Pending CN117826167A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311861937.3A CN117826167A (en) 2023-12-29 2023-12-29 A distance measurement method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311861937.3A CN117826167A (en) 2023-12-29 2023-12-29 A distance measurement method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117826167A true CN117826167A (en) 2024-04-05

Family

ID=90511040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311861937.3A Pending CN117826167A (en) 2023-12-29 2023-12-29 A distance measurement method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117826167A (en)

Similar Documents

Publication Publication Date Title
US10008005B2 (en) Measurement system and method for measuring multi-dimensions
CN107223269B (en) Three-dimensional scene positioning method and device
CN109640066B (en) Method and device for generating high-precision dense depth images
CN107588721A (en) The measuring method and system of a kind of more sizes of part based on binocular vision
CN116129422B (en) Monocular 3D target detection methods, devices, electronic equipment, and storage media
CN113014899B (en) Method, device and system for determining parallax of binocular images
CN112184828A (en) External parameter calibration method, device and autonomous vehicle for lidar and camera
CN103033145A (en) Method and system for identifying shapes of plurality of objects
CN107588730A (en) Utilize the method and device of AR device measuring height
CN112197708B (en) Measuring method and device, electronic device and storage medium
CN118518009B (en) Calibration parameter determining method, calibration method, medium and equipment
CN118031838A (en) A three-dimensional object height detection method, device, equipment and medium
CN117826167A (en) A distance measurement method, device, equipment and medium
CN120198501A (en) A visual positioning method, device, electronic equipment and medium
CN117351450B (en) Monocular 3D detection method and device, electronic equipment and storage medium
CN118351143A (en) A low-power multi-point image displacement online tracking measurement system, method and medium
CN115131507B (en) Image processing method, image processing device and meta space three-dimensional reconstruction method
CN118096858A (en) A method for measuring the phase distance between transformer bushings based on augmented reality technology
CN118429401A (en) Data fusion method, device, equipment and medium
CN117788423A (en) Fitting contour degree determining method, device, equipment and storage medium
CN117906613A (en) Paver navigation method, paver navigation device, paver navigation equipment, storage medium and paver
CN117788686A (en) A three-dimensional scene reconstruction method, device and electronic equipment based on 2D images
CN117456007A (en) Lidar and camera joint calibration method, device, equipment and storage medium
Gan et al. Multi-view photometric stereo using surface deformation
CN116563477A (en) Road identification point cloud generation method and device

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