CN113538544A - Target depth detection method and detection system - Google Patents

Target depth detection method and detection system Download PDF

Info

Publication number
CN113538544A
CN113538544A CN202110208464.1A CN202110208464A CN113538544A CN 113538544 A CN113538544 A CN 113538544A CN 202110208464 A CN202110208464 A CN 202110208464A CN 113538544 A CN113538544 A CN 113538544A
Authority
CN
China
Prior art keywords
pixel
value
distance
target
camera
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
CN202110208464.1A
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.)
Shanghai Hanshi Information Technology Co ltd
Original Assignee
Shanghai Hanshi 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 Shanghai Hanshi Information Technology Co ltd filed Critical Shanghai Hanshi Information Technology Co ltd
Priority to CN202110208464.1A priority Critical patent/CN113538544A/en
Publication of CN113538544A publication Critical patent/CN113538544A/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/50Depth or shape recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Measurement Of Optical Distance (AREA)

Abstract

The invention provides a target depth detection method and a target depth detection system, wherein the target depth detection method comprises the following steps: acquiring the focal length of a camera; acquiring a first pixel position of a target to be detected in a first image; moving the camera and obtaining a moving distance; acquiring a second pixel position of the target to be detected in a second image; simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera to serve as a distance measuring plane; extracting a first pixel abscissa value and a second pixel abscissa value and calculating a pixel distance value; and calculating the ratio of the pixel distance value to the moving distance, and calculating the depth value of the target to be detected by using the ratio and the focal distance. The invention can efficiently and accurately detect the depth value of the target to be detected by only adopting one camera.

Description

Target depth detection method and detection system
Technical Field
The invention relates to the technical field of distance detection, in particular to a target depth detection method and a target depth detection system.
Background
At present, the distance measurement mode comprises laser distance measurement, ultrasonic distance measurement, binocular depth camera distance measurement and the like, but the binocular depth camera has the defects of large equipment volume, high power consumption, high cost and the like.
Disclosure of Invention
The present invention is directed to overcome the disadvantages and drawbacks of the prior art, and to provide a method and a system for detecting a depth of a target, which can detect a depth value of the target with low power consumption and low cost.
One embodiment of the present invention provides a target depth detection method, including the steps of:
acquiring the focal length of a camera;
acquiring a first image containing a target to be detected through a camera;
acquiring a first pixel position of a target to be detected in the first image;
horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to obtain a moving distance;
acquiring a second image containing a target to be detected through the moved camera;
acquiring a second pixel position of the target to be detected in the second image;
simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera to serve as a distance measuring plane;
respectively extracting a first pixel abscissa value and a second pixel abscissa value corresponding to the first pixel position and the second pixel position;
calculating a pixel distance value according to the first pixel abscissa value and the second pixel abscissa value;
and calculating the ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determining the shortest distance as the depth value of the target to be detected.
Compared with the prior art, the target depth detection method provided by the invention has the advantages that at least 2 images are obtained by only one camera, and the distance between the target to be detected and the ranging plane is calculated according to the imaging pixel position of the target to be detected in the 2 images, so that the depth value of the target to be detected is obtained.
Further, the calculating of the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value specifically includes the following steps:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The pixel distance value may be calculated when the first direction is the same as the second direction.
Further, the calculating of the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value specifically includes the following steps:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The pixel distance value may be calculated when the first direction is opposite to the second direction.
Further, the calculating of the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value specifically includes the following steps: and if the first pixel abscissa value is 0, determining the absolute value of the second pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the first pixel abscissa value is 0.
Further, the calculating of the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value specifically includes the following steps: and if the second pixel abscissa value is 0, determining the absolute value of the first pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the second pixel abscissa value is 0
Further, the calculating a ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determining the shortest distance as the depth value of the target to be detected specifically includes the following steps:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value. The depth value of the target to be detected can be calculated.
An embodiment of the present invention also provides a target depth detection system, including: the system comprises a camera focal length acquisition module, a first image acquisition module, a first pixel position acquisition module, a camera moving distance acquisition module, a second image acquisition module, a second pixel position acquisition module, a ranging plane simulation module, a pixel abscissa value extraction module, a pixel distance value calculation module, a depth value calculation module and a target depth detection module;
the camera focal length acquisition module is used for acquiring the focal length of the camera;
the first image acquisition module is used for acquiring a first image containing a target to be detected through a camera;
the first pixel position acquisition module is used for acquiring a first pixel position of a target to be detected in the first image;
the camera moving distance acquisition module is used for horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to acquire a moving distance;
the second image acquisition module is used for acquiring a second image containing the target to be detected through the moved camera;
the second pixel position acquisition module is used for acquiring a second pixel position of the target to be detected in the second image;
the distance measurement plane simulation module is used for simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera and used as a distance measurement plane;
the pixel abscissa value extraction module is used for respectively extracting a first pixel abscissa value and a second pixel abscissa value corresponding to a first pixel position and a second pixel position;
the pixel distance value calculating module is used for calculating a pixel distance value according to the first pixel horizontal coordinate value and the second pixel horizontal coordinate value;
the depth value calculation module is used for calculating the ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance and determining the shortest distance as the depth value of the target to be detected;
the target depth detection module is used for comparing the depth value of the target to be detected with a preset depth threshold value, and if the depth value of the target to be detected is larger than the preset depth threshold value, determining that the target corresponding to the depth value of the target to be detected is an out-of-stock target.
Compared with the prior art, the target depth detection system only adopts one camera to obtain at least 2 images, and then calculates the distance between the target to be detected and the ranging plane according to the pixel positions of the images of the target to be detected in the 2 images, so as to obtain the depth value of the target to be detected.
Further, the pixel distance value calculating module is configured to execute the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The pixel distance value may be calculated when the first direction is the same as the second direction.
Further, the pixel distance value calculating module is configured to execute the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The pixel distance value may be calculated when the first direction is opposite to the second direction.
Further, the depth value calculating module is configured to calculate a ratio between a pixel distance value and a moving distance, calculate a shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and execute the following steps when the shortest distance is determined as the depth value of the target to be detected:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value. The depth value of the target to be detected can be accurately calculated.
In order that the invention may be more clearly understood, specific embodiments thereof will be described hereinafter with reference to the accompanying drawings.
Drawings
Fig. 1 is a flowchart of a target depth detection method according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating an application example of a target depth detection method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a target depth detection system according to an embodiment of the present invention.
1. A camera focal length acquisition module; 2. a first image acquisition module; 3. a first pixel position acquisition module; 4. a camera moving distance obtaining module; 5. a second image acquisition module; 6. a second pixel position acquisition module; 7. a ranging plane simulation module; 8. a pixel horizontal coordinate value extraction module; 9. a pixel distance value calculation module; 10. and a depth value calculation module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a target depth detection method according to an embodiment of the present invention, the target depth detection method includes the following steps:
s1: acquiring the focal length of a camera;
s2: acquiring a first image containing a target to be detected through a camera;
the execution sequence of the steps S1 and S2 is not limited, that is, the step S2 may be executed before the step S1.
S3: acquiring a first pixel position of a target to be detected in the first image;
in the step S3, image recognition is performed on the object to be detected in the first image, if recognition fails, it is determined that there is a blocking object in the first image, and the first image is determined to be an invalid image, and the step S2 is executed again after a preset time, or the camera is horizontally moved in a direction perpendicular to the direction of the lens of the camera, and then the step S2 is executed again.
S4: horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to obtain a moving distance;
optionally, in step S4, a moving track perpendicular to the lens orientation of the camera is provided, and the camera is movably disposed on the moving track and is driven to move by a motor, preferably a stepping motor. The moving distance may be a preset fixed moving distance value, or a corresponding moving distance value calculated by detecting an actual parameter of the motor rotation.
Optionally, in step S4, a screw rod perpendicular to the orientation of the lens of the camera is provided, the outer surface of the screw rod is provided with a first thread, the camera is movably disposed on the screw rod through a stepping motor, the stepping motor is provided with a rotating portion, the rotating portion is sleeved on the screw rod, the rotating portion is provided with a second thread corresponding to the first thread of the screw rod, and when the rotating portion of the stepping motor rotates, the stepping motor is displaced on the screw rod through the action of the second thread and the first thread, so as to drive the camera to move.
S5: acquiring a second image containing a target to be detected through the moved camera;
s6: acquiring a second pixel position of the target to be detected in the second image;
in the step S6, performing image recognition on the object to be detected in the second image, if the recognition fails, determining that there is a blocking object in the second image, and determining that the second image is an invalid image, re-executing the step S5 after a preset time, or horizontally moving the camera along a direction perpendicular to the lens orientation of the camera, re-executing the step S5, and re-obtaining the total moving distance of the camera with respect to the time of shooting the first image.
S7: simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera to serve as a distance measuring plane;
wherein the step S7 is independent of the steps S1-S6, S8 and S9.
S8: respectively extracting a first pixel abscissa value and a second pixel abscissa value corresponding to the first pixel position and the second pixel position;
s9: calculating a pixel distance value according to the first pixel abscissa value and the second pixel abscissa value;
s10: and calculating the ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determining the shortest distance as the depth value of the target to be detected.
In this embodiment, the depth value of the target to be detected is calculated by using the parameters of the target to be detected in the first image and the second image, and combining the moving distance of the camera when shooting the first image and the second image and the focal length parameter of the camera. Compared with the prior art, the target depth detection method provided by the invention has the advantages that at least 2 images are obtained by only one camera, and the distance between the target to be detected and the ranging plane is calculated according to the imaging pixel position of the target to be detected in the 2 images, so that the depth value of the target to be detected is obtained.
Referring to fig. 2, point P is a position of the target to be detected, point a is a first pixel position of the target to be detected in the first image, and point B is a second pixel position of the target to be detected in the second image.
In a possible embodiment, the step S9 specifically includes the following steps:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image. The pixel distance value may be calculated when the first direction is the same as the second direction.
In a possible embodiment, the step S9 specifically includes the following steps:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image. The pixel distance value may be calculated when the first direction is opposite to the second direction.
In a possible embodiment, the step S9 specifically includes the following steps: and if the first pixel abscissa value is 0, determining the absolute value of the second pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the first pixel abscissa value is 0. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image.
In a possible embodiment, the step S9 specifically includes the following steps: and if the second pixel abscissa value is 0, determining the absolute value of the first pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the second pixel abscissa value is 0. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image.
In a possible embodiment, the step S10 specifically includes the following steps:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value. The depth value of the target to be detected can be calculated.
Referring to fig. 3, an embodiment of the present invention further provides a target depth detection system, where the target depth detection system executes the steps of the target depth detection method as described above, and the target depth detection system includes: the system comprises a camera focal length acquisition module 1, a first image acquisition module 2, a first pixel position acquisition module 3, a camera moving distance acquisition module 4, a second image acquisition module 5, a second pixel position acquisition module 6, a ranging plane simulation module 7, a pixel abscissa value extraction module 8, a pixel distance value calculation module 9 and a depth value calculation module 10;
the camera focal length acquisition module 1 is used for acquiring the focal length of the camera;
the first image acquisition module 2 is used for acquiring a first image containing a target to be detected through a camera;
the first pixel position obtaining module 3 is configured to obtain a first pixel position of a target to be detected in the first image;
the camera moving distance acquiring module 4 is used for horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to acquire a moving distance;
the camera moving distance obtaining module 4 comprises a moving track and a motor, wherein the moving track is horizontal and parallel to the goods shelf, the camera is movably arranged on the moving track and is driven by the motor to move, and preferably, the motor is a stepping motor.
The second image acquisition module 5 is used for acquiring a second image containing a target to be detected through the moved camera;
the second pixel position obtaining module 6 is configured to obtain a second pixel position of the target to be detected in the second image;
the distance measurement plane simulation module 7 is configured to simulate a virtual plane perpendicular to a lens direction of the camera according to a position of the camera, as a distance measurement plane;
the pixel abscissa value extraction module 8 is configured to extract a first pixel abscissa value and a second pixel abscissa value corresponding to a first pixel position and a second pixel position, respectively;
the pixel distance value calculating module 9 is configured to calculate a pixel distance value according to the first pixel abscissa value and the second pixel abscissa value;
the depth value calculating module 10 is configured to calculate a ratio between a pixel distance value and a moving distance, calculate a shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determine the shortest distance as a depth value of the target to be detected;
in this embodiment, the depth value of the target to be detected is calculated by using the parameters of the target to be detected in the first image and the second image, and combining the moving distance of the camera when shooting the first image and the second image and the focal length parameter of the camera. Compared with the prior art, the target depth detection system only adopts one camera to obtain at least 2 images, and then calculates the distance between the target to be detected and the ranging plane according to the pixel positions of the images of the target to be detected in the 2 images, so as to obtain the depth value of the target to be detected.
In a possible embodiment, the pixel distance value calculating module 9 is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image. The pixel distance value may be calculated when the first direction is the same as the second direction.
In a possible embodiment, the pixel distance value calculating module 9 is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image. The pixel distance value may be calculated when the first direction is opposite to the second direction.
In a possible embodiment, the pixel distance value calculating module 9 is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value: and if the first pixel abscissa value is 0, determining the absolute value of the second pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the first pixel abscissa value is 0. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image.
In a possible embodiment, the pixel distance value calculating module 9 is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value: and if the second pixel abscissa value is 0, determining the absolute value of the first pixel abscissa value as a pixel distance value. The pixel distance value may be calculated when the second pixel abscissa value is 0. The first pixel abscissa value is an abscissa distance of the object to be detected in the first image relative to a midpoint of the first image, and the second pixel abscissa value is an abscissa distance of the object to be detected in the second image relative to a midpoint of the second image.
In a possible embodiment, the depth value calculating module 10 is configured to calculate a ratio between a pixel distance value and a moving distance, calculate a shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and execute the following steps when determining that the shortest distance is the depth value of the target to be detected:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value. The depth value of the target to be detected can be accurately calculated.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (10)

1. A target depth detection method is characterized by comprising the following steps:
acquiring the focal length of a camera;
acquiring a first image containing a target to be detected through a camera;
acquiring a first pixel position of a target to be detected in the first image;
horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to obtain a moving distance;
acquiring a second image containing a target to be detected through the moved camera;
acquiring a second pixel position of the target to be detected in the second image;
simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera to serve as a distance measuring plane;
respectively extracting a first pixel abscissa value and a second pixel abscissa value corresponding to the first pixel position and the second pixel position;
calculating a pixel distance value according to the first pixel abscissa value and the second pixel abscissa value;
and calculating the ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determining the shortest distance as the depth value of the target to be detected.
2. The method of claim 1, wherein the step of calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value comprises the steps of:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value.
3. The method of claim 1, wherein the step of calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value comprises the steps of:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value.
4. The method of claim 1, wherein the step of calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value comprises the steps of: and if the first pixel abscissa value is 0, determining the absolute value of the second pixel abscissa value as a pixel distance value.
5. The method of claim 1, wherein the step of calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value comprises the steps of: and if the second pixel abscissa value is 0, determining the absolute value of the first pixel abscissa value as a pixel distance value.
6. The method according to claim 1, wherein the step of calculating a ratio between the pixel distance value and the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance, and determining the shortest distance as the depth value of the target to be detected comprises the following steps:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value.
7. An object depth detection system, comprising: the system comprises a camera focal length acquisition module, a first image acquisition module, a first pixel position acquisition module, a camera moving distance acquisition module, a second image acquisition module, a second pixel position acquisition module, a ranging plane simulation module, a pixel abscissa value extraction module, a pixel distance value calculation module, a depth value calculation module and a target depth detection module;
the camera focal length acquisition module is used for acquiring the focal length of the camera;
the first image acquisition module is used for acquiring a first image containing a target to be detected through a camera;
the first pixel position acquisition module is used for acquiring a first pixel position of a target to be detected in the first image;
the camera moving distance acquisition module is used for horizontally moving the camera along a direction perpendicular to the direction of the lens of the camera to acquire a moving distance;
the second image acquisition module is used for acquiring a second image containing the target to be detected through the moved camera;
the second pixel position acquisition module is used for acquiring a second pixel position of the target to be detected in the second image;
the distance measurement plane simulation module is used for simulating a virtual plane perpendicular to the direction of a lens of the camera according to the position of the camera and used as a distance measurement plane;
the pixel abscissa value extraction module is used for respectively extracting a first pixel abscissa value and a second pixel abscissa value corresponding to a first pixel position and a second pixel position;
the pixel distance value calculating module is used for calculating a pixel distance value according to the first pixel horizontal coordinate value and the second pixel horizontal coordinate value;
the depth value calculation module is used for calculating the ratio of the pixel distance value to the moving distance, calculating the shortest distance from the target to be detected to the ranging plane by using the ratio and the focal distance and determining the shortest distance as the depth value of the target to be detected;
the target depth detection module is used for comparing the depth value of the target to be detected with a preset depth threshold value, and if the depth value of the target to be detected is larger than the preset depth threshold value, determining that the target corresponding to the depth value of the target to be detected is an out-of-stock target.
8. The object depth detection system of claim 7, wherein the pixel distance value calculating module is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if so, executing the following steps,
d=|x1–x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value.
9. The object depth detection system of claim 7, wherein the pixel distance value calculating module is configured to perform the following steps when calculating the pixel distance value according to the first pixel abscissa value and the second pixel abscissa value:
acquiring the direction of the first pixel position relative to the middle line of the first image and determining the direction as a first direction;
acquiring the direction of the second pixel position relative to the middle line of the second image and determining the direction as a second direction;
judging whether the first direction is the same as the second direction, if the first direction is opposite to the second direction, executing the following steps,
d=|x1|+|x2|;
wherein d is the pixel distance value, x1 is the first pixel abscissa value, and x2 is the second pixel abscissa value.
10. The target depth detection system of claim 7, wherein the depth value calculation module is configured to calculate a ratio between a pixel distance value and a moving distance, and when the shortest distance from the target to be detected to the ranging plane is calculated by using the ratio and the focal distance and is determined as the depth value of the target to be detected, perform the following steps:
z=f×b/d;
z is the depth value of the target to be detected, f is the focal length of the camera, b is the moving distance of the camera, and d is the pixel distance value.
CN202110208464.1A 2021-02-24 2021-02-24 Target depth detection method and detection system Pending CN113538544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110208464.1A CN113538544A (en) 2021-02-24 2021-02-24 Target depth detection method and detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110208464.1A CN113538544A (en) 2021-02-24 2021-02-24 Target depth detection method and detection system

Publications (1)

Publication Number Publication Date
CN113538544A true CN113538544A (en) 2021-10-22

Family

ID=78094361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110208464.1A Pending CN113538544A (en) 2021-02-24 2021-02-24 Target depth detection method and detection system

Country Status (1)

Country Link
CN (1) CN113538544A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107687841A (en) * 2017-09-27 2018-02-13 中科创达软件股份有限公司 A kind of distance-finding method and device
CN109767476A (en) * 2019-01-08 2019-05-17 像工场(深圳)科技有限公司 A kind of calibration of auto-focusing binocular camera and depth computing method
CN111982072A (en) * 2020-07-29 2020-11-24 西北工业大学 Target ranging method based on monocular vision

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107687841A (en) * 2017-09-27 2018-02-13 中科创达软件股份有限公司 A kind of distance-finding method and device
CN109767476A (en) * 2019-01-08 2019-05-17 像工场(深圳)科技有限公司 A kind of calibration of auto-focusing binocular camera and depth computing method
CN111982072A (en) * 2020-07-29 2020-11-24 西北工业大学 Target ranging method based on monocular vision

Similar Documents

Publication Publication Date Title
CN111210477B (en) Method and system for positioning moving object
CN109801333B (en) Volume measurement method, device and system and computing equipment
US20180122086A1 (en) Image processing apparatus, image processing method, and program
EP2848002B1 (en) Apparatus and method for processing 3d information
US11971961B2 (en) Device and method for data fusion between heterogeneous sensors
JP2018205074A (en) Flight parameter measurement device and flight parameter measurement method
JP6763559B1 (en) Ball tracking device and ball tracking method
CN102175222A (en) Crane obstacle-avoidance system based on stereoscopic vision
CN103559711A (en) Motion estimation method based on image features and three-dimensional information of three-dimensional visual system
CN104102069B (en) A kind of focusing method of imaging system and device, imaging system
CN104574393A (en) Three-dimensional pavement crack image generation system and method
CN110007313A (en) Obstacle detection method and device based on unmanned plane
CN107504917B (en) Three-dimensional size measuring method and device
CN113008195B (en) Three-dimensional curved surface distance measuring method and system based on space point cloud
CN114089330B (en) Indoor mobile robot glass detection and map updating method based on depth image restoration
Schramm et al. Data fusion for 3D thermal imaging using depth and stereo camera for robust self-localization
Song et al. Calibration of event-based camera and 3d lidar
CN113538544A (en) Target depth detection method and detection system
Bruyelle et al. Direct range measurement by linear stereovision for real-time obstacle detection in road traffic
CN105931231A (en) Stereo matching method based on full-connection random field combination energy minimization
Shin et al. A study on reliability enhancement for laser and camera calibration
RU2446471C1 (en) Method for detecting moving objects and determining parameters thereof
CN107292932B (en) Head-on video speed measurement method based on image expansion rate
Cupec et al. Detection of dominant planar surfaces in disparity images based on random sampling
CN112734840A (en) Power transmission line safety distance measuring method

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