WO2023273499A1 - Depth measurement method and apparatus, electronic device, and storage medium - Google Patents

Depth measurement method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023273499A1
WO2023273499A1 PCT/CN2022/085920 CN2022085920W WO2023273499A1 WO 2023273499 A1 WO2023273499 A1 WO 2023273499A1 CN 2022085920 W CN2022085920 W CN 2022085920W WO 2023273499 A1 WO2023273499 A1 WO 2023273499A1
Authority
WO
WIPO (PCT)
Prior art keywords
detected
target object
frame
key point
point detection
Prior art date
Application number
PCT/CN2022/085920
Other languages
French (fr)
Chinese (zh)
Inventor
赵佳
谢符宝
刘文韬
钱晨
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023273499A1 publication Critical patent/WO2023273499A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping

Definitions

  • the present disclosure relates to the technical field of computers, and in particular to a depth detection method and device, electronic equipment and a storage medium.
  • the depth information can reflect the distance of the human body in the image relative to the image acquisition device, and based on the depth information, the human body object in the image can be spatially positioned.
  • the binocular camera is a relatively common and widely used image acquisition device. Based on at least two images collected by the binocular camera, the depth information of the human body in the image can be determined by matching between images. However, the matching calculation between images is complex and The accuracy is easily affected. How to conveniently and accurately determine the depth information of the human body in the image has become an urgent problem to be solved.
  • the present disclosure proposes a technical solution for depth detection.
  • a deep detection method including:
  • the multiple frames to be detected include image frames obtained by collecting images of the target object from at least two acquisition angles of view; performing detection of the target area in the target object according to the frames to be detected Key point detection, determining a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area includes a head area and/or a shoulder area; according to the multiple key point detection results, determining Depth information of the target object.
  • the determining the depth information of the target object according to the multiple key point detection results includes: acquiring at least two preset device parameters respectively corresponding to at least two acquisition devices, the The at least two acquisition devices are used to acquire images of the target object from at least two acquisition angles of view; according to the at least two preset device parameters and the multiple key point detection results, determine the Depth information of the target object.
  • the depth information includes a depth distance, and the depth distance includes a distance between the target object and the optical center of the acquisition device; the at least two preset device parameters and The multiple key point detection results, determining the depth information of the target object in the frame to be detected includes: according to the preset external parameters in the at least two preset device parameters and the multiple key point detection As a result, the depth distance is obtained by coordinates in at least two forms; wherein, the preset external parameters include relative parameters formed between the at least two acquisition devices.
  • the depth information includes an offset angle
  • the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device
  • determining the depth information of the target object in the frame to be detected includes: according to the preset internal parameters in the at least two preset device parameters and the multiple The coordinates of the key point detection results in at least two forms are used to obtain the offset angle; wherein, the preset internal parameters include device parameters corresponding to the at least two devices.
  • the performing the key point detection of the target area in the target object according to the frame to be detected includes: according to the position information of the target object in the reference frame, The key point detection is performed on the target area of the target object in the frame, and the key point detection result corresponding to the frame to be detected is obtained, wherein the reference frame is the target video to which the frame to be detected belongs, and is located in the The video frame preceding the frame to be detected.
  • the key point detection is performed on the target area of the target object in the frame to be detected to obtain the
  • the key point detection result corresponding to the frame includes: clipping the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result; and the target area of the target object in the clipping result Perform key point detection to obtain a key point detection result corresponding to the frame to be detected.
  • the key point detection is performed on the target area of the target object in the frame to be detected to obtain the
  • the key point detection result corresponding to the frame includes: obtaining a second position of the target area of the target object in the reference frame; cutting the frame to be detected according to the second position to obtain a cutting result;
  • the key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
  • the obtaining the second position of the target area of the target object in the reference frame includes: identifying the target area in the reference frame by using a first neural network to obtain The second position output by the first neural network; and/or, according to the key point detection result corresponding to the reference frame, the second position of the target area in the reference frame is obtained.
  • the method further includes: determining a position of the target object in a three-dimensional space according to depth information of the target object.
  • a depth detection device including:
  • An acquisition module configured to acquire multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by image acquisition of the target object from at least two acquisition angles of view;
  • a key point detection module configured to The frame to be detected performs the key point detection of the target area in the target object, and determines a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area includes a head area and/or a shoulder area ;
  • a depth detection module configured to determine the depth information of the target object according to the multiple key point detection results.
  • the depth detection module is configured to: acquire at least two preset device parameters respectively corresponding to at least two acquisition devices, and the at least two acquisition devices are used to measure The target object performs image acquisition; according to the at least two preset device parameters and the multiple key point detection results, determine the depth information of the target object in the frame to be detected.
  • the depth information includes a depth distance
  • the depth distance includes a distance between the target object and the optical center of the acquisition device
  • the depth detection module is further configured to: according to the at least The preset external parameters among the two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms obtain the depth distance; wherein, the preset external parameters include the at least two Collect relative parameters formed between devices.
  • the depth information includes an offset angle
  • the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device
  • the depth detection module is further configured to: According to the preset internal parameters in the at least two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms, the offset angle is obtained; wherein the preset internal parameters include Device parameters respectively corresponding to the at least two devices.
  • the key point detection module is configured to: perform key point detection on the target area of the target object in the frame to be detected according to the position information of the target object in the reference frame , to obtain a key point detection result corresponding to the frame to be detected, wherein the reference frame is a video frame before the frame to be detected in the target video to which the frame to be detected belongs.
  • the key point detection module is further configured to: clip the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result; The key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
  • the key point detection module is further configured to: acquire a second position of the target area of the target object in the reference frame; Clipping the frame to obtain a clipping result; performing key point detection on the target area of the target object in the clipping result to obtain a key point detection result corresponding to the frame to be detected.
  • the key point detection module is further configured to: use a first neural network to identify the target area in the reference frame to obtain a second position output by the first neural network; and /or, obtain the second position of the target area in the reference frame according to the key point detection result corresponding to the reference frame.
  • the apparatus is further configured to: determine the position of the target object in a three-dimensional space according to the depth information of the target object.
  • an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above-mentioned method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
  • a computer program product including computer readable codes, and when the computer readable codes are run in an electronic device, a processor in the electronic device executes the above method.
  • the parallax formed by the multiple frames to be detected collected under at least two acquisition angles can be used to utilize the multi-frames to be detected
  • the detection results of multiple key points corresponding to the target area in the frame realize the calculation based on parallax to obtain depth information, effectively reduce the amount of data processed in the process of calculation based on parallax, and improve the efficiency and accuracy of depth detection.
  • Fig. 1 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
  • FIG. 2 shows a schematic diagram of a target area according to an embodiment of the present disclosure.
  • Fig. 3 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
  • FIG. 4 shows a block diagram of a depth detection device according to an embodiment of the present disclosure.
  • Fig. 5 shows a schematic diagram of an application example according to the present disclosure.
  • FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 1 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
  • the method can be performed by a depth detection device, and the depth detection device can be an electronic device such as a terminal device or a server, and the terminal device can be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal Digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
  • the method may be implemented by a processor invoking computer-readable instructions stored in a memory.
  • the method can be performed by a server.
  • the method may include:
  • Step S11 acquiring multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of the target object from at least two collection angles of view.
  • the frame to be detected may be any image frame that requires depth detection, for example, it may be an image frame extracted from a captured video, or an image frame obtained by capturing an image.
  • the number of multiple frames to be detected is not limited in this embodiment of the present disclosure, and may include two or more frames.
  • the acquisition angle of view can be the angle of image acquisition of the target object, and different frames to be detected can be acquired by image acquisition devices set at different acquisition angles of view, or can be acquired by the same image device under different acquisition angles of view.
  • the frame to be detected includes the target object to be subjected to depth detection.
  • the type of the target object is not limited in the embodiments of the present disclosure, and may include various human objects, animal objects, or some mechanical objects, such as robots. Subsequent disclosed embodiments are described by taking the target object as a person object as an example. Implementations in which the target object is other types can be flexibly expanded by referring to the subsequent disclosed embodiments, and will not be elaborated one by one.
  • the number of target objects contained in the frame to be detected is also not limited in the embodiments of the present disclosure, and may contain one or more target objects, which can be flexibly determined according to actual conditions.
  • frame extraction may be performed from one or more videos to obtain multiple frames to be detected, wherein, frame The extraction may include one or more methods such as frame-by-frame extraction, frame sampling at a certain interval, or random frame sampling.
  • Step S12 performing key point detection of the target area in the target object according to the frame to be detected, and determining multiple key point detection results corresponding to multiple frames to be detected.
  • the key point detection result may include the position of the detected key point in the frame to be detected.
  • the number and types of detected key points can be flexibly determined according to the actual situation.
  • the number of detected key points can include 2 to 150, etc.
  • the detected key points can be Contains 14 limb key points of the human body (such as head key points, shoulder key points, neck key points, elbow key points, wrist key points, crotch key points, leg key points and foot key points, etc.) , or include 59 outline key points on the outline of the human body (such as some key points on the periphery of the head or the periphery of the shoulders) and the like.
  • the detected key points may also only include three key points including the key point of the head, the key point of the left shoulder and the key point of the right shoulder.
  • Multiple key point detection results can correspond to multiple frames to be detected respectively. For example, if key point detection is performed on multiple frames to be detected, each frame to be detected can correspond to a key point detection result, so that it can be obtained Multiple keypoint detection results.
  • the target area may include a head area and/or a shoulder area
  • the head area of the target object may be the area where the head of the target object is located, such as the area formed between the key points of the head and the key points of the neck; the shoulder area Then it may be the area where the shoulder and neck of the target object are located, such as the area formed between the key points of the neck and the key points of the shoulder.
  • Fig. 2 shows a schematic diagram of a target area according to an embodiment of the present disclosure.
  • the head key can be point
  • the key point of the left shoulder and the key point of the right shoulder are connected by the head and shoulders box, which is used as the target area.
  • the head-shoulders frame can be a rectangle as shown in Figure 2. It can be seen from Figure 2 that the head-shoulders frame can be connected to the head key point at the head vertex of the target object and the left shoulder key point at the left shoulder joint. and the right shoulder key point at the right shoulder joint.
  • the head-shoulders frame may also be in other shapes, such as polygons, circles, or other irregular shapes.
  • the frame to be detected can be input into any neural network with key point detection function to realize key point detection; in some possible implementations, It is also possible to perform key point identification on the frame to be detected through a relevant key point identification algorithm to obtain a key point detection result; Position, perform key point detection on a part of the image area in the frame to be detected to obtain key point detection results, etc.
  • step S12 reference may be made to the following disclosed embodiments in detail, which will not be expanded here.
  • Step S13 according to the multiple key point detection results, determine the depth information of the target object in the frame to be detected.
  • the information content contained in the depth information can be flexibly determined according to the actual situation, and any information that can reflect the depth of the target object in the three-dimensional space can be used as a realization method of the depth information.
  • the depth information may include a depth distance and/or an offset angle.
  • the depth distance can be the distance between the target object and the collection device, and the collection device can be any device that collects images of the target object.
  • the collection device can be a static image collection device, such as a camera, etc. ;
  • the collection device may also be a device for collecting dynamic images, such as a video camera or a camera.
  • different frames to be detected can be collected by image acquisition devices set under different acquisition angles of view, or can be acquired by the same image device under different acquisition angles of view. Therefore, the number of acquisition devices Can be one or more.
  • the depth detection method proposed by the embodiment of the present disclosure can be implemented based on at least two acquisition devices. In this case, at least two acquisition devices can detect the target object from at least two acquisition angles. Image acquisition is performed to obtain multiple frames to be detected.
  • the types of different collection devices may be the same or different, which can be flexibly selected according to the actual situation, and there is no limitation in this embodiment of the present disclosure.
  • the depth distance can be the distance between the target object and the collection device, the distance can be the distance between the target object and the collection device as a whole, or the distance between the target object and a certain equipment part of the collection device, in some possible
  • the distance between the target object and the optical center of the acquisition device may be used as the depth distance.
  • the offset angle may be an offset angle of the target object relative to the collection device, and in a possible implementation manner, the offset angle may be a spatial angle of the target object relative to the optical axis of the collection device.
  • multiple key point detection results can correspond to multiple frames to be detected, and multiple frames to be detected can be obtained by collecting images of the target object from at least two acquisition angles of view, therefore, based on multiple key point detection results,
  • the parallax formed between multiple frames to be detected can be determined, and then the depth information calculation based on the parallax can be realized to obtain the depth information of the target object.
  • the parallax-based calculation method based on the key point detection results can be flexibly determined according to the actual situation. Any method for realizing depth ranging based on parallax can be used in the implementation process of step S13. For details, see the following disclosed embodiments. , do not expand here.
  • the parallax formed by the multiple frames to be detected collected under at least two acquisition angles can be used to utilize the multi-frames to be detected
  • the detection results of multiple key points corresponding to the target area in the frame realize the calculation based on parallax to obtain depth information, effectively reduce the amount of data processed in the process of calculation based on parallax, and improve the efficiency and accuracy of depth detection.
  • step S12 may include:
  • key point detection is performed on the target area of the target object in the frame to be detected, and a key point detection result corresponding to the frame to be detected is obtained.
  • the reference frame may be a video frame located before the frame to be detected in the target video, and the target video may be a video including the frame to be detected.
  • different frames to be detected may respectively belong to different target videos, and in this case, reference frames corresponding to different frames to be detected may also be different.
  • the reference frame can be the previous frame of the frame to be detected in the target video, and in some possible implementations, the reference frame can also be the frame in the target video, located before the frame to be detected and connected to the frame to be detected
  • the distance between the video frames does not exceed the preset distance, the number of preset distances can be flexibly determined according to the actual situation, and can be one or more frames apart, which is not limited in this embodiment of the present disclosure.
  • the position of the target object in the reference frame may be relatively close to the position of the target object in the frame to be detected.
  • the position information of the target object in the reference frame According to the position information of the target object in the reference frame, the position information of the target object in the frame to be detected can be roughly determined.
  • the target area of the target object in the frame to be detected can be more targeted. Detection, and the amount of data detected will be smaller, so that more accurate key point detection results can be obtained, and the efficiency of key point detection can also be improved.
  • the key point detection method of the target area of the target object in the frame to be detected can be flexibly determined according to the actual situation, for example, according to the position information of the target object in the reference frame
  • the position information in the to-be-detected frame is cropped and then the key point detection is performed, or according to the position information of the target object in the reference frame, the key point detection is directly performed on the image area corresponding to the position in the to-be-detected frame, etc.
  • the key point detection is performed on the target area of the target object in the frame to be detected, and the key point detection result corresponding to the frame to be detected is obtained, including:
  • the key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
  • the first position may be the overall position coordinates of the target object in the reference frame.
  • the first position may be the position coordinates of the body frame of the target object in the reference frame.
  • the manner of clipping the frame to be detected according to the first position is also not limited in the embodiments of the present disclosure, and is not limited to the following disclosed embodiments.
  • the first coordinates of the human body frame in the reference frame can be determined according to the first position, and combined with the corresponding relationship between the position coordinates between the reference frame and the frame to be detected, it can be determined that the human body frame of the target object is in the frame to be detected.
  • the second coordinates in the frame are detected, and the frame to be detected is cropped based on the second coordinates to obtain a cropping result.
  • the first coordinates of the body frame in the reference frame and the border length of the body frame can also be determined according to the first position, and combined with the position coordinate correspondence between the reference frame and the frame to be detected, determine The second coordinates of the human body frame of the target object in the frame to be detected, and the frame to be detected is cropped based on the second coordinates and the frame length to obtain a clipping result, wherein, the clipping based on the second coordinates and the frame length can be based on the first
  • the two coordinates determine the position of the clipping endpoint, and the frame length determines the length of the clipping result.
  • the length of the clipping result can be consistent with the frame length.
  • the length of the clipping result can also be proportional to the frame length, such as N times the frame length, etc., N can be any value not less than 1, etc.
  • the target object in the frame to be detected can be preliminarily positioned according to the first position of the target object in the reference frame, and the clipping result can be obtained, and the key point detection of the target area can be performed based on the clipping result.
  • it can reduce The amount of detected data improves the detection efficiency.
  • the accuracy of key point detection can be improved.
  • the key point detection is performed on the target area of the target object in the frame to be detected, and the key point detection result corresponding to the frame to be detected is obtained, including:
  • the second position may be the position coordinates of the target area of the target object in the reference frame.
  • the target area may include the head area and/or the shoulder area, so in a possible implementation
  • the second position may be the position coordinates of the head and shoulders frame of the target object in the reference frame.
  • the implementation form can be flexibly determined according to the actual situation, for example, it can be realized by performing head and shoulder frame and/or key point recognition on the reference frame, see the following publications for details Embodiment, do not expand here.
  • the key point detection method for the target object in the clipping result can be the same as the key point detection method based on the clipping result obtained at the first position, or it can be different. Do unfold.
  • the key point detection result can be obtained according to the second position of the target area of the target object in the reference frame.
  • the target area can be more targeted, thereby further reducing the amount of data processing. Therefore, the accuracy and efficiency of depth detection are further improved.
  • obtaining the second position of the target area of the target object in the reference frame may include:
  • the second position of the target area in the reference frame is obtained.
  • the first neural network may be any network used to determine the second position, and its implementation form is not limited in the embodiments of the present disclosure.
  • the first neural network may be an object area detection network for identifying the second location of the object area directly from the reference frame.
  • the object area detection network may be faster based on Regional Convolutional Neural Networks (Faster Regions with Convolutional Neural Networks, Faster RCNN); in some possible implementations, the first neural network can also be a key point detection network, which is used to detect one or more key points in the reference frame Points are identified, and then the second position of the target area in the reference frame is determined according to the positions of the identified key points.
  • the reference frame may also be used as the frame to be detected for depth detection.
  • the reference frame may have undergone key point detection and a corresponding key point detection result has been obtained. Therefore, in some possible implementation manners, the second position of the target area in the reference frame may be obtained according to the key point detection result corresponding to the reference frame.
  • the key point detection may also be directly performed on the reference frame to obtain the key point detection result.
  • the key point detection method reference may be made to other disclosed embodiments, which will not be repeated here.
  • the second position of the target area in the reference frame can be flexibly determined in multiple ways according to the actual situation of the reference frame, which improves the flexibility and versatility of depth detection; and in some possible implementations
  • the second position can be determined directly based on the intermediate result of the reference frame in the depth detection, thereby reducing the repeated calculation of data and improving the depth detection. efficiency and precision.
  • the key point detection is performed on the target object in the clipping result to obtain the key point detection result, which may include:
  • the second neural network is used to perform key point detection on the target object in the clipping result to obtain a key point detection result.
  • the second neural network may be any neural network used to realize key point detection, and its implementation mode is not limited in the embodiments of the present disclosure, wherein, when the first neural network may be a key point detection network, the second The second neural network may be implemented in the same or different manner as the first neural network.
  • key point detection may also be performed on the target object in the clipping result through a related key point recognition algorithm, and the key point recognition algorithm to be used is also not limited in the embodiments of the present disclosure.
  • FIG. 3 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
  • step S13 may include:
  • Step S131 acquiring at least two preset device parameters respectively corresponding to at least two capture devices, the at least two capture devices are used to capture images of the target object from at least two capture angles of view.
  • Step S132 Determine the depth information of the target object in the frame to be detected according to at least two preset device parameters and a plurality of key point detection results.
  • the at least two preset device parameters may include preset internal parameters respectively corresponding to at least two acquisition devices.
  • the preset internal parameters may be some calibration parameters of the collection device itself, and the types and types of parameters contained therein may be flexibly determined according to the actual situation of the collection device.
  • the preset internal parameters may include an internal reference matrix of the acquisition device, and the internal reference matrix may include one or more focal length parameters of the camera, principal point positions of one or more cameras, and the like.
  • the collection device may include at least two collection devices
  • at least two preset device parameters may also include preset external parameters, wherein the preset external parameters may be between different collection devices
  • the formed relative parameters are used to describe the relative positions of different acquisition devices in the world coordinate system.
  • the preset external parameters may include an external parameter matrix formed between different acquisition devices.
  • the external parameter matrix may include a rotation matrix and/or a translation vector matrix, and the like.
  • the way to obtain the preset device parameters is not limited in the embodiments of the present disclosure.
  • the preset device parameters can be directly obtained according to the actual situation of the acquisition device.
  • you can also The preset device parameters are obtained by calibrating the acquisition device.
  • the parallax formed between different frames to be detected in the three-dimensional world coordinate system can be determined.
  • the information content contained in the depth information can be flexibly determined according to the actual situation. Therefore, with the different content of the depth information, the process of determining the depth information according to the preset device parameters and the detection results of multiple key points can also be determined at any time.
  • At least two preset device parameters and multiple key point detection results can be used to determine the disparity formed between different frames to be detected, and to determine the depth information simply and conveniently.
  • This method has a small amount of calculation and is The result is more accurate, which can improve the accuracy and efficiency of depth detection.
  • step S132 may include:
  • the depth distance is obtained according to the preset external parameters among the at least two preset device parameters and the coordinates of the multiple key point detection results in at least two forms.
  • the coordinates of the key point detection results in at least two forms can be the corresponding coordinates of the key point detection results in different coordinate systems, for example, it can include the pixel coordinates formed by the key point detection results in the image coordinate system, and/or Or, homogeneous coordinates formed separately in different acquisition devices, etc. Which form of coordinates to choose can be flexibly selected according to the actual situation, and is not limited to the following disclosed embodiments.
  • the coordinates of the key points in the key point detection results are not limited in the embodiment of the present disclosure.
  • the head key point, left shoulder key point and right shoulder key point can be selected.
  • the center of the head and shoulders can also be chosen.
  • the center point of the head and shoulders may be the center point of the head and shoulders frame mentioned in the above disclosed embodiments.
  • the position coordinates of the key points of the head, the key points of the left shoulder and the key points of the right shoulder may be Determine the overall position coordinates of the head and shoulders frame, and determine the position coordinates of the center point of the head and shoulders based on the overall position coordinates of the head and shoulders frame; in some possible implementations, the center point of the head and shoulders can also be directly used as the key to be detected point, so that the position coordinates of the center point of the head and shoulders can be directly obtained in the key point detection results.
  • the calculation method for obtaining the depth distance can be flexibly changed, and is not limited to the following disclosed embodiments.
  • it may include two acquisition devices, a left camera and a right camera.
  • the process of obtaining the depth distance can be expressed by the following formulas (1) and (2):
  • d is the depth distance
  • the original coordinates of the key points in the homogeneous form in the frame to be detected collected by the left camera is the transformed coordinate obtained by linearly transforming the original coordinate
  • the coordinates of the key points in the homogeneous form in the frame to be detected collected by the right camera is the rotation matrix R of the right camera relative to the left camera in the preset external parameters
  • the translation vector matrix T of the right camera relative to the left camera in the preset external parameters is the depth distance
  • the homogeneous form coordinates of key points in different camera coordinate systems and the coordinates of key points in the form of linear transformation can be combined with the relative preset external parameters between different cameras, with a small amount of calculation Accurately determine the depth distance, thereby improving the accuracy and efficiency of depth detection.
  • step S132 may also include:
  • the offset angle is obtained according to the preset internal parameters in the at least two preset device parameters and the coordinates of the multiple key point detection results in at least two forms.
  • the way of obtaining the offset angle can also be flexibly selected, and is not limited to the following disclosed embodiments.
  • the type of selected key points can also be flexibly selected according to the actual situation. You can refer to the type of key points selected in the above-mentioned determination of the depth distance, which will not be repeated here.
  • the calculation method for obtaining the offset angle can also be flexibly changed, and is not limited to the following disclosed embodiments.
  • the process of obtaining the offset angle relative to the target camera can be expressed by the following formulas (3) to (5):
  • ⁇ x is the offset angle of the target object in the x-axis direction
  • ⁇ y is the offset angle of the target object in the y-axis direction
  • f x and f y are the internal reference matrix of the target camera
  • the focal length parameter in , u 0 and v 0 are the principal point positions in the intrinsic parameter matrix K of the target camera.
  • the offset angle can be determined simply and conveniently by using the preset internal parameters and the coordinates of the key point detection results obtained in the depth detection process in different forms. This determination method does not need to obtain additional data and is convenient. Computing can improve the efficiency and convenience of in-depth detection.
  • the method proposed in the embodiment of the present disclosure may further include:
  • the position of the target object in the three-dimensional space is determined.
  • the position of the target object in the three-dimensional space may be the three-dimensional coordinates of the target object in the three-dimensional space.
  • the way to determine the position in the three-dimensional space based on the depth information can be flexibly selected according to the actual situation.
  • the two-dimensional coordinates of the target object in the frame to be detected can be determined according to the key point detection results of the target object.
  • the two-dimensional coordinates are combined with the depth distance and/or offset angle in the depth information, so as to determine the three-dimensional coordinates of the target object in the three-dimensional space.
  • the depth information can be used to perform three-dimensional positioning of the target object, so as to realize various operations such as interaction with the target object.
  • the distance and angle between the target object and the smart air conditioner can be determined according to the position of the target object in three-dimensional space, so as to dynamically adjust the wind direction and/or wind speed of the smart air conditioner; in some possible
  • the target object can also be positioned in the game scene based on the position of the target object in the three-dimensional space in the AR game platform, so that the human-computer interaction in the AR scene can be realized more realistically and naturally.
  • the present disclosure also provides depth detection devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any depth detection method provided by the present disclosure.
  • depth detection devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any depth detection method provided by the present disclosure.
  • FIG. 4 shows a block diagram of a depth detection device according to an embodiment of the present disclosure.
  • device 20 includes:
  • the obtaining module 21 is configured to obtain multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of a target object from at least two collection angles of view.
  • the key point detection module 22 is used to perform key point detection of the target area in the target object according to the frame to be detected, and determine a plurality of key point detection results corresponding to multiple frames to be detected, wherein the target area includes the head area and/or shoulder area.
  • the depth detection module 23 is configured to determine the depth information of the target object according to the multiple key point detection results.
  • the depth detection module is configured to: acquire at least two preset device parameters respectively corresponding to at least two acquisition devices, the at least two acquisition devices are used to image the target object from at least two acquisition angles of view Acquisition: Determining the depth information of the target object in the frame to be detected according to at least two preset device parameters and a plurality of key point detection results.
  • the depth information includes a depth distance
  • the depth distance includes a distance between the target object and the optical center of the acquisition device
  • the depth detection module is further used for: according to the preset in at least two preset device parameters
  • the external parameters and the coordinates of the multiple key point detection results in at least two forms obtain the depth distance; wherein, the preset external parameters include relative parameters formed between at least two acquisition devices.
  • the depth information includes an offset angle
  • the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device
  • the depth detection module is further configured to: according to at least two preset device parameters
  • the preset internal parameters and the coordinates of the multiple key point detection results in at least two forms are used to obtain the offset angle; wherein the preset internal parameters include device parameters corresponding to at least two devices respectively.
  • the key point detection module is used to: perform key point detection on the target area of the target object in the frame to be detected according to the position information of the target object in the reference frame, and obtain the key point corresponding to the frame to be detected The point detection result, wherein the reference frame is a video frame before the frame to be detected in the target video to which the frame to be detected belongs.
  • the key point detection module is further used to: crop the frame to be detected according to the first position of the target object in the reference frame to obtain the cropping result; key the target area of the target object in the cropping result Point detection to obtain key point detection results corresponding to the frame to be detected.
  • the key point detection module is further used to: obtain the second position of the target area of the target object in the reference frame; according to the second position, the frame to be detected is cropped to obtain the cropping result; the cropping result The key point detection is performed on the target area of the target object in , and the key point detection result corresponding to the frame to be detected is obtained.
  • the key point detection module is further configured to: use the first neural network to identify the target area in the reference frame to obtain the second position output by the first neural network; and/or, according to the reference frame The corresponding key point detection result obtains the second position of the target area in the reference frame.
  • the device is further configured to: determine the position of the target object in the three-dimensional space according to the depth information of the target object.
  • the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
  • Fig. 5 shows a schematic diagram of an application example according to the present disclosure.
  • the application example of the present disclosure proposes a depth detection method, which may include the following process:
  • Step S31 use the Faster RCNN neural network to detect the head and shoulders frame of the human body from the two frames to be detected taken by the binocular camera (including the left camera and the right camera), and obtain the head and shoulders frame in the first frame of the left camera. position, and the position of the head-and-shoulders box in the first frame of the right camera.
  • Step S32 obtain the target video corresponding to the left camera and the right camera respectively, start from the second frame of the target video, use the video frame as the frame to be detected, and use the previous frame of the frame to be detected as the reference frame, according to the reference frame
  • the key point detection of the frame to be detected is carried out through the key point detection network, and the position coordinates of the three key points of the head key point, left shoulder key point and right shoulder key point are obtained, and the three key points The circumscribed rectangle of the point is used as the head and shoulders frame in the frame to be detected.
  • Step S33 according to the coordinates of the key points in the frame to be detected in at least two forms, and the internal reference matrix of the camera, calculate the offset angle of the target object relative to the camera:
  • the head According to the pixel coordinates (u, v, 1) of the key points of the head in the frame to be detected and the internal reference matrix K of the camera, the head The coordinates (x/z, y/z, 1) of the homogeneous form corresponding to the internal key points, and the offset angles ⁇ x and ⁇ y relative to the camera optical axis.
  • Step S34 according to the homogeneous coordinates of the key points in the frame to be detected in the left camera and the right camera, and the extrinsic matrix of the right camera relative to the left camera, calculate the depth distance of the target object:
  • the next frame of the frame to be detected in the target video corresponding to the left camera and the right camera can also be used as the frame to be detected , and return to step S32 to perform depth detection again.
  • the head and shoulders frame of the human body and the key points in the head and shoulders frame can be used to calculate the disparity formed by the frames to be detected collected under different viewing angles.
  • the calculation amount is more Small size, wider application scenarios.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • the computer readable storage medium may be a non-volatile computer readable storage medium or a volatile computer readable storage medium.
  • An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • An embodiment of the present disclosure also provides a computer program product, including computer readable codes.
  • the processor in the device executes the method for implementing the depth detection method provided in any of the above embodiments. instruction.
  • the embodiments of the present disclosure also provide another computer program product, which is used for storing computer-readable instructions, and when the instructions are executed, the computer executes the operation of the depth detection method provided by any of the above-mentioned embodiments.
  • Electronic devices may be provided as terminals, servers, or other forms of devices.
  • FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
  • the memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 806 provides power to various components of the electronic device 800 .
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 .
  • the audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal-oxide-semiconductor
  • CCD charge-coupled device
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
  • FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922 , which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs.
  • the application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above method.
  • Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ), or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface-based operating system
  • Unix TM multi-user and multi-process computer operating system
  • Linux TM free and open source Unix-like operating system
  • FreeBSD TM open source Unix-like operating system
  • a non-transitory computer-readable storage medium such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
  • the present disclosure can be a system, method and/or computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • Computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA)
  • FPGA field programmable gate array
  • PDA programmable logic array
  • These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the computer program product can be specifically realized by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. Wait.
  • a software development kit Software Development Kit, SDK

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The present disclosure relates to a depth measurement method and apparatus, an electronic device, and a storage medium. The method comprises: obtaining a plurality of frames to be detected, the plurality of frames to be detected comprising an image frame obtained by performing image acquisition on a target object from at least two acquisition viewing angles; performing key point detection on a target area in the target object according to the frames to be detected, and determining a plurality of key point detection results corresponding to the plurality of frames to be detected, the target area comprising a head area and/or a shoulder area; and determining depth information of the target object according to the plurality of key point detection results.

Description

深度检测方法及装置、电子设备和存储介质Depth detection method and device, electronic equipment and storage medium
本申请要求在2021年6月28日提交中国专利局、申请号为202110721270.1、发明名称为“深度检测方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the China Patent Office on June 28, 2021, with application number 202110721270.1, and the title of the invention is "Deep Detection Method and Device, Electronic Equipment, and Storage Medium", the entire contents of which are incorporated by reference in this application.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种深度检测方法及装置、电子设备和存储介质。The present disclosure relates to the technical field of computers, and in particular to a depth detection method and device, electronic equipment and a storage medium.
背景技术Background technique
深度信息可以反映图像中的人体相对于图像采集设备的距离,基于深度信息,可以对图像中的人体对象进行空间定位。双目相机是一种较为常见和广泛应用的图像采集设备,基于双目相机采集的至少两个图像,可以通过图像间的匹配来确定图像中人体的深度信息,然而图像间的匹配计算复杂且精度容易受影响,如何便捷且准确地确定图像中人体的深度信息,成为目前一个亟待解决的问题。The depth information can reflect the distance of the human body in the image relative to the image acquisition device, and based on the depth information, the human body object in the image can be spatially positioned. The binocular camera is a relatively common and widely used image acquisition device. Based on at least two images collected by the binocular camera, the depth information of the human body in the image can be determined by matching between images. However, the matching calculation between images is complex and The accuracy is easily affected. How to conveniently and accurately determine the depth information of the human body in the image has become an urgent problem to be solved.
发明内容Contents of the invention
本公开提出了一种深度检测的技术方案。The present disclosure proposes a technical solution for depth detection.
根据本公开的一方面,提供了一种深度检测方法,包括:According to an aspect of the present disclosure, a deep detection method is provided, including:
获取多帧待检测帧,其中,所述多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧;根据所述待检测帧进行所述目标对象中目标区域的关键点检测,确定与所述多帧待检测帧对应的多个关键点检测结果,其中,所述目标区域包括头部区域和/或肩部区域;根据所述多个关键点检测结果,确定所述目标对象的深度信息。Acquiring multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of the target object from at least two acquisition angles of view; performing detection of the target area in the target object according to the frames to be detected Key point detection, determining a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area includes a head area and/or a shoulder area; according to the multiple key point detection results, determining Depth information of the target object.
在一种可能的实现方式中,所述根据所述多个关键点检测结果,确定所述目标对象的深度信息,包括:获取至少两个采集设备分别对应的至少两个预设设备参数,所述至少两个采集设备用于从至少两个采集视角对所述目标对象进行图像采集;根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息。In a possible implementation manner, the determining the depth information of the target object according to the multiple key point detection results includes: acquiring at least two preset device parameters respectively corresponding to at least two acquisition devices, the The at least two acquisition devices are used to acquire images of the target object from at least two acquisition angles of view; according to the at least two preset device parameters and the multiple key point detection results, determine the Depth information of the target object.
在一种可能的实现方式中,所述深度信息包括深度距离,所述深度距离包括所述目标对象与采集设备的光心之间的距离;所述根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息,包括:根据所述至少两个预设设备参数中的预设外部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述深度距离;其中,所述预设外部参数包括所述至少两个采集设备之间形成的相对参数。In a possible implementation manner, the depth information includes a depth distance, and the depth distance includes a distance between the target object and the optical center of the acquisition device; the at least two preset device parameters and The multiple key point detection results, determining the depth information of the target object in the frame to be detected includes: according to the preset external parameters in the at least two preset device parameters and the multiple key point detection As a result, the depth distance is obtained by coordinates in at least two forms; wherein, the preset external parameters include relative parameters formed between the at least two acquisition devices.
在一种可能的实现方式中,所述深度信息包括偏移角度,所述偏移角度包括所述目标对象相对于所述采集设备的光轴的空间角度;所述根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息,包括:根据所述至少两个预设设备参数中的预设内部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述偏移角度;其中,所述预设内部参数包括所述至少两个设备分别对应的设备参数。In a possible implementation manner, the depth information includes an offset angle, and the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device; Assuming device parameters and the multiple key point detection results, determining the depth information of the target object in the frame to be detected includes: according to the preset internal parameters in the at least two preset device parameters and the multiple The coordinates of the key point detection results in at least two forms are used to obtain the offset angle; wherein, the preset internal parameters include device parameters corresponding to the at least two devices.
在一种可能的实现方式中,所述根据所述待检测帧进行所述目标对象中目标区域的关键点检测,包括:根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果, 其中,所述参考帧为所述待检测帧所属的目标视频中,位于所述待检测帧之前的视频帧。In a possible implementation manner, the performing the key point detection of the target area in the target object according to the frame to be detected includes: according to the position information of the target object in the reference frame, The key point detection is performed on the target area of the target object in the frame, and the key point detection result corresponding to the frame to be detected is obtained, wherein the reference frame is the target video to which the frame to be detected belongs, and is located in the The video frame preceding the frame to be detected.
在一种可能的实现方式中,所述根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,包括:根据所述参考帧中所述目标对象的第一位置,对所述待检测帧进行裁剪,得到裁剪结果;对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。In a possible implementation manner, according to the position information of the target object in the reference frame, the key point detection is performed on the target area of the target object in the frame to be detected to obtain the The key point detection result corresponding to the frame includes: clipping the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result; and the target area of the target object in the clipping result Perform key point detection to obtain a key point detection result corresponding to the frame to be detected.
在一种可能的实现方式中,所述根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,包括:获取所述目标对象的目标区域在所述参考帧中的第二位置;根据所述第二位置,对所述待检测帧进行裁剪,得到裁剪结果;对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。In a possible implementation manner, according to the position information of the target object in the reference frame, the key point detection is performed on the target area of the target object in the frame to be detected to obtain the The key point detection result corresponding to the frame includes: obtaining a second position of the target area of the target object in the reference frame; cutting the frame to be detected according to the second position to obtain a cutting result; The key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
在一种可能的实现方式中,所述获取所述目标对象的目标区域在所述参考帧中的第二位置,包括:通过第一神经网络对所述参考帧中的目标区域进行识别,得到所述第一神经网络输出的第二位置;和/或,根据所述参考帧对应的关键点检测结果,得到所述目标区域在所述参考帧中的第二位置。In a possible implementation manner, the obtaining the second position of the target area of the target object in the reference frame includes: identifying the target area in the reference frame by using a first neural network to obtain The second position output by the first neural network; and/or, according to the key point detection result corresponding to the reference frame, the second position of the target area in the reference frame is obtained.
在一种可能的实现方式中,所述方法还包括:根据所述目标对象的深度信息,确定所述目标对象在三维空间中的位置。In a possible implementation manner, the method further includes: determining a position of the target object in a three-dimensional space according to depth information of the target object.
根据本公开的一方面,提供了一种深度检测装置,包括:According to an aspect of the present disclosure, a depth detection device is provided, including:
获取模块,用于获取多帧待检测帧,其中,所述多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧;关键点检测模块,用于根据所述待检测帧进行所述目标对象中目标区域的关键点检测,确定与所述多帧待检测帧对应的多个关键点检测结果,其中,所述目标区域包括头部区域和/或肩部区域;深度检测模块,用于根据所述多个关键点检测结果,确定所述目标对象的深度信息。An acquisition module, configured to acquire multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by image acquisition of the target object from at least two acquisition angles of view; a key point detection module, configured to The frame to be detected performs the key point detection of the target area in the target object, and determines a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area includes a head area and/or a shoulder area ; A depth detection module, configured to determine the depth information of the target object according to the multiple key point detection results.
在一种可能的实现方式中,所述深度检测模块用于:获取至少两个采集设备分别对应的至少两个预设设备参数,所述至少两个采集设备用于从至少两个采集视角对所述目标对象进行图像采集;根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息。In a possible implementation manner, the depth detection module is configured to: acquire at least two preset device parameters respectively corresponding to at least two acquisition devices, and the at least two acquisition devices are used to measure The target object performs image acquisition; according to the at least two preset device parameters and the multiple key point detection results, determine the depth information of the target object in the frame to be detected.
在一种可能的实现方式中,所述深度信息包括深度距离,所述深度距离包括所述目标对象与采集设备的光心之间的距离;所述深度检测模块进一步用于:根据所述至少两个预设设备参数中的预设外部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述深度距离;其中,所述预设外部参数包括所述至少两个采集设备之间形成的相对参数。In a possible implementation manner, the depth information includes a depth distance, and the depth distance includes a distance between the target object and the optical center of the acquisition device; the depth detection module is further configured to: according to the at least The preset external parameters among the two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms obtain the depth distance; wherein, the preset external parameters include the at least two Collect relative parameters formed between devices.
在一种可能的实现方式中,所述深度信息包括偏移角度,所述偏移角度包括所述目标对象相对于所述采集设备的光轴的空间角度;所述深度检测模块进一步用于:根据所述至少两个预设设备参数中的预设内部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述偏移角度;其中,所述预设内部参数包括所述至少两个设备分别对应的设备参数。In a possible implementation manner, the depth information includes an offset angle, and the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device; the depth detection module is further configured to: According to the preset internal parameters in the at least two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms, the offset angle is obtained; wherein the preset internal parameters include Device parameters respectively corresponding to the at least two devices.
在一种可能的实现方式中,所述关键点检测模块用于:根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,其中,所述参考帧为所述待检测帧所属的目标视频中,位于所述待检测帧之前的视频帧。In a possible implementation manner, the key point detection module is configured to: perform key point detection on the target area of the target object in the frame to be detected according to the position information of the target object in the reference frame , to obtain a key point detection result corresponding to the frame to be detected, wherein the reference frame is a video frame before the frame to be detected in the target video to which the frame to be detected belongs.
在一种可能的实现方式中,所述关键点检测模块进一步用于:根据所述参考帧中所述目标对象的第一位置,对所述待检测帧进行裁剪,得到裁剪结果;对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。In a possible implementation manner, the key point detection module is further configured to: clip the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result; The key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
在一种可能的实现方式中,所述关键点检测模块进一步用于:获取所述目标对象的 目标区域在所述参考帧中的第二位置;根据所述第二位置,对所述待检测帧进行裁剪,得到裁剪结果;对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。In a possible implementation manner, the key point detection module is further configured to: acquire a second position of the target area of the target object in the reference frame; Clipping the frame to obtain a clipping result; performing key point detection on the target area of the target object in the clipping result to obtain a key point detection result corresponding to the frame to be detected.
在一种可能的实现方式中,所述关键点检测模块进一步用于:通过第一神经网络对所述参考帧中的目标区域进行识别,得到所述第一神经网络输出的第二位置;和/或,根据所述参考帧对应的关键点检测结果,得到所述目标区域在所述参考帧中的第二位置。In a possible implementation manner, the key point detection module is further configured to: use a first neural network to identify the target area in the reference frame to obtain a second position output by the first neural network; and /or, obtain the second position of the target area in the reference frame according to the key point detection result corresponding to the reference frame.
在一种可能的实现方式中,所述装置还用于:根据所述目标对象的深度信息,确定所述目标对象在三维空间中的位置。In a possible implementation manner, the apparatus is further configured to: determine the position of the target object in a three-dimensional space according to the depth information of the target object.
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。According to an aspect of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above-mentioned method.
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to one aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
根据本公开的一方面,提供了一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。According to an aspect of the present disclosure, a computer program product is provided, including computer readable codes, and when the computer readable codes are run in an electronic device, a processor in the electronic device executes the above method.
在本公开实施例中,通过获取从至少两个采集视角下采集到的多帧待检测帧,根据待检测帧进行目标区域的关键点检测,确定多帧待检测帧对应的多个关键点检测结果,并基于多个关键点检测结果,确定目标对象的深度信息,通过本公开实施例,可以通过至少两个采集视角下所采集的多帧待检测帧所形成的视差,利用多帧待检测帧中目标区域对应的多个关键点检测结果,实现基于视差的计算来得到深度信息,有效减小基于视差进行计算的过程中所处理的数据量,提高深度检测的效率和精度。In the embodiment of the present disclosure, by acquiring multiple frames to be detected from at least two acquisition angles of view, and performing key point detection of the target area according to the frames to be detected, multiple key point detections corresponding to multiple frames to be detected are determined As a result, and based on the detection results of multiple key points, the depth information of the target object is determined. Through the embodiments of the present disclosure, the parallax formed by the multiple frames to be detected collected under at least two acquisition angles can be used to utilize the multi-frames to be detected The detection results of multiple key points corresponding to the target area in the frame realize the calculation based on parallax to obtain depth information, effectively reduce the amount of data processed in the process of calculation based on parallax, and improve the efficiency and accuracy of depth detection.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the specification and constitute a part of the specification. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solutions of the present disclosure.
图1示出根据本公开实施例的深度检测方法的流程图。Fig. 1 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
图2示出根据本公开实施例的目标区域的示意图。FIG. 2 shows a schematic diagram of a target area according to an embodiment of the present disclosure.
图3示出根据本公开实施例的深度检测方法的流程图。Fig. 3 shows a flowchart of a depth detection method according to an embodiment of the present disclosure.
图4示出根据本公开实施例的深度检测装置的框图。FIG. 4 shows a block diagram of a depth detection device according to an embodiment of the present disclosure.
图5示出根据本公开一应用示例的示意图。Fig. 5 shows a schematic diagram of an application example according to the present disclosure.
图6示出根据本公开实施例的电子设备的框图。FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
图7示出根据本公开实施例的电子设备的框图。FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式detailed description
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合, 例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, may mean including from A, Any one or more elements selected from the set formed by B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific implementation manners. It will be understood by those skilled in the art that the present disclosure may be practiced without some of the specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art have not been described in detail so as to obscure the gist of the present disclosure.
图1示出根据本公开实施例的深度检测方法的流程图。该方法可以由深度检测装置执行,深度检测装置可以是终端设备或服务器等电子设备,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可以通过服务器执行该方法。如图1所示,该方法可以包括:Fig. 1 shows a flowchart of a depth detection method according to an embodiment of the present disclosure. The method can be performed by a depth detection device, and the depth detection device can be an electronic device such as a terminal device or a server, and the terminal device can be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal Digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, in-vehicle devices, wearable devices, etc. In some possible implementation manners, the method may be implemented by a processor invoking computer-readable instructions stored in a memory. Alternatively, the method can be performed by a server. As shown in Figure 1, the method may include:
步骤S11,获取多帧待检测帧,其中,多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧。Step S11 , acquiring multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of the target object from at least two collection angles of view.
其中,待检测帧可以是具有深度检测需求的任意图像帧,比如可以是从拍摄的视频中提取的图像帧,或是拍摄图像得到的图像帧等。多帧待检测帧的数量在本公开实施例中不做限制,可以包含两帧或两帧以上。Wherein, the frame to be detected may be any image frame that requires depth detection, for example, it may be an image frame extracted from a captured video, or an image frame obtained by capturing an image. The number of multiple frames to be detected is not limited in this embodiment of the present disclosure, and may include two or more frames.
采集视角可以为对目标对象进行图像采集的角度,不同的待检测帧可以通过设置在不同采集视角下的图像采集设备进行采集,也可以通过相同的图像设备在不同的采集视角下进行采集。The acquisition angle of view can be the angle of image acquisition of the target object, and different frames to be detected can be acquired by image acquisition devices set at different acquisition angles of view, or can be acquired by the same image device under different acquisition angles of view.
待检测帧中包含待进行深度检测的目标对象,目标对象的类型在本公开实施例中不做限制,可以包括各类人物对象、动物对象或是部分机械对象,比如机器人等。后续各公开实施例均以目标对象为人物对象为例进行说明,目标对象为其他类型的实现方式可以参考后续各公开实施例进行灵活扩展,不再一一阐述。The frame to be detected includes the target object to be subjected to depth detection. The type of the target object is not limited in the embodiments of the present disclosure, and may include various human objects, animal objects, or some mechanical objects, such as robots. Subsequent disclosed embodiments are described by taking the target object as a person object as an example. Implementations in which the target object is other types can be flexibly expanded by referring to the subsequent disclosed embodiments, and will not be elaborated one by one.
待检测帧中包含的目标对象数量在本公开实施例中同样不做限制,可以包含一个或多个目标对象,根据实际情况灵活决定。The number of target objects contained in the frame to be detected is also not limited in the embodiments of the present disclosure, and may contain one or more target objects, which can be flexibly determined according to actual conditions.
获取多帧待检测帧的方式在本公开实施例中也不做限制,在一种可能的实现方式中,可以从一个或多个视频中进行帧提取以得到多帧待检测帧,其中,帧提取可以包括逐帧提取、按照一定的间隔进行帧采样或是随机帧采样等一种或多种方式。在一种可能的实现方式中,也可以对目标对象进行多角度的图像采集来得到多帧待检测帧;在一些可能的实现方式中,还可以从数据库中读取以得到不同采集视角下的多帧待检测帧等。The manner of obtaining multiple frames to be detected is not limited in the embodiment of the present disclosure. In a possible implementation, frame extraction may be performed from one or more videos to obtain multiple frames to be detected, wherein, frame The extraction may include one or more methods such as frame-by-frame extraction, frame sampling at a certain interval, or random frame sampling. In a possible implementation, it is also possible to collect images from multiple angles of the target object to obtain multiple frames to be detected; Multiple frames to be detected, etc.
步骤S12,根据待检测帧进行目标对象中目标区域的关键点检测,确定与多帧待检测帧对应的多个关键点检测结果。Step S12 , performing key point detection of the target area in the target object according to the frame to be detected, and determining multiple key point detection results corresponding to multiple frames to be detected.
其中,关键点检测结果可以包括检测到的关键点在待检测帧中的位置。其中,检测到的关键点数量和类型可以根据实际情况灵活决定,在一些可能的实现方式中,检测到的关键点数量可以包括2~150个等,在一个示例中,检测到的关键点可以包含人体的14个肢体关键点(如头部关键点、肩部关键点、颈部关键点、手肘关键点、手腕关键点、胯部关键点、腿部关键点以及足部关键点等),或是包含人体外围轮廓上的59个轮廓关键点(如头部外围或是肩部外围上的一些关键点)等。在一种可能的实现方式中,为了减小计算量,检测到的关键点也可以仅包含头部关键点、左肩关键点以及右肩关键点共三个关键点。Wherein, the key point detection result may include the position of the detected key point in the frame to be detected. Among them, the number and types of detected key points can be flexibly determined according to the actual situation. In some possible implementations, the number of detected key points can include 2 to 150, etc. In an example, the detected key points can be Contains 14 limb key points of the human body (such as head key points, shoulder key points, neck key points, elbow key points, wrist key points, crotch key points, leg key points and foot key points, etc.) , or include 59 outline key points on the outline of the human body (such as some key points on the periphery of the head or the periphery of the shoulders) and the like. In a possible implementation manner, in order to reduce the amount of calculation, the detected key points may also only include three key points including the key point of the head, the key point of the left shoulder and the key point of the right shoulder.
多个关键点检测结果可以分别与多帧待检测帧相对应,举例来说,对多帧待检测帧分别进行关键点检测,则每帧待检测帧可以对应一个关键点检测结果,从而可以得到多个关键点检测结果。Multiple key point detection results can correspond to multiple frames to be detected respectively. For example, if key point detection is performed on multiple frames to be detected, each frame to be detected can correspond to a key point detection result, so that it can be obtained Multiple keypoint detection results.
目标区域可以包括头部区域和/或肩部区域,目标对象的头部区域可以是目标对象头 部所在的区域,比如头部关键点和颈部关键点之间所构成的区域;肩部区域则可以是目标对象肩颈部所在的区域,比如颈部关键点和肩部关键点之间所构成的区域。The target area may include a head area and/or a shoulder area, and the head area of the target object may be the area where the head of the target object is located, such as the area formed between the key points of the head and the key points of the neck; the shoulder area Then it may be the area where the shoulder and neck of the target object are located, such as the area formed between the key points of the neck and the key points of the shoulder.
图2示出根据本公开实施例的目标区域的示意图,如图2所示,在一种可能的实现方式中,在目标区域包括头部区域和肩部区域的情况下,可以将头部关键点、左肩关键点和右肩关键点连接而成的头肩框,作为目标区域。在一个示例中,头肩框可以是如图2所示的矩形,从图2中可以看出,头肩框可以通过连接目标对象头部顶点的头部关键点、左肩关节处的左肩关键点和右肩关节处的右肩关键点所得到。在一个示例中,头肩框也可以为其他性状,比如多边形、圆形或是其他不规则的形状等。Fig. 2 shows a schematic diagram of a target area according to an embodiment of the present disclosure. As shown in Fig. 2 , in a possible implementation, when the target area includes a head area and a shoulder area, the head key can be point, the key point of the left shoulder and the key point of the right shoulder are connected by the head and shoulders box, which is used as the target area. In one example, the head-shoulders frame can be a rectangle as shown in Figure 2. It can be seen from Figure 2 that the head-shoulders frame can be connected to the head key point at the head vertex of the target object and the left shoulder key point at the left shoulder joint. and the right shoulder key point at the right shoulder joint. In an example, the head-shoulders frame may also be in other shapes, such as polygons, circles, or other irregular shapes.
关键点检测的方式可以根据实际情况灵活决定,在一种可能的实现方式中,可以将待检测帧输入具有关键点检测功能的任意神经网络以实现关键点检测;在一些可能的实现方式中,也可以通过相关的关键点识别算法,对待检测帧进行关键点识别以得到关键点检测结果;在一些可能的实现方式中,还可以根据目标对象或目标对象中的目标区域在待检测帧中的位置,对待检测帧中的部分图像区域进行关键点检测,以得到关键点检测结果等。步骤S12的一些可能的具体实现方式可以详见下述各公开实施例,在此先不做展开。The way of key point detection can be flexibly determined according to the actual situation. In one possible implementation, the frame to be detected can be input into any neural network with key point detection function to realize key point detection; in some possible implementations, It is also possible to perform key point identification on the frame to be detected through a relevant key point identification algorithm to obtain a key point detection result; Position, perform key point detection on a part of the image area in the frame to be detected to obtain key point detection results, etc. For some possible specific implementations of step S12, reference may be made to the following disclosed embodiments in detail, which will not be expanded here.
步骤S13,根据多个关键点检测结果,确定待检测帧中目标对象的深度信息。Step S13, according to the multiple key point detection results, determine the depth information of the target object in the frame to be detected.
其中,深度信息包含的信息内容可以根据实际情况灵活决定,任何可以反映目标对象在三维空间中的深度情况的信息,均可以作为深度信息的实现方式。在一种可能的实现方式中,深度信息可以包括深度距离和/或偏移角度。Wherein, the information content contained in the depth information can be flexibly determined according to the actual situation, and any information that can reflect the depth of the target object in the three-dimensional space can be used as a realization method of the depth information. In a possible implementation manner, the depth information may include a depth distance and/or an offset angle.
深度距离可以是目标对象与采集设备之间的距离,采集设备可以是对目标对象进行图像采集的任意设备,在一些可能的实现方式中,该采集设备可以是静态图像的采集设备,如照相机等;在一些可能的实现方式中,该采集设备也可以是采集动态图像的设备,比如摄像机或是摄像头等。The depth distance can be the distance between the target object and the collection device, and the collection device can be any device that collects images of the target object. In some possible implementations, the collection device can be a static image collection device, such as a camera, etc. ; In some possible implementation manners, the collection device may also be a device for collecting dynamic images, such as a video camera or a camera.
如上述公开实施例所述,不同的待检测帧可以通过设置在不同采集视角下的图像采集设备进行采集,也可以通过相同的图像设备在不同的采集视角下进行采集,因此,采集设备的数量可以为一个或多个。在一种可能的实现方式中,本公开实施例提出的深度检测方法,可以基于至少两个采集设备来实现,在这种情况下,至少两个采集设备可以从至少两个采集视角对目标对象进行图像采集,以得到多帧待检测帧。As described in the above-mentioned disclosed embodiments, different frames to be detected can be collected by image acquisition devices set under different acquisition angles of view, or can be acquired by the same image device under different acquisition angles of view. Therefore, the number of acquisition devices Can be one or more. In a possible implementation, the depth detection method proposed by the embodiment of the present disclosure can be implemented based on at least two acquisition devices. In this case, at least two acquisition devices can detect the target object from at least two acquisition angles. Image acquisition is performed to obtain multiple frames to be detected.
在采集设备包括至少两个采集设备的情况下,不同的采集设备的类型可以相同,也可以不同,根据实际情况灵活选择即可,在本公开实施例中不做限制。In the case where the collection device includes at least two collection devices, the types of different collection devices may be the same or different, which can be flexibly selected according to the actual situation, and there is no limitation in this embodiment of the present disclosure.
深度距离可以是目标对象与采集设备之间的距离,该距离可以是目标对象与采集设备整体之间的距离,也可以是目标对象与采集设备的某个设备部件之间的距离,在一些可能的实现方式中,可以将目标对象与采集设备的光心之间的距离,作为深度距离。The depth distance can be the distance between the target object and the collection device, the distance can be the distance between the target object and the collection device as a whole, or the distance between the target object and a certain equipment part of the collection device, in some possible In an implementation manner of , the distance between the target object and the optical center of the acquisition device may be used as the depth distance.
偏移角度可以是目标对象相对于采集设备的偏移角度,在一种可能的实现方式中,该偏移角度可以是目标对象相对于采集设备的光轴的空间角度。The offset angle may be an offset angle of the target object relative to the collection device, and in a possible implementation manner, the offset angle may be a spatial angle of the target object relative to the optical axis of the collection device.
由于多个关键点检测结果可以与多帧待检测帧相对应,而多帧待检测帧可以通过从至少两个采集视角对目标对象进行图像采集所得到,因此,基于多个关键点检测结果,可以确定多帧待检测帧之间所形成的视差,继而可以实现基于视差的深度信息计算,得到目标对象的深度信息。其中,基于关键点检测结果所实现的基于视差的计算方式可以根据实际情况灵活决定,任何基于视差实现深度测距的方式均可以用于步骤S13的实现过程中,详见下述各公开实施例,在此先不做展开。Since multiple key point detection results can correspond to multiple frames to be detected, and multiple frames to be detected can be obtained by collecting images of the target object from at least two acquisition angles of view, therefore, based on multiple key point detection results, The parallax formed between multiple frames to be detected can be determined, and then the depth information calculation based on the parallax can be realized to obtain the depth information of the target object. Among them, the parallax-based calculation method based on the key point detection results can be flexibly determined according to the actual situation. Any method for realizing depth ranging based on parallax can be used in the implementation process of step S13. For details, see the following disclosed embodiments. , do not expand here.
在本公开实施例中,通过获取从至少两个采集视角下采集到的多帧待检测帧,根据待检测帧进行目标区域的关键点检测,确定多帧待检测帧对应的多个关键点检测结果,并基于多个关键点检测结果,确定目标对象的深度信息,通过本公开实施例,可以通过至少两个采集视角下所采集的多帧待检测帧所形成的视差,利用多帧待检测帧中目标区 域对应的多个关键点检测结果,实现基于视差的计算来得到深度信息,有效减小基于视差进行计算的过程中所处理的数据量,提高深度检测的效率和精度。In the embodiment of the present disclosure, by acquiring multiple frames to be detected from at least two acquisition angles of view, and performing key point detection of the target area according to the frames to be detected, multiple key point detections corresponding to multiple frames to be detected are determined As a result, and based on the detection results of multiple key points, the depth information of the target object is determined. Through the embodiments of the present disclosure, the parallax formed by the multiple frames to be detected collected under at least two acquisition angles can be used to utilize the multi-frames to be detected The detection results of multiple key points corresponding to the target area in the frame realize the calculation based on parallax to obtain depth information, effectively reduce the amount of data processed in the process of calculation based on parallax, and improve the efficiency and accuracy of depth detection.
在一种可能的实现方式中,步骤S12可以包括:In a possible implementation manner, step S12 may include:
根据目标对象在参考帧中的位置信息,对待检测帧中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果。According to the position information of the target object in the reference frame, key point detection is performed on the target area of the target object in the frame to be detected, and a key point detection result corresponding to the frame to be detected is obtained.
其中,参考帧可以是目标视频中位于待检测帧之前的视频帧,目标视频可以是包含待检测帧的视频。在一些可能的实现方式中,不同的待检测帧可以分别属于不同的目标视频,在这种情况下,不同的待检测帧对应的参考帧也可以不同。Wherein, the reference frame may be a video frame located before the frame to be detected in the target video, and the target video may be a video including the frame to be detected. In some possible implementation manners, different frames to be detected may respectively belong to different target videos, and in this case, reference frames corresponding to different frames to be detected may also be different.
在一些可能的实现方式中,参考帧可以是目标视频中待检测帧的前一帧,在一些可能的实现方式中,参考帧也可以是目标视频中,位于待检测帧以前且与待检测帧之间的距离不超过预设距离的视频帧,预设距离的数量可以根据实际情况灵活决定,可以是间隔一帧或多帧等,在本公开实施例中不做限定。In some possible implementations, the reference frame can be the previous frame of the frame to be detected in the target video, and in some possible implementations, the reference frame can also be the frame in the target video, located before the frame to be detected and connected to the frame to be detected The distance between the video frames does not exceed the preset distance, the number of preset distances can be flexibly determined according to the actual situation, and can be one or more frames apart, which is not limited in this embodiment of the present disclosure.
由于参考帧位于待检测帧之前,且与待检测帧的距离不超过预设距离,因此参考帧中目标对象的位置,和待检测帧中目标对象的位置可能较为接近,在这种情况下,根据目标对象在参考帧中的位置信息,可以大致确定出待检测帧中目标对象的位置信息,在这种情况下,可以对待检测帧中的目标对象的目标区域进行更有针对性的关键点检测,且检测的数据量也会较小,从而可以得到更为准确的关键点检测结果,也可以提升关键点检测的效率。Since the reference frame is located before the frame to be detected, and the distance from the frame to be detected does not exceed the preset distance, the position of the target object in the reference frame may be relatively close to the position of the target object in the frame to be detected. In this case, According to the position information of the target object in the reference frame, the position information of the target object in the frame to be detected can be roughly determined. In this case, the target area of the target object in the frame to be detected can be more targeted. Detection, and the amount of data detected will be smaller, so that more accurate key point detection results can be obtained, and the efficiency of key point detection can also be improved.
在一些可能的实现方式中,根据目标对象在参考帧中的位置信息,对待检测帧中的目标对象的目标区域进行关键点检测的方式可以根据实际情况灵活决定,比如可以根据目标对象在参考帧中的位置信息对待检测帧进行裁剪后再进行关键点检测,或是根据目标对象在参考帧中的位置信息,直接对待检测帧中对应位置的图像区域进行关键点检测等,各种可能的实现方式可以详见下述各公开实施例,在此先不做展开。In some possible implementations, according to the position information of the target object in the reference frame, the key point detection method of the target area of the target object in the frame to be detected can be flexibly determined according to the actual situation, for example, according to the position information of the target object in the reference frame The position information in the to-be-detected frame is cropped and then the key point detection is performed, or according to the position information of the target object in the reference frame, the key point detection is directly performed on the image area corresponding to the position in the to-be-detected frame, etc., various possible implementations The methods can be referred to the following disclosed embodiments in detail, and will not be expanded here.
通过本公开实施例,可以根据目标对象在参考帧中的位置信息,对待检测帧中的目标区域实现更有针对性的关键点检测,提升关键点检测的效率和精度,从而提升深度检测方法的效率和精度。Through the embodiments of the present disclosure, according to the position information of the target object in the reference frame, more targeted key point detection can be realized for the target area in the frame to be detected, and the efficiency and accuracy of key point detection can be improved, thereby improving the depth detection method. efficiency and precision.
在一种可能的实现方式中,根据目标对象在参考帧中的位置信息,对待检测帧中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果,包括:In a possible implementation manner, according to the position information of the target object in the reference frame, the key point detection is performed on the target area of the target object in the frame to be detected, and the key point detection result corresponding to the frame to be detected is obtained, including:
根据所述参考帧中所述目标对象的第一位置,对待检测帧进行裁剪,得到裁剪结果;clipping the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result;
对裁剪结果中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果。The key point detection is performed on the target area of the target object in the clipping result, and the key point detection result corresponding to the frame to be detected is obtained.
其中,第一位置可以是参考帧中目标对象整体的位置坐标,比如在目标对象为人物对象的情况下,该第一位置可以是目标对象的人体框在参考帧中的位置坐标。Wherein, the first position may be the overall position coordinates of the target object in the reference frame. For example, if the target object is a person object, the first position may be the position coordinates of the body frame of the target object in the reference frame.
根据第一位置对待检测帧进行裁剪的方式在本公开实施例中同样不做限制,不局限于下述各公开实施例。在一种可能的实现方式中,可以根据第一位置,确定参考帧中人体框的第一坐标,并结合参考帧和待检测帧之间的位置坐标对应关系,确定目标对象的人体框在待检测帧中的第二坐标,基于该第二坐标对待检测帧进行裁剪以得到裁剪结果。The manner of clipping the frame to be detected according to the first position is also not limited in the embodiments of the present disclosure, and is not limited to the following disclosed embodiments. In a possible implementation, the first coordinates of the human body frame in the reference frame can be determined according to the first position, and combined with the corresponding relationship between the position coordinates between the reference frame and the frame to be detected, it can be determined that the human body frame of the target object is in the frame to be detected. The second coordinates in the frame are detected, and the frame to be detected is cropped based on the second coordinates to obtain a cropping result.
在一些可能的实现方式中,也可以根据第一位置,确定参考帧中人体框的第一坐标,以及人体框的边框长度,并结合参考帧和待检测帧之间的位置坐标对应关系,确定目标对象的人体框在待检测帧中的第二坐标,基于该第二坐标和边框长度来对待检测帧进行裁剪以得到裁剪结果,其中,基于第二坐标和边框长度的裁剪,可以是根据第二坐标确定裁剪端点的位置,并边框长度确定裁剪结果的长度,在一个示例中,裁剪结果的长度可以与边框长度一致,在一个示例中,裁剪结果的长度也可以与边框长度成比例,比如为边框长度的N倍等,N可以为不小于1的任意数值等。In some possible implementations, the first coordinates of the body frame in the reference frame and the border length of the body frame can also be determined according to the first position, and combined with the position coordinate correspondence between the reference frame and the frame to be detected, determine The second coordinates of the human body frame of the target object in the frame to be detected, and the frame to be detected is cropped based on the second coordinates and the frame length to obtain a clipping result, wherein, the clipping based on the second coordinates and the frame length can be based on the first The two coordinates determine the position of the clipping endpoint, and the frame length determines the length of the clipping result. In one example, the length of the clipping result can be consistent with the frame length. In one example, the length of the clipping result can also be proportional to the frame length, such as N times the frame length, etc., N can be any value not less than 1, etc.
对裁剪结果中的目标对象进行关键点检测的方式可以根据实际情况灵活决定,详见 下述各公开实施例,在此先不做展开。The way to detect the key points of the target object in the clipping result can be flexibly determined according to the actual situation. For details, please refer to the following disclosed embodiments, which will not be expanded here.
通过本公开实施例,可以根据参考帧中目标对象的第一位置,对待检测帧中的目标对象进行初步定位,得到裁剪结果,基于该裁剪结果进行目标区域的关键点检测,一方面可以减小检测的数据量,提高检测效率,另一方面由于裁剪后目标对象在裁剪结果中所占的比例较大,因此可以提升关键点检测的精度。Through the embodiments of the present disclosure, the target object in the frame to be detected can be preliminarily positioned according to the first position of the target object in the reference frame, and the clipping result can be obtained, and the key point detection of the target area can be performed based on the clipping result. On the one hand, it can reduce The amount of detected data improves the detection efficiency. On the other hand, since the target object accounts for a large proportion in the cropped result after cropping, the accuracy of key point detection can be improved.
在一种可能的实现方式中,根据目标对象在参考帧中的位置信息,对待检测帧中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果,包括:In a possible implementation manner, according to the position information of the target object in the reference frame, the key point detection is performed on the target area of the target object in the frame to be detected, and the key point detection result corresponding to the frame to be detected is obtained, including:
获取目标对象的目标区域在参考帧中的第二位置;Acquiring a second position of the target area of the target object in the reference frame;
根据第二位置,对待检测帧进行裁剪,得到裁剪结果;Cutting the frame to be detected according to the second position to obtain a cutting result;
对裁剪结果中的目标对象进行关键点检测,得到关键点检测结果。Perform key point detection on the target object in the clipping result to obtain the key point detection result.
其中,第二位置可以是目标对象的目标区域在参考帧中的位置坐标,如上述各公开实施例所述,目标区域可以包括头部区域和/或肩部区域,故在一种可能的实现方式中,该第二位置可以是目标对象的头肩框在参考帧中的位置坐标。Wherein, the second position may be the position coordinates of the target area of the target object in the reference frame. As described in the above disclosed embodiments, the target area may include the head area and/or the shoulder area, so in a possible implementation In the manner, the second position may be the position coordinates of the head and shoulders frame of the target object in the reference frame.
如何确定目标区域在参考帧中的第二位置,其实现形式可以根据实际情况灵活决定,比如可以通过对参考帧进行头肩框和/或关键点识别等方式进行实现,详见下述各公开实施例,在此先不做展开。How to determine the second position of the target area in the reference frame, the implementation form can be flexibly determined according to the actual situation, for example, it can be realized by performing head and shoulder frame and/or key point recognition on the reference frame, see the following publications for details Embodiment, do not expand here.
根据第二位置对待检测帧进行裁剪的方式,可以参考根据第一位置对待检测帧进行裁剪的方式,在此不再赘述。For the manner of clipping the frame to be detected according to the second position, reference may be made to the manner of clipping the frame to be detected according to the first position, which will not be repeated here.
对裁剪结果中的目标对象进行关键点检测的方式,可以与根据第一位置所得到的裁剪结果进行关键点检测的方式相同,也可以不同,详见下述各公开实施例,在此先不做展开。The key point detection method for the target object in the clipping result can be the same as the key point detection method based on the clipping result obtained at the first position, or it can be different. Do unfold.
通过本公开实施例,可以根据参考帧中目标对象的目标区域所在的第二位置来得到关键点检测结果,这种方式可以更为针对性地关注目标区域,从而进一步减小数据的处理量,从而更进一步地提升了深度检测的精度和效率。Through the embodiments of the present disclosure, the key point detection result can be obtained according to the second position of the target area of the target object in the reference frame. In this way, the target area can be more targeted, thereby further reducing the amount of data processing. Therefore, the accuracy and efficiency of depth detection are further improved.
在一种可能的实现方式中,获取目标对象的目标区域在参考帧中的第二位置,可以包括:In a possible implementation manner, obtaining the second position of the target area of the target object in the reference frame may include:
通过第一神经网络对参考帧中的目标区域进行识别,得到第一神经网络输出的第二位置;和/或,Using the first neural network to identify the target area in the reference frame to obtain the second position output by the first neural network; and/or,
根据参考帧对应的关键点检测结果,得到目标区域在参考帧中的第二位置。According to the key point detection result corresponding to the reference frame, the second position of the target area in the reference frame is obtained.
其中,第一神经网络可以是用于确定第二位置的任意网络,其实现形式在本公开实施例中不做限制。在一些可能的实现方式中,第一神经网络可以是目标区域检测网络,用于直接从参考帧中识别目标区域的第二位置,在一个示例中,该目标区域检测网络可以是更快的基于区域的卷积神经网络(Faster Regions with Convolutional Neural Networks,Faster RCNN);在一些可能的实现方式中,第一神经网络也可以是关键点检测网络,用于对参考帧中的一个或多个关键点进行识别,继而根据识别到的关键点位置,确定参考帧中目标区域的第二位置。Wherein, the first neural network may be any network used to determine the second position, and its implementation form is not limited in the embodiments of the present disclosure. In some possible implementations, the first neural network may be an object area detection network for identifying the second location of the object area directly from the reference frame. In one example, the object area detection network may be faster based on Regional Convolutional Neural Networks (Faster Regions with Convolutional Neural Networks, Faster RCNN); in some possible implementations, the first neural network can also be a key point detection network, which is used to detect one or more key points in the reference frame Points are identified, and then the second position of the target area in the reference frame is determined according to the positions of the identified key points.
在一些可能的实现方式中,参考帧也可能作为待检测帧进行深度检测,在这种情况下,参考帧可能已经经历过关键点检测并得到对应的关键点检测结果。因此,在一些可能的实现方式中,可以根据参考帧对应的关键点检测结果,来得到目标区域在参考帧中的第二位置。In some possible implementation manners, the reference frame may also be used as the frame to be detected for depth detection. In this case, the reference frame may have undergone key point detection and a corresponding key point detection result has been obtained. Therefore, in some possible implementation manners, the second position of the target area in the reference frame may be obtained according to the key point detection result corresponding to the reference frame.
在一些可能的实现方式中,也可以直接对参考帧进行关键点检测以得到关键点检测结果,关键点检测的方式可以参考其他各公开实施例,在此不再赘述。In some possible implementation manners, the key point detection may also be directly performed on the reference frame to obtain the key point detection result. For the key point detection method, reference may be made to other disclosed embodiments, which will not be repeated here.
通过本公开实施例,可以根据参考帧的实际情况,灵活地采用多种方式确定目标区域在参考帧中的第二位置,提升了深度检测的灵活性和通用性;而且在一些可能的实现方式中,在位于待检测帧以前的参考帧参与过深度检测的情况下,可以直接基于参考帧 在深度检测中得到的中间结果来确定第二位置,从而减小数据的重复计算,提升深度检测的效率和精度。Through the embodiments of the present disclosure, the second position of the target area in the reference frame can be flexibly determined in multiple ways according to the actual situation of the reference frame, which improves the flexibility and versatility of depth detection; and in some possible implementations In the case where the reference frame before the frame to be detected has participated in the depth detection, the second position can be determined directly based on the intermediate result of the reference frame in the depth detection, thereby reducing the repeated calculation of data and improving the depth detection. efficiency and precision.
在一种可能的实现方式中,对裁剪结果中的目标对象进行关键点检测,得到关键点检测结果,可以包括:In a possible implementation manner, the key point detection is performed on the target object in the clipping result to obtain the key point detection result, which may include:
通过第二神经网络对裁剪结果中的目标对象进行关键点检测,得到关键点检测结果。The second neural network is used to perform key point detection on the target object in the clipping result to obtain a key point detection result.
其中,第二神经网络可以是用于实现关键点检测的任意神经网络,其实现方式在本公开实施例中不做限制,其中,在第一神经网络可以是关键点检测网络的情况下,第二神经网络可以与第一神经网络的实现方式相同或不同。Wherein, the second neural network may be any neural network used to realize key point detection, and its implementation mode is not limited in the embodiments of the present disclosure, wherein, when the first neural network may be a key point detection network, the second The second neural network may be implemented in the same or different manner as the first neural network.
在一些可能的实现方式中,也可以通过相关的关键点识别算法对裁剪结果中的目标对象进行关键点检测,采用何种关键点识别算法在本公开实施例中同样不做限制。In some possible implementation manners, key point detection may also be performed on the target object in the clipping result through a related key point recognition algorithm, and the key point recognition algorithm to be used is also not limited in the embodiments of the present disclosure.
图3示出根据本公开一实施例的深度检测方法的流程图,如图3所示,在一种可能的实现方式中,步骤S13可以包括:FIG. 3 shows a flowchart of a depth detection method according to an embodiment of the present disclosure. As shown in FIG. 3 , in a possible implementation, step S13 may include:
步骤S131,获取至少两个采集设备分别对应的至少两个预设设备参数,至少两个采集设备用于从至少两个采集视角对目标对象进行图像采集。Step S131, acquiring at least two preset device parameters respectively corresponding to at least two capture devices, the at least two capture devices are used to capture images of the target object from at least two capture angles of view.
步骤S132,根据至少两个预设设备参数以及多个关键点检测结果,确定待检测帧中目标对象的深度信息。Step S132: Determine the depth information of the target object in the frame to be detected according to at least two preset device parameters and a plurality of key point detection results.
其中,采集设备的实现方式可以参考上述各公开实施例,在此不再赘述。For the implementation manner of the collection device, reference may be made to the above disclosed embodiments, which will not be repeated here.
在一些可能的实现方式中,至少两个预设设备参数可以包括至少两个采集设备分别对应的预设内部参数。预设内部参数可以是采集设备本身的一些标定参数,其包含的参数类型和种类可以根据采集设备的实际情况灵活决定。在一些可能的实现方式中,预设内部参数可以包括采集设备的内参矩阵,该内参矩阵中可以包含相机的一个或多个焦距参数,以及一个或多个相机的主点位置等。In some possible implementation manners, the at least two preset device parameters may include preset internal parameters respectively corresponding to at least two acquisition devices. The preset internal parameters may be some calibration parameters of the collection device itself, and the types and types of parameters contained therein may be flexibly determined according to the actual situation of the collection device. In some possible implementation manners, the preset internal parameters may include an internal reference matrix of the acquisition device, and the internal reference matrix may include one or more focal length parameters of the camera, principal point positions of one or more cameras, and the like.
在一些可能的实现方式中,由于采集设备可以包括至少两个采集设备,因此至少两个预设设备参数中,还可以包括预设外部参数,其中,预设外部参数可以是不同采集设备之间所形成的相对参数,用于描述不同采集设备之间在世界坐标系中的相对位置。在一些可能的实现方式中,预设外部参数可以包括不同采集设备之间形成的外参矩阵,在一个示例中,该外参矩阵可以包括旋转矩阵和/或平移向量矩阵等。In some possible implementations, since the collection device may include at least two collection devices, at least two preset device parameters may also include preset external parameters, wherein the preset external parameters may be between different collection devices The formed relative parameters are used to describe the relative positions of different acquisition devices in the world coordinate system. In some possible implementation manners, the preset external parameters may include an external parameter matrix formed between different acquisition devices. In an example, the external parameter matrix may include a rotation matrix and/or a translation vector matrix, and the like.
获取预设设备参数的方式在本公开实施例中不做限定,在一些可能的实现方式中,可以根据采集设备的实际情况直接获取该预设设备参数,在一些可能的实现方式中,也可以通过对采集设备进行标定来获得该预设设备参数。The way to obtain the preset device parameters is not limited in the embodiments of the present disclosure. In some possible implementations, the preset device parameters can be directly obtained according to the actual situation of the acquisition device. In some possible implementations, you can also The preset device parameters are obtained by calibrating the acquisition device.
根据多个关键点检测结果之间的位置关系,结合至少两个预设设备参数,可以确定在三维的世界坐标系下不同的待检测帧之间所形成的视差。上述公开实施例中提到,深度信息包含的信息内容可以根据实际情况灵活决定,因此随着深度信息内容的不同,根据预设设备参数与多个关键点检测结果确定深度信息的过程也可以随之发生变化,详见下述各公开实施例,在此先不做展开。According to the positional relationship among the multiple key point detection results, combined with at least two preset device parameters, the parallax formed between different frames to be detected in the three-dimensional world coordinate system can be determined. As mentioned in the above-mentioned disclosed embodiments, the information content contained in the depth information can be flexibly determined according to the actual situation. Therefore, with the different content of the depth information, the process of determining the depth information according to the preset device parameters and the detection results of multiple key points can also be determined at any time. For the changes, see the following disclosed embodiments for details, and will not be expanded here.
通过本公开实施例,可以利用至少两个预设设备参数和多个关键点检测结果,确定不同待检测帧之间所形成的视差,简单便捷地确定深度信息,这种方式计算量较小且结果较为精确,可以提升深度检测的精度和效率。Through the embodiments of the present disclosure, at least two preset device parameters and multiple key point detection results can be used to determine the disparity formed between different frames to be detected, and to determine the depth information simply and conveniently. This method has a small amount of calculation and is The result is more accurate, which can improve the accuracy and efficiency of depth detection.
在一种可能的实现方式中,步骤S132可以包括:In a possible implementation manner, step S132 may include:
根据至少两个预设设备参数中的预设外部参数以及多个关键点检测结果在至少两个形式下的坐标,得到深度距离。The depth distance is obtained according to the preset external parameters among the at least two preset device parameters and the coordinates of the multiple key point detection results in at least two forms.
其中,预设外部参数的实现形式可以参考上述各公开实施例,在此不再赘述。关键点检测结果在至少两个形式下的坐标,可以是关键点检测结果在不同的坐标系下所对应的坐标,比如可以包括关键点检测结果在图像坐标系中所形成的像素坐标,和/或,在不同的采集设备中分别形成的齐次坐标等。具体选择哪些形式的坐标可以根据实际情况灵 活选择,不局限于下述各公开实施例。Wherein, the implementation form of preset external parameters may refer to the above-mentioned disclosed embodiments, which will not be repeated here. The coordinates of the key point detection results in at least two forms can be the corresponding coordinates of the key point detection results in different coordinate systems, for example, it can include the pixel coordinates formed by the key point detection results in the image coordinate system, and/or Or, homogeneous coordinates formed separately in different acquisition devices, etc. Which form of coordinates to choose can be flexibly selected according to the actual situation, and is not limited to the following disclosed embodiments.
在得到深度距离的过程中,选用关键点检测结果中哪个关键点的坐标,在本公开实施例中不做限制,在一些可能的实现方式中,可以选用头部关键点、左肩关键点以及右肩关键点中的一个或多个,在一个示例中,可以选用头部关键点。在一些可能的实现方式中,还可以选用头肩中心点。In the process of obtaining the depth distance, the coordinates of the key points in the key point detection results are not limited in the embodiment of the present disclosure. In some possible implementations, the head key point, left shoulder key point and right shoulder key point can be selected. One or more of the shoulder keys and, in one example, the head key. In some possible implementations, the center of the head and shoulders can also be chosen.
其中,头肩中心点可以是上述公开实施例中提到的头肩框的中心点,在一些可能的实现方式中,可以根据头部关键点、左肩关键点和右肩关键点的位置坐标,确定头肩框整体的位置坐标,并基于该头肩框整体的位置坐标,确定头肩中心点的位置坐标;在一些可能的实现方式中,也可以直接将头肩中心点作为待检测的关键点,从而在关键点检测结果中直接获取到头肩中心点的位置坐标。Wherein, the center point of the head and shoulders may be the center point of the head and shoulders frame mentioned in the above disclosed embodiments. In some possible implementations, the position coordinates of the key points of the head, the key points of the left shoulder and the key points of the right shoulder may be Determine the overall position coordinates of the head and shoulders frame, and determine the position coordinates of the center point of the head and shoulders based on the overall position coordinates of the head and shoulders frame; in some possible implementations, the center point of the head and shoulders can also be directly used as the key to be detected point, so that the position coordinates of the center point of the head and shoulders can be directly obtained in the key point detection results.
随着采集设备数量的不同,得到深度距离的计算方式可以灵活发生变化,不局限于下述各公开实施例。在一个示例中,可以包括左相机和右相机两个采集设备,在这种情况下,根据至少两个预设设备参数中的外部参数以及多个关键点检测结果在至少两个形式下的坐标,得到深度距离的过程,可以通过下述公式(1)和(2)进行表示:As the number of acquisition devices is different, the calculation method for obtaining the depth distance can be flexibly changed, and is not limited to the following disclosed embodiments. In one example, it may include two acquisition devices, a left camera and a right camera. In this case, according to the external parameters in at least two preset device parameters and the coordinates of a plurality of key point detection results in at least two forms , the process of obtaining the depth distance can be expressed by the following formulas (1) and (2):
Figure PCTCN2022085920-appb-000001
Figure PCTCN2022085920-appb-000001
Figure PCTCN2022085920-appb-000002
Figure PCTCN2022085920-appb-000002
其中,d为深度距离,
Figure PCTCN2022085920-appb-000003
为左相机采集的待检测帧中关键点在齐次形式下的原始坐标,
Figure PCTCN2022085920-appb-000004
为对原始坐标进行线性变换后所得到的变换坐标,
Figure PCTCN2022085920-appb-000005
为右相机采集的待检测帧中关键点在齐次形式下的坐标,
Figure PCTCN2022085920-appb-000006
为预设外部参数中右相机相对于左相机的旋转矩阵R,
Figure PCTCN2022085920-appb-000007
为预设外部参数中右相机相对于左相机的平移向量矩阵T。
Among them, d is the depth distance,
Figure PCTCN2022085920-appb-000003
is the original coordinates of the key points in the homogeneous form in the frame to be detected collected by the left camera,
Figure PCTCN2022085920-appb-000004
is the transformed coordinate obtained by linearly transforming the original coordinate,
Figure PCTCN2022085920-appb-000005
is the coordinates of the key points in the homogeneous form in the frame to be detected collected by the right camera,
Figure PCTCN2022085920-appb-000006
is the rotation matrix R of the right camera relative to the left camera in the preset external parameters,
Figure PCTCN2022085920-appb-000007
is the translation vector matrix T of the right camera relative to the left camera in the preset external parameters.
通过本公开实施例,可以不同相机坐标系下关键点的齐次形式坐标,以及关键点在线性变换后形式下的坐标,结合不同相机之间相对的预设外部参数,以较小的计算量精确地确定深度距离,从而提升深度检测的精度和效率。Through the embodiments of the present disclosure, the homogeneous form coordinates of key points in different camera coordinate systems and the coordinates of key points in the form of linear transformation can be combined with the relative preset external parameters between different cameras, with a small amount of calculation Accurately determine the depth distance, thereby improving the accuracy and efficiency of depth detection.
在一种可能的实现方式中,步骤S132也可以包括:In a possible implementation manner, step S132 may also include:
根据至少两个预设设备参数中的预设内部参数以及多个关键点检测结果在至少两个形式下的坐标,得到偏移角度。The offset angle is obtained according to the preset internal parameters in the at least two preset device parameters and the coordinates of the multiple key point detection results in at least two forms.
其中,预设内部参数与关键点检测结果在至少两个形式下的坐标的实现形式,同样可以参考上述各公开实施例,在此不再赘述。Wherein, the implementation forms of preset internal parameters and coordinates of key point detection results in at least two forms can also refer to the above disclosed embodiments, and will not be repeated here.
根据预设内部参数以及关键点检测结果在至少两个形式下的坐标,得到偏移角度的方式也可以灵活选择,不局限于下述各公开实施例。确定偏移角度的过程中,选用的关键点的种类同样可以根据实际情况灵活选择,可以参考上述确定深度距离中选用的关键点类型,在此不再赘述。According to the preset internal parameters and the coordinates of the key point detection results in at least two forms, the way of obtaining the offset angle can also be flexibly selected, and is not limited to the following disclosed embodiments. In the process of determining the offset angle, the type of selected key points can also be flexibly selected according to the actual situation. You can refer to the type of key points selected in the above-mentioned determination of the depth distance, which will not be repeated here.
类似于深度距离的确定过程,随着采集设备数量的不同,得到偏移角度的计算方式也可以灵活发生变化,不局限于下述各公开实施例。在一个示例中,以采集设备包括某目标相机为例,得到相对于该目标相机的偏移角度的过程,可以通过下述公式(3)至(5)进行表示:Similar to the determination process of the depth distance, with the different number of acquisition devices, the calculation method for obtaining the offset angle can also be flexibly changed, and is not limited to the following disclosed embodiments. In one example, taking the acquisition device including a certain target camera as an example, the process of obtaining the offset angle relative to the target camera can be expressed by the following formulas (3) to (5):
Figure PCTCN2022085920-appb-000008
Figure PCTCN2022085920-appb-000008
Figure PCTCN2022085920-appb-000009
Figure PCTCN2022085920-appb-000009
Figure PCTCN2022085920-appb-000010
Figure PCTCN2022085920-appb-000010
其中,θ x为目标对象在x轴方向上的偏移角度,θ y为目标对象在y轴方向上的偏移角度,
Figure PCTCN2022085920-appb-000011
为目标相机采集的待检测帧中关键点在齐次形式下的坐标,
Figure PCTCN2022085920-appb-000012
为目标相机采集的待检测帧中关键点的像素坐标,f x和f y为目标相机的内参矩阵
Figure PCTCN2022085920-appb-000013
中的焦距参数,u 0和v 0为目标相机的内参矩阵K中的主点位置。
Among them, θ x is the offset angle of the target object in the x-axis direction, θ y is the offset angle of the target object in the y-axis direction,
Figure PCTCN2022085920-appb-000011
is the coordinates of the key points in the homogeneous form in the frame to be detected collected by the target camera,
Figure PCTCN2022085920-appb-000012
is the pixel coordinates of the key points in the frame to be detected collected by the target camera, f x and f y are the internal reference matrix of the target camera
Figure PCTCN2022085920-appb-000013
The focal length parameter in , u 0 and v 0 are the principal point positions in the intrinsic parameter matrix K of the target camera.
通过本公开实施例,可以利用预设内部参数和深度检测过程中得到的关键点检测结果在不同形式下的坐标,简单便捷地确定偏移角度,这种确定方式无需获取额外的数据,且便于计算,可以提升深度检测的效率和便捷程度。Through the embodiments of the present disclosure, the offset angle can be determined simply and conveniently by using the preset internal parameters and the coordinates of the key point detection results obtained in the depth detection process in different forms. This determination method does not need to obtain additional data and is convenient. Computing can improve the efficiency and convenience of in-depth detection.
在一种可能的实现方式中,本公开实施例提出的方法还可以包括:In a possible implementation manner, the method proposed in the embodiment of the present disclosure may further include:
根据目标对象的深度信息,确定目标对象在三维空间中的位置。According to the depth information of the target object, the position of the target object in the three-dimensional space is determined.
其中,目标对象在三维空间中的位置,可以是目标对象在三维空间中的三维坐标。基于深度信息确定三维空间中的位置的方式可以根据实际情况灵活选择,在一种可能的实现方式中,可以根据目标对象的关键点检测结果,确定目标对象在待检测帧中的二维坐标,并将该二维坐标与深度信息中的深度距离和/或偏移角度等进行结合,从而确定目标对象在三维空间中的三维坐标。Wherein, the position of the target object in the three-dimensional space may be the three-dimensional coordinates of the target object in the three-dimensional space. The way to determine the position in the three-dimensional space based on the depth information can be flexibly selected according to the actual situation. In a possible implementation mode, the two-dimensional coordinates of the target object in the frame to be detected can be determined according to the key point detection results of the target object. The two-dimensional coordinates are combined with the depth distance and/or offset angle in the depth information, so as to determine the three-dimensional coordinates of the target object in the three-dimensional space.
在确定目标对象在三维空间中的位置以后,可以基于该三维的位置信息,对目标对象进行人脸识别、活体识别、路线跟踪或是应用到虚拟现实(Virtual Reality,VR)或增强现实(Augmented Reality,AR)等场景中。通过本公开实施例,可以利用深度信息对 目标对象进行三维定位,从而与目标对象实现各种方式的交互等操作。比如,在一些可能的实现方式中,可以根据目标对象在三维空间中的位置,确定目标对象与智能空调之间的距离和角度,从而动态调整智能空调的风向和/或风速;在一些可能的实现方式中,也可以在AR游戏平台中,基于目标对象在三维空间中的位置,对目标对象在游戏场景中进行定位,从而可以更加真实自然地实现AR场景中的人机互动。After determining the position of the target object in the three-dimensional space, based on the three-dimensional position information, face recognition, living body recognition, route tracking or application to virtual reality (Virtual Reality, VR) or augmented reality (Augmented Reality) can be performed on the target object. Reality, AR) and other scenarios. Through the embodiments of the present disclosure, the depth information can be used to perform three-dimensional positioning of the target object, so as to realize various operations such as interaction with the target object. For example, in some possible implementations, the distance and angle between the target object and the smart air conditioner can be determined according to the position of the target object in three-dimensional space, so as to dynamically adjust the wind direction and/or wind speed of the smart air conditioner; in some possible In the implementation method, the target object can also be positioned in the game scene based on the position of the target object in the three-dimensional space in the AR game platform, so that the human-computer interaction in the AR scene can be realized more realistically and naturally.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Due to space limitations, this disclosure will not repeat them. Those skilled in the art can understand that, in the above method in the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.
此外,本公开还提供了深度检测装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种深度检测方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides depth detection devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any depth detection method provided by the present disclosure. For the corresponding technical solutions and descriptions, refer to the corresponding records in the method section ,No longer.
图4示出根据本公开实施例的深度检测装置的框图。如图4所示,装置20包括:FIG. 4 shows a block diagram of a depth detection device according to an embodiment of the present disclosure. As shown in Figure 4, device 20 includes:
获取模块21,用于获取多帧待检测帧,其中,多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧。The obtaining module 21 is configured to obtain multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of a target object from at least two collection angles of view.
关键点检测模块22,用于根据待检测帧进行目标对象中目标区域的关键点检测,确定与多帧待检测帧对应的多个关键点检测结果,其中,目标区域包括头部区域和/或肩部区域。The key point detection module 22 is used to perform key point detection of the target area in the target object according to the frame to be detected, and determine a plurality of key point detection results corresponding to multiple frames to be detected, wherein the target area includes the head area and/or shoulder area.
深度检测模块23,用于根据多个关键点检测结果,确定目标对象的深度信息。The depth detection module 23 is configured to determine the depth information of the target object according to the multiple key point detection results.
在一种可能的实现方式中,深度检测模块用于:获取至少两个采集设备分别对应的至少两个预设设备参数,至少两个采集设备用于从至少两个采集视角对目标对象进行图像采集;根据至少两个预设设备参数以及多个关键点检测结果,确定待检测帧中目标对象的深度信息。In a possible implementation manner, the depth detection module is configured to: acquire at least two preset device parameters respectively corresponding to at least two acquisition devices, the at least two acquisition devices are used to image the target object from at least two acquisition angles of view Acquisition: Determining the depth information of the target object in the frame to be detected according to at least two preset device parameters and a plurality of key point detection results.
在一种可能的实现方式中,深度信息包括深度距离,深度距离包括目标对象与采集设备的光心之间的距离;深度检测模块进一步用于:根据至少两个预设设备参数中的预设外部参数以及多个关键点检测结果在至少两个形式下的坐标,得到深度距离;其中,预设外部参数包括至少两个采集设备之间形成的相对参数。In a possible implementation manner, the depth information includes a depth distance, and the depth distance includes a distance between the target object and the optical center of the acquisition device; the depth detection module is further used for: according to the preset in at least two preset device parameters The external parameters and the coordinates of the multiple key point detection results in at least two forms obtain the depth distance; wherein, the preset external parameters include relative parameters formed between at least two acquisition devices.
在一种可能的实现方式中,深度信息包括偏移角度,偏移角度包括目标对象相对于采集设备的光轴的空间角度;深度检测模块进一步用于:根据至少两个预设设备参数中的预设内部参数以及多个关键点检测结果在至少两个形式下的坐标,得到偏移角度;其中,预设内部参数包括至少两个设备分别对应的设备参数。In a possible implementation manner, the depth information includes an offset angle, and the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device; the depth detection module is further configured to: according to at least two preset device parameters The preset internal parameters and the coordinates of the multiple key point detection results in at least two forms are used to obtain the offset angle; wherein the preset internal parameters include device parameters corresponding to at least two devices respectively.
在一种可能的实现方式中,关键点检测模块用于:根据目标对象在参考帧中的位置信息,对待检测帧中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果,其中,参考帧为待检测帧所属的目标视频中,位于待检测帧之前的视频帧。In a possible implementation, the key point detection module is used to: perform key point detection on the target area of the target object in the frame to be detected according to the position information of the target object in the reference frame, and obtain the key point corresponding to the frame to be detected The point detection result, wherein the reference frame is a video frame before the frame to be detected in the target video to which the frame to be detected belongs.
在一种可能的实现方式中,关键点检测模块进一步用于:根据参考帧中目标对象的第一位置,对待检测帧进行裁剪,得到裁剪结果;对裁剪结果中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果。In a possible implementation, the key point detection module is further used to: crop the frame to be detected according to the first position of the target object in the reference frame to obtain the cropping result; key the target area of the target object in the cropping result Point detection to obtain key point detection results corresponding to the frame to be detected.
在一种可能的实现方式中,关键点检测模块进一步用于:获取目标对象的目标区域在参考帧中的第二位置;根据第二位置,对待检测帧进行裁剪,得到裁剪结果;对裁剪结果中的目标对象的目标区域进行关键点检测,得到与待检测帧对应的关键点检测结果。In a possible implementation, the key point detection module is further used to: obtain the second position of the target area of the target object in the reference frame; according to the second position, the frame to be detected is cropped to obtain the cropping result; the cropping result The key point detection is performed on the target area of the target object in , and the key point detection result corresponding to the frame to be detected is obtained.
在一种可能的实现方式中,关键点检测模块进一步用于:通过第一神经网络对参考帧中的目标区域进行识别,得到第一神经网络输出的第二位置;和/或,根据参考帧对应的关键点检测结果,得到目标区域在参考帧中的第二位置。In a possible implementation, the key point detection module is further configured to: use the first neural network to identify the target area in the reference frame to obtain the second position output by the first neural network; and/or, according to the reference frame The corresponding key point detection result obtains the second position of the target area in the reference frame.
在一种可能的实现方式中,装置还用于:根据目标对象的深度信息,确定目标对象 在三维空间中的位置。In a possible implementation manner, the device is further configured to: determine the position of the target object in the three-dimensional space according to the depth information of the target object.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
应用场景示例Application Scenario Example
图5示出根据本公开一应用示例的示意图,如图5所示,本公开应用示例提出一种深度检测方法,可以包括如下过程:Fig. 5 shows a schematic diagram of an application example according to the present disclosure. As shown in Fig. 5, the application example of the present disclosure proposes a depth detection method, which may include the following process:
步骤S31,使用Faster RCNN神经网络,从双目相机(包括左相机和右相机)拍摄的两张待检测帧中分别进行人体的头肩框检测,得到左相机的第一帧中头肩框的位置,以及右相机的第一帧中头肩框的位置。Step S31, use the Faster RCNN neural network to detect the head and shoulders frame of the human body from the two frames to be detected taken by the binocular camera (including the left camera and the right camera), and obtain the head and shoulders frame in the first frame of the left camera. position, and the position of the head-and-shoulders box in the first frame of the right camera.
步骤S32,分别获取左相机和右相机各自对应的目标视频,从目标视频的第二帧开始,将该视频帧作为待检测帧,将待检测帧的上一帧作为参考帧,根据参考帧中头肩框的第二位置,通过关键点检测网络对待检测帧进行关键点检测,得到头部关键点、左肩关键点以及右肩关键点这三个关键点的位置坐标,并将该三个关键点的外接矩形作为待检测帧中的头肩框。Step S32, obtain the target video corresponding to the left camera and the right camera respectively, start from the second frame of the target video, use the video frame as the frame to be detected, and use the previous frame of the frame to be detected as the reference frame, according to the reference frame For the second position of the head and shoulders frame, the key point detection of the frame to be detected is carried out through the key point detection network, and the position coordinates of the three key points of the head key point, left shoulder key point and right shoulder key point are obtained, and the three key points The circumscribed rectangle of the point is used as the head and shoulders frame in the frame to be detected.
步骤S33,根据待检测帧中关键点在至少两个形式下的坐标,以及相机的内参矩阵,计算目标对象相对于相机的偏移角度:Step S33, according to the coordinates of the key points in the frame to be detected in at least two forms, and the internal reference matrix of the camera, calculate the offset angle of the target object relative to the camera:
其中,可以根据待检测帧中头部关键点的像素坐标(u,v,1)和相机的内参矩阵K,通过上述公开实施例中提到的公式(3)至(5),计算得到头部关键点对应的齐次形式的坐标(x/z,y/z,1),以及相对相机光轴的偏移角度θ x和θ yAmong them, according to the pixel coordinates (u, v, 1) of the key points of the head in the frame to be detected and the internal reference matrix K of the camera, the head The coordinates (x/z, y/z, 1) of the homogeneous form corresponding to the internal key points, and the offset angles θ x and θ y relative to the camera optical axis.
步骤S34,根据待检测帧中关键点在左相机和右相机中的齐次坐标,以及右相机相对于左相机的外参矩阵,计算目标对象的深度距离:Step S34, according to the homogeneous coordinates of the key points in the frame to be detected in the left camera and the right camera, and the extrinsic matrix of the right camera relative to the left camera, calculate the depth distance of the target object:
其中,可以根据同一个关键点分别在左、右相机中的齐次形式的坐标,以及右相机相对于左相机的外参矩阵R和T,通过上述公开实施例中提到的公式(1)和(2),计算目标对象的深度距离d。Wherein, according to the homogeneous form coordinates of the same key point in the left and right cameras respectively, and the extrinsic parameter matrices R and T of the right camera relative to the left camera, through the formula (1) mentioned in the above disclosed embodiments and (2), calculate the depth distance d of the target object.
在一个示例中,在通过步骤S33和步骤S34确定待检测帧中目标对象的深度信息以后,还可以将左相机和右相机分别对应的目标视频中,待检测帧的下一帧作为待检测帧,并回到步骤S32重新进行深度检测。In one example, after the depth information of the target object in the frame to be detected is determined through steps S33 and S34, the next frame of the frame to be detected in the target video corresponding to the left camera and the right camera can also be used as the frame to be detected , and return to step S32 to perform depth detection again.
通过本公开应用示例,可以利用人体的头肩框和头肩框中的关键点计算不同视角下采集的待检测帧所形成的视差,相对于基于图像匹配的视差估计方法来说,计算量更小,应用场景更广。Through the application example of this disclosure, the head and shoulders frame of the human body and the key points in the head and shoulders frame can be used to calculate the disparity formed by the frames to be detected collected under different viewing angles. Compared with the disparity estimation method based on image matching, the calculation amount is more Small size, wider application scenarios.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Due to space limitations, this disclosure will not repeat them.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质或易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor. The computer readable storage medium may be a non-volatile computer readable storage medium or a volatile computer readable storage medium.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的深度检测方法的指令。An embodiment of the present disclosure also provides a computer program product, including computer readable codes. When the computer readable codes run on the device, the processor in the device executes the method for implementing the depth detection method provided in any of the above embodiments. instruction.
本公开实施例还提供了另一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的深度检测方法的操作。The embodiments of the present disclosure also provide another computer program product, which is used for storing computer-readable instructions, and when the instructions are executed, the computer executes the operation of the depth detection method provided by any of the above-mentioned embodiments.
电子设备可以被提供为终端、服务器或其它形态的设备。Electronic devices may be provided as terminals, servers, or other forms of devices.
图6示出根据本公开实施例的电子设备的框图。如图6所示,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 6 , the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
参照图6,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。6, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the electronic device 800 . Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 . In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光 传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 . For example, the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, there is also provided a non-volatile computer-readable storage medium, such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
图7示出根据本公开实施例的电子设备的框图。如图7所示,电子设备1900可以被提供为一服务器。参照图7,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 7, the electronic device 1900 may be provided as a server. Referring to FIG. 7 , electronic device 1900 includes processing component 1922 , which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 . The electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix ), a free and open source Unix-like operating system (Linux ), an open source Unix-like operating system (FreeBSD ), or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure can be a system, method and/or computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或 外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect). In some embodiments, an electronic circuit, such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA), can be customized by utilizing state information of computer-readable program instructions, which can Various aspects of the present disclosure are implemented by executing computer readable program instructions.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. Wait.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择, 旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present disclosure above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.

Claims (13)

  1. 一种深度检测方法,其特征在于,包括:A deep detection method, characterized in that, comprising:
    获取多帧待检测帧,其中,所述多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧;Acquiring multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by collecting images of the target object from at least two acquisition angles of view;
    根据所述待检测帧进行所述目标对象中目标区域的关键点检测,确定与所述多帧待检测帧对应的多个关键点检测结果,其中,所述目标区域包括头部区域和/或肩部区域;Perform key point detection of a target area in the target object according to the frame to be detected, and determine a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area includes a head area and/or shoulder area;
    根据所述多个关键点检测结果,确定所述目标对象的深度信息。Determining depth information of the target object according to the multiple key point detection results.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述多个关键点检测结果,确定所述目标对象的深度信息,包括:The method according to claim 1, wherein the determining the depth information of the target object according to the multiple key point detection results comprises:
    获取至少两个采集设备分别对应的至少两个预设设备参数,所述至少两个采集设备用于从至少两个采集视角对所述目标对象进行图像采集;Acquire at least two preset device parameters respectively corresponding to at least two capture devices, the at least two capture devices are used to capture images of the target object from at least two capture angles of view;
    根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息。Determining depth information of the target object in the frame to be detected according to the at least two preset device parameters and the multiple key point detection results.
  3. 根据权利要求2所述的方法,其特征在于,所述深度信息包括深度距离,所述深度距离包括所述目标对象与采集设备的光心之间的距离;The method according to claim 2, wherein the depth information includes a depth distance, and the depth distance includes a distance between the target object and the optical center of the acquisition device;
    所述根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息,包括:The determining the depth information of the target object in the frame to be detected according to the at least two preset device parameters and the multiple key point detection results includes:
    根据所述至少两个预设设备参数中的预设外部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述深度距离;其中,所述预设外部参数包括所述至少两个采集设备之间形成的相对参数。According to the preset external parameters in the at least two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms, the depth distance is obtained; wherein the preset external parameters include the The relative parameters formed between the at least two acquisition devices.
  4. 根据权利要求2或3所述的方法,其特征在于,所述深度信息包括偏移角度,所述偏移角度包括所述目标对象相对于所述采集设备的光轴的空间角度;The method according to claim 2 or 3, wherein the depth information includes an offset angle, and the offset angle includes a spatial angle of the target object relative to the optical axis of the acquisition device;
    所述根据所述至少两个预设设备参数以及所述多个关键点检测结果,确定所述待检测帧中所述目标对象的深度信息,包括:The determining the depth information of the target object in the frame to be detected according to the at least two preset device parameters and the multiple key point detection results includes:
    根据所述至少两个预设设备参数中的预设内部参数以及所述多个关键点检测结果在至少两个形式下的坐标,得到所述偏移角度;其中,所述预设内部参数包括所述至少两个设备分别对应的设备参数。According to the preset internal parameters in the at least two preset device parameters and the coordinates of the plurality of key point detection results in at least two forms, the offset angle is obtained; wherein the preset internal parameters include Device parameters respectively corresponding to the at least two devices.
  5. 根据权利要求1至4中任意一项所述的方法,其特征在于,所述根据所述待检测帧进行所述目标对象中目标区域的关键点检测,包括:The method according to any one of claims 1 to 4, wherein the key point detection of the target area in the target object according to the frame to be detected comprises:
    根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,其中,所述参考帧为所述待检测帧所属的目标视频中,位于所述待检测帧之前的视频帧。According to the position information of the target object in the reference frame, perform key point detection on the target area of the target object in the frame to be detected, and obtain a key point detection result corresponding to the frame to be detected, wherein the The reference frame is a video frame before the frame to be detected in the target video to which the frame to be detected belongs.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述目标对象在参考帧中的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,包括:The method according to claim 5, characterized in that, according to the position information of the target object in the reference frame, the key point detection is performed on the target area of the target object in the frame to be detected to obtain the same as The key point detection result corresponding to the frame to be detected includes:
    根据所述参考帧中所述目标对象的第一位置,对所述待检测帧进行裁剪,得到裁剪结果;clipping the frame to be detected according to the first position of the target object in the reference frame to obtain a clipping result;
    对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。Key point detection is performed on the target area of the target object in the clipping result to obtain a key point detection result corresponding to the frame to be detected.
  7. 根据权利要求5或6所述的方法,其特征在于,所述根据所述目标对象在参考帧中 的位置信息,对所述待检测帧中的所述目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果,包括:The method according to claim 5 or 6, wherein the key point detection is performed on the target area of the target object in the frame to be detected according to the position information of the target object in the reference frame, Obtain the key point detection result corresponding to the frame to be detected, including:
    获取所述目标对象的目标区域在所述参考帧中的第二位置;Acquiring a second position of the target area of the target object in the reference frame;
    根据所述第二位置,对所述待检测帧进行裁剪,得到裁剪结果;clipping the frame to be detected according to the second position to obtain a clipping result;
    对所述裁剪结果中的目标对象的目标区域进行关键点检测,得到与所述待检测帧对应的关键点检测结果。Key point detection is performed on the target area of the target object in the clipping result to obtain a key point detection result corresponding to the frame to be detected.
  8. 根据权利要求7所述的方法,其特征在于,所述获取所述目标对象的目标区域在所述参考帧中的第二位置,包括:The method according to claim 7, wherein said obtaining the second position of the target area of the target object in the reference frame comprises:
    通过第一神经网络对所述参考帧中的目标区域进行识别,得到所述第一神经网络输出的第二位置;和/或,Using the first neural network to identify the target area in the reference frame to obtain a second position output by the first neural network; and/or,
    根据所述参考帧对应的关键点检测结果,得到所述目标区域在所述参考帧中的第二位置。Obtain a second position of the target area in the reference frame according to the key point detection result corresponding to the reference frame.
  9. 根据权利要求1至8中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, further comprising:
    根据所述目标对象的深度信息,确定所述目标对象在三维空间中的位置。According to the depth information of the target object, the position of the target object in the three-dimensional space is determined.
  10. 一种深度检测装置,其特征在于,包括:A depth detection device is characterized in that it comprises:
    获取模块,用于获取多帧待检测帧,其中,所述多帧待检测帧包括从至少两个采集视角对目标对象进行图像采集所得到的图像帧;An acquisition module, configured to acquire multiple frames to be detected, wherein the multiple frames to be detected include image frames obtained by acquiring images of the target object from at least two acquisition angles of view;
    关键点检测模块,用于根据所述待检测帧进行所述目标对象中目标区域的关键点检测,确定与所述多帧待检测帧对应的多个关键点检测结果,其中,所述目标区域包括头部区域和/或肩部区域;A key point detection module, configured to perform key point detection of the target area in the target object according to the frame to be detected, and determine a plurality of key point detection results corresponding to the multiple frames to be detected, wherein the target area Including the head area and/or shoulder area;
    深度检测模块,用于根据所述多个关键点检测结果,确定所述目标对象的深度信息。A depth detection module, configured to determine the depth information of the target object according to the multiple key point detection results.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至9中任意一项所述的方法。Wherein, the processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1-9.
  12. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至9中任意一项所述的方法。A computer-readable storage medium on which computer program instructions are stored, wherein the computer program instructions implement the method according to any one of claims 1 to 9 when executed by a processor.
  13. 一种计算机程序产品,其特征在于,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至9中任意一项所述的方法。A computer program product, characterized by comprising computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes to implement any one of claims 1 to 9 method described in the item.
PCT/CN2022/085920 2021-06-28 2022-04-08 Depth measurement method and apparatus, electronic device, and storage medium WO2023273499A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110721270.1A CN113345000A (en) 2021-06-28 2021-06-28 Depth detection method and device, electronic equipment and storage medium
CN202110721270.1 2021-06-28

Publications (1)

Publication Number Publication Date
WO2023273499A1 true WO2023273499A1 (en) 2023-01-05

Family

ID=77479236

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085920 WO2023273499A1 (en) 2021-06-28 2022-04-08 Depth measurement method and apparatus, electronic device, and storage medium

Country Status (3)

Country Link
CN (1) CN113345000A (en)
TW (1) TW202301276A (en)
WO (1) WO2023273499A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113344999A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium
CN113345000A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108764091A (en) * 2018-05-18 2018-11-06 北京市商汤科技开发有限公司 Biopsy method and device, electronic equipment and storage medium
CN108876835A (en) * 2018-03-28 2018-11-23 北京旷视科技有限公司 Depth information detection method, device and system and storage medium
US10319154B1 (en) * 2018-07-20 2019-06-11 The University Of North Carolina At Chapel Hill Methods, systems, and computer readable media for dynamic vision correction for in-focus viewing of real and virtual objects
CN110942032A (en) * 2019-11-27 2020-03-31 深圳市商汤科技有限公司 Living body detection method and device, and storage medium
CN113345000A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium
CN113344999A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897675B (en) * 2017-01-24 2021-08-17 上海交通大学 Face living body detection method combining binocular vision depth characteristic and apparent characteristic
CN111222509B (en) * 2020-01-17 2023-08-18 北京字节跳动网络技术有限公司 Target detection method and device and electronic equipment
CN111780673B (en) * 2020-06-17 2022-05-31 杭州海康威视数字技术股份有限公司 Distance measurement method, device and equipment
CN112419388A (en) * 2020-11-24 2021-02-26 深圳市商汤科技有限公司 Depth detection method and device, electronic equipment and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108876835A (en) * 2018-03-28 2018-11-23 北京旷视科技有限公司 Depth information detection method, device and system and storage medium
CN108764091A (en) * 2018-05-18 2018-11-06 北京市商汤科技开发有限公司 Biopsy method and device, electronic equipment and storage medium
US10319154B1 (en) * 2018-07-20 2019-06-11 The University Of North Carolina At Chapel Hill Methods, systems, and computer readable media for dynamic vision correction for in-focus viewing of real and virtual objects
CN110942032A (en) * 2019-11-27 2020-03-31 深圳市商汤科技有限公司 Living body detection method and device, and storage medium
CN113345000A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium
CN113344999A (en) * 2021-06-28 2021-09-03 北京市商汤科技开发有限公司 Depth detection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113345000A (en) 2021-09-03
TW202301276A (en) 2023-01-01

Similar Documents

Publication Publication Date Title
WO2023273499A1 (en) Depth measurement method and apparatus, electronic device, and storage medium
WO2017215224A1 (en) Fingerprint input prompting method and apparatus
US20210158560A1 (en) Method and device for obtaining localization information and storage medium
WO2023273498A1 (en) Depth detection method and apparatus, electronic device, and storage medium
CN112991553B (en) Information display method and device, electronic equipment and storage medium
WO2023155532A1 (en) Pose detection method, apparatus, electronic device, and storage medium
WO2022193466A1 (en) Image processing method and apparatus, and electronic device and storage medium
WO2022134475A1 (en) Point cloud map construction method and apparatus, electronic device, storage medium and program
WO2022121577A1 (en) Image processing method and apparatus
WO2023051356A1 (en) Virtual object display method and apparatus, and electronic device and storage medium
WO2022151686A1 (en) Scene image display method and apparatus, device, storage medium, program and product
WO2022017140A1 (en) Target detection method and apparatus, electronic device, and storage medium
US20200402321A1 (en) Method, electronic device and storage medium for image generation
CN112184787A (en) Image registration method and device, electronic equipment and storage medium
TW202211671A (en) An information processing method, electronic equipment, storage medium and program
KR20220123218A (en) Target positioning method, apparatus, electronic device, storage medium and program
CN111860388A (en) Image processing method and device, electronic equipment and storage medium
CN110930351A (en) Light spot detection method and device and electronic equipment
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
US20170302908A1 (en) Method and apparatus for user interaction for virtual measurement using a depth camera system
CN112613447A (en) Key point detection method and device, electronic equipment and storage medium
WO2023155350A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
WO2022151687A1 (en) Group photo image generation method and apparatus, device, storage medium, computer program, and product
WO2022110801A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN114266305A (en) Object identification method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831330

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE