Light spot search method device, computer readable medium and electronic device

By using historical depth reference images to determine the search area and performing spot search in the TOF camera, the problem of large computational load of spot search in the existing technology is solved and faster spot positioning is achieved.

CN114862828BActive Publication Date: 2024-08-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210600750.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2024-08-23
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

Existing TOF cameras have a large amount of calculation during the spot search process, resulting in slow speed and difficulty in meeting real-time needs.

Method used

By obtaining the historical depth reference image corresponding to the current light intensity image collected by the speckle TOF camera, the search area is determined, and the spot search is performed within this area to reduce the number of pixels and reduce the amount of calculation.

Benefits of technology

Significantly improves the speed of spot search, reduces time consumption, and improves the efficiency of spot search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862828B
    Figure CN114862828B
Patent Text Reader

Abstract

The present disclosure provides a spot search method, a spot search device, a computer-readable medium and an electronic device, and relates to the field of distance measurement technology. The method comprises: obtaining a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera; determining a search area on the current light intensity image based on the historical depth reference image, and performing a spot search within the search area. The present disclosure obtains a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera, determines a search area on the current light intensity image, and performs a spot search within the search area. Compared with performing a pixel-by-pixel spot search on the current light intensity image, determining the search area in advance and performing a search within the search area can reduce the amount of calculation for the spot search, increase the speed of the spot search, and thus reduce the time consumption of the spot search.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the field of 3D vision, the more mature distance measurement solutions currently include binocular distance measurement, structured light distance measurement and time of flight (TOF) camera distance measurement. Among them, TOF cameras are widely used in distance measurement scenarios of mobile phones, AR and other devices because of their wide measurement range, high measurement accuracy, simple depth calculation method, and good adaptability to measurement scenes.

[0003] As an active optical depth distance detection device, the TOF camera includes a transmitter, a collimator, a receiving lens and a receiver. Figure 1 As shown in the figure, when performing distance detection, the transmitter actively emits debugged infrared light. After the infrared light passes through the collimator, it is reflected by the object in the ranging scene, and then received by the receiving lens and the receiving end. The distance between the camera and the object to be measured is determined by calculating the time difference or phase relationship between the receiving end and the transmitter, and then the depth image corresponding to the ranging scene is generated. According to the different infrared light emitted by the transmitter, TOF cameras can be divided into flood light TOF cameras and speckle TOF cameras.

[0004] Among them, the infrared light emitted by the transmitting end of the speckle TOF camera is a bunch of light beams. After being reflected by the objects in the ranging scene, the receiving end receives the light spot and light spot intensity corresponding to the light beam. At this time, it is necessary to perform a light spot search on the received light intensity image to determine the position of the light spot corresponding to each light beam. In related technologies, in order to determine the light spot position corresponding to each light beam, it is usually necessary to search the entire light intensity image pixel by pixel, which requires a large amount of calculation. Summary of the invention

[0005] The purpose of the present disclosure is to provide a light spot search method, a light spot search device, a computer-readable medium and an electronic device, thereby reducing the calculation amount of the light spot search at least to a certain extent and improving the speed of the light spot search.

[0006] According to a first aspect of the present disclosure, a light spot search method is provided, which is applied to a terminal device, wherein the terminal device includes a speckle TOF camera, and comprises: acquiring a historical depth reference image corresponding to a current light intensity image acquired by the speckle TOF camera; determining a search area on the current light intensity image based on the historical depth reference image, and performing a light spot search within the search area; wherein the number of pixels included in the search area is less than the number of pixels included in the current light intensity image.

[0007] According to a second aspect of the present disclosure, there is provided a light spot search device, which is applied to a terminal device, wherein the terminal device includes a speckle TOF camera, and comprises: a reference acquisition module, which is used to acquire a historical depth reference image corresponding to a current light intensity image acquired by the speckle TOF camera; a light spot search module, which is used to determine a search area on the current light intensity image based on the historical depth reference image, and perform a light spot search within the search area; wherein the number of pixels included in the search area is less than the number of pixels included in the current light intensity image.

[0008] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; and a memory for storing one or more programs, which enables the one or more processors to implement the above method when the one or more programs are executed by the one or more processors.

[0010] A spot search method provided by an embodiment of the present disclosure obtains a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera, determines a search area on the current light intensity image, and performs a spot search within the search area. Compared with performing a pixel-by-pixel spot search on the current light intensity image, determining the search area in advance and searching within the search area can reduce the amount of calculation for the spot search, increase the speed of the spot search, and thereby reduce the time consumption of the spot search.

[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0013] Figure 1 A schematic diagram schematically illustrates the imaging principle of a speckle TOF camera in an exemplary embodiment of the present disclosure;

[0014] Figure 2 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;

[0015] Figure 3 A flowchart schematically illustrates a light spot search method in an exemplary embodiment of the present disclosure;

[0016] Figure 4 A flowchart schematically illustrates a method for determining a first search area in an exemplary embodiment of the present disclosure;

[0017] Figure 5 A schematic diagram schematically illustrates the principle of a spot position deviation in a speckle TOF camera in an exemplary embodiment of the present disclosure;

[0018] Figure 6 A schematic diagram schematically shows a light spot position shifting downward in an exemplary embodiment of the present disclosure;

[0019] Figure 7 A flowchart schematically illustrates a method for determining a first offset in an exemplary embodiment of the present disclosure;

[0020] Figure 8 A flowchart schematically illustrates a method for determining a second search area in an exemplary embodiment of the present disclosure;

[0021] Fig. 9 A flowchart schematically illustrates another method for determining a second search area in an exemplary embodiment of the present disclosure;

[0022] Fig.10 A schematic diagram schematically showing the relationship between the distance between an object and a speckle TOF camera and the number of pixel offsets in an exemplary embodiment of the present disclosure;

[0023] Fig.11 A flowchart schematically illustrates a method for determining a third search area in an exemplary embodiment of the present disclosure;

[0024] Fig.12 A flowchart schematically illustrates another method for determining a third search area in an exemplary embodiment of the present disclosure;

[0025] Fig.13 A flowchart schematically illustrates a method for determining a fourth search area in an exemplary embodiment of the present disclosure;

[0026] Fig.14 A flowchart schematically illustrates a method for performing a supplementary search in an exemplary embodiment of the present disclosure;

[0027] Fig.15 A schematic diagram schematically shows the composition of a light spot search device in an exemplary embodiment of the present disclosure;

[0028] Fig.16 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0030] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0031] Figure 2 A schematic diagram of a system architecture of an exemplary application environment in which a light spot search method and device according to an embodiment of the present disclosure can be applied is shown.

[0032] like Figure 2 As shown, the system architecture 200 may include one or more of terminal devices 201, 202, 203, a network 204, and a server 205. The network 204 is used to provide a medium for communication links between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 201, 202, 203 may be terminal devices equipped with a speckle TOF camera, including but not limited to desktop computers, portable computers, smart phones, tablet computers, AR devices, etc. It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 205 may be a server cluster composed of multiple servers.

[0033] The light spot search method provided in the embodiment of the present disclosure is generally executed by the terminal devices 201, 202, and 203, and accordingly, the light spot search device is generally set in the terminal devices 201, 202, and 203. However, it is easy for those skilled in the art to understand that the light spot search method provided in the embodiment of the present disclosure can also be executed by the server 205, and accordingly, the light spot search device can also be set in the server 205, which is not particularly limited in this exemplary embodiment. For example, in an exemplary embodiment, the server 205 can obtain the historical depth reference image and the current light intensity image corresponding to the current light intensity image collected by the speckle TOF camera configured by the terminal devices 201, 202, and 203 through the network 204, and then determine the search area on the current light intensity image based on the historical depth reference image, and perform light spot search in the search area, and then feed back the search results to the terminal devices 201, 202, and 203 through the network 204.

[0034] In an exemplary embodiment, this exemplary embodiment provides a light spot search method, referring to Figure 3 As shown, the light spot search method may include the following steps S310 and S320:

[0035] In step S310, a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera is obtained.

[0036] Among them, the speckle TOF camera refers to a TOF camera in which the infrared light emitted by the transmitting end is not flood light (surface light), but a number of beams.

[0037] The historical depth reference image may include an image used to characterize the depth features of the scene collected by each light spot in a certain time interval in history of the speckle TOF camera. Specifically, when the speckle TOF camera generates a depth image, only the area illuminated by the light spot will have a valid depth value, and the depth values ​​of the remaining areas are invalid (that is, the depth of the dark area). Even if the depth value appears in the remaining area, it is usually a noise point (of course, each light spot may hit several pixels at the same time, but after algorithm processing, these pixels usually only generate one depth value, that is, one light spot only generates a depth value corresponding to one pixel). Therefore, the depth value corresponding to each reference light spot in the historical depth reference image can characterize the depth features of the scene collected by the reference light spot in the speckle TOF camera within a certain time interval in history.

[0038] For example, the historical depth reference image may include a frame of historical depth image before the current depth image corresponding to the current light intensity image; for another example, the historical depth reference image may include a historical depth image whose acquisition time is before the current depth image and the acquisition time is separated from the acquisition time of the current depth image by a certain time; for another example, the historical depth reference image may include an image determined based on multiple frames of historical depth images before the depth image corresponding to the current light intensity image, and used to characterize the scene depth features corresponding to the multiple frames of historical depth images.

[0039] In an exemplary embodiment, when acquiring a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera, at least one frame of historical depth image acquired by the speckle TOF camera may be acquired first, and then a corresponding historical depth reference image may be generated based on the at least one frame of historical depth image.

[0040] Among them, the historical depth image may include a depth image determined based on historical light intensity images collected historically; relative to the current light intensity image, the historical acquisition time of the historical light intensity image corresponding to the historical depth image is before the current acquisition time of the current light intensity image.

[0041] Furthermore, in order to ensure real-time performance, that is, to ensure that the scene depth features represented by the historical depth reference image have a reference effect on the light spot position in the current light intensity image, a historical depth image closer to the current moment can be collected as a basis for determining the generation of the historical depth reference image. Specifically, the historical collection time can be limited to a time whose interval with the current collection time is less than a preset time interval.

[0042] In addition, when generating depth values, the weaker the intensity of the infrared light received by the receiving end of the TOF camera, the worse the credibility of the calculated depth value is usually. Within a certain light intensity range (without overexposure), the stronger the intensity of the received infrared light, the stronger the credibility of the calculated depth value. Therefore, when generating a depth image, you can also obtain the intensity of the infrared light corresponding to the calculated depth value, that is, you can also generate a confidence image corresponding to the depth image. At this time, you can generate a historical depth reference image in combination with the confidence image.

[0043] In an exemplary embodiment, only one frame of historical depth image may be acquired, and then the frame of historical depth image may be directly used as the historical depth reference image. For example, the previous frame of historical depth image acquired by the TOF camera may be directly acquired as the historical depth reference image, or any frame of the first N frames of historical depth image acquired by the TOF camera may be acquired as the historical depth reference image.

[0044] In an exemplary embodiment, multiple frames of historical depth images may be collected, and then historical depth reference images corresponding to the multiple frames of historical depth images may be generated based on a preset calculation method. For example, the previous frame and the previous previous frame of historical depth images collected by the TOF camera may be collected first, and then the two frames of historical depth images may be compared, the depth reference values ​​corresponding to pixels with consistent depths may be retained, and the depth values ​​corresponding to pixels with inconsistent depths may be averaged to obtain the historical depth reference image; for another example, for pixels with inconsistent depths, the depth values ​​with higher confidence may be retained as the depth reference values ​​corresponding to the pixels with inconsistent depths; for another example, for pixels with inconsistent depths, the depth values ​​may be weighted with confidence as weights to obtain the corresponding depth reference values. In addition, when generating historical depth reference images corresponding to multiple frames of historical depth images based on a preset calculation method, the frequency of occurrence of depth values ​​generated by the same light spot may be counted, and the depth reference values ​​corresponding to each light spot may be determined based on the frequency. In addition, when generating a corresponding historical depth reference image based on multiple frames of historical depth images, time domain filtering processing can also be performed to filter the original images (raw images) corresponding to the multiple frames of historical depth images to obtain the historical depth value with random interference noise removed, so as to generate a more accurate historical depth reference image.

[0045] It should be noted that, in order to ensure that the scene depth features represented by the historical depth reference image have a reference effect on the spot position in the current light intensity image, each time the current light intensity image is acquired, it is necessary to acquire the corresponding historical depth reference image for the current light intensity image. Specifically, the historical depth reference image corresponding to the current light intensity image can be reacquired based on the above-mentioned method of acquiring the historical depth reference image. For example, when taking multiple frames of historical depth images to determine the historical depth reference image, assuming that the depth image generated by the current light intensity image is the 6th frame, the historical depth images of the 1st to 5th frames can be acquired to determine the historical depth reference image; then when the depth image generated by the current light intensity image is the 7th frame, the historical depth images of the 2nd to 6th frames can be acquired to determine the historical reference depth image; for another example, when acquiring a frame of historical depth image to determine the historical depth reference image, assuming that the depth image generated by the current light intensity image is the 6th frame, the historical depth image of the 5th frame can be acquired as the historical depth reference image; then when the depth image generated by the current light intensity image is the 7th frame, the historical depth image of the 6th frame can be directly acquired as the historical depth reference image.

[0046] Furthermore, in order to reduce the amount of calculation for obtaining the historical depth reference image, the historical depth reference image corresponding to the current light intensity image can be directly generated based on the historical depth reference image of the previous frame and the depth image corresponding to the previous light intensity image. As in the above example, when taking multiple frames of historical depth images to determine the historical depth reference image, assuming that the depth image generated by the current light intensity image is the 6th frame, the historical depth images of the 1st to 5th frames can be obtained to determine the historical depth reference image; then when the depth image generated by the current light intensity image is the 7th frame, since the historical depth reference image corresponding to the 6th frame depth image already contains the depth information of the 1st to 5th frames, the 6th frame depth image can be used as a newly added historical depth image, and directly combined with the historical depth reference image corresponding to the 6th frame depth image to directly generate the historical depth reference image corresponding to the current light intensity image.

[0047] It should be noted that the historical depth reference image corresponding to the current light intensity image is generated directly based on the historical depth reference image of the previous frame and the depth image corresponding to the previous frame of light intensity image. Any generation method can be used to calculate the historical depth reference image of the previous frame and the depth image corresponding to the previous frame of light intensity image, and the present disclosure does not make any special restrictions on this. However, in order to ensure real-time performance, the depth image corresponding to the previous frame of light intensity image can be made to have a greater impact on the historical depth reference image corresponding to the current light intensity image during calculation. For example, in one calculation method, the historical depth reference image of the previous frame and the depth image corresponding to the previous frame of light intensity image can be weighted averaged; at this time, the weight corresponding to the depth image corresponding to the previous frame of light intensity image can be set to a larger value to ensure that the scene depth information that is closer to the current light intensity image of this frame can be retained to a greater extent in the historical depth reference image corresponding to the current light intensity image of this frame.

[0048] In step S320, a search area is determined on the current light intensity image based on the historical depth reference image, and a light spot search is performed within the search area.

[0049] Among them, the number of pixels contained in the search area determined on the current light intensity image based on the historical depth reference image is smaller than the number of pixels contained in the current light intensity image. That is, a smaller search range can be determined based on the historical depth reference image, thereby reducing the calculation amount of the spot search and improving the speed of the spot search.

[0050] In an exemplary embodiment, when determining the search area on the current light intensity image based on the historical depth reference image, the search area can be determined according to the first position template and the preset offset function. Figure 4 As shown, it may include steps S410 to S430:

[0051] In step S410, a first position template and a preset offset function are obtained.

[0052] The first position template includes at least one first spot position acquired at a first acquisition distance, that is, when the scene distance is the first acquisition distance, the position of at least one spot of the speckle TOF camera in the light intensity image can usually be represented by pixel coordinates.

[0053] Reference Figure 5 As shown in the figure, after a certain speckle TOF camera is designed, due to the fixed base distance between the transmitting end and the receiving end of the speckle TOF camera, the field of view will be offset, that is, after the emitted infrared beam is reflected by object 1 and object 2 at different distances from the speckle TOF camera, the coordinates received by the active area of ​​the sensor will change, and the corresponding spot position will be offset to varying degrees. For example, in a certain speckle TOF camera, if Figure 5 When the distances between object 1 and object 2 and the speckle TOF camera are d1 and d2 respectively, the position of the spot A formed by the same beam will shift downward significantly (refer to Figure 6 Therefore, when collecting the first position template, the second position template, and the third position template, the light spot position corresponding to the depth image generated when the distance of all objects in the scene is a certain distance (the first acquisition distance, the second acquisition distance, or the third acquisition distance) can be used as a position template, and the template contains the position coordinates of each light spot on the depth image at the corresponding acquisition distance.

[0054] It should be noted that, in some embodiments, each pixel on the historical depth image corresponds to each pixel on the confidence image. That is, the pixel position of the historical depth value generated by a certain light spot on the historical depth image is consistent with the pixel position on the corresponding confidence image. At this time, when the historical depth reference image is generated in combination with the confidence image, the confidence corresponding to each depth value can be directly obtained through the pixel position. At this time, the actual light spot position may be consistent with the light spot position shown in the historical depth image.

[0055] In other embodiments, a light spot may be represented by more than one pixel on the confidence image. For example, a light spot may cause all 9 pixels on the confidence image to be illuminated. At this time, the 9 pixels on the confidence image have confidence, but when generating the historical depth image, only one depth value is solved by the light spot, that is, the depth value needs to be assigned to a certain pixel on the depth map. At this time, one assigned pixel can be determined among the 9 pixels, and the depth value can be assigned to the pixel corresponding to the assigned pixel on the depth image. For example, the assigned pixel can be the pixel with the highest confidence among the 9 pixels, or it can be the pixel corresponding to the brightness center of gravity position of the light spot. At this time, the actual light spot position may be slightly different from the light spot position shown in the historical depth image. In this case, the method used to obtain the first position template, the second position template, and the third position template should be consistent with the method of obtaining the historical depth reference image. For example, when determining the historical depth reference image, the assigned pixel is the pixel with the highest confidence among the 9 pixels. Correspondingly, when obtaining the position template, the assigned pixel should also be the pixel with the highest confidence among the 9 pixels.

[0056] Among them, the preset offset function may include a function for characterizing the relationship between the distance (depth) between the object and the speckle TOF camera in the scene and the position offset of the spot position. It should be noted that the position offset is a relative quantity, so it is necessary to use a fixed spot position as a reference. The fixed spot position can be the position of each spot when the distance between the object and the speckle TOF camera is a fixed distance. When obtaining the preset offset function, it can be determined in different ways, and the present disclosure does not make special restrictions on this. For example, a theoretical calculation can be performed based on the fixed base distance between the transmitting end and the receiving end of the speckle TOF camera; for another example, calibration can be performed by experimental method.

[0057] Specifically, when performing theoretical calculations based on a fixed base distance, it can be known from theoretical analysis that the position offset (including the offset direction and offset distance) is related to factors such as the distance between the speckle TOF camera and the object, the fixed base distance between the transmitter and the receiver, and the focal length of the receiver lens, and obeys an inverse proportional function relationship. After a speckle TOF camera is designed, the fixed base distance between the transmitter and the receiver and the focal length of the receiver lens are usually fixed, so the position offset is a function with the distance between the speckle TOF camera and the object as the independent variable. At this time, the following formula can be obtained:

[0058]

[0059] Among them, f rrepresents the focal length of the receiving end lens; B represents the fixed base distance between the transmitting end and the receiving end; d3 represents the distance between the speckle TOF camera and a certain plane 3; d represents the distance between the speckle TOF camera and the object; Δ represents the position offset of the spot position corresponding to the object relative to the spot position corresponding to the plane 3, including the offset direction and offset distance. The offset distance can usually be expressed by the number of offset pixels.

[0060] Specifically, when calibrating by experimental method, the speckle TOF camera can be used to shoot objects at different distances (theoretically, only 2 distances are needed for fitting, but for the accuracy of fitting, multiple groups, such as 5 groups or more, can be selected; generally speaking, the position offset caused by the same distance difference is larger at close distances than at long distances, so when selecting different distances, more close distances can be selected) to obtain depth images corresponding to different distances, and count the position offset in the depth images at different distances. Then, position tracking is performed for a certain spot, a spot in a certain area, or a plurality of randomly selected spots to fit the functional relationship between the position offset and the distance between the speckle TOF camera and the object.

[0061] It should be noted that when calibrating by experimental method, the objects at different distances are usually large planes with a certain flatness, which can approximately meet the diffuse reflection model, and the reflectivity must be greater than the set emissivity threshold to ensure that the collected depth data is accurate and reliable. Then, the corresponding depth image is obtained by moving the position of the speckle TOF camera or the position of the large plane, and shooting. When shooting, it is necessary to ensure that the speckle TOF camera is facing the plane, that is, the imaging surface of the receiving end sensor is completely parallel to the large plane, or the angle between the imaging surface and the large plane is less than the angle threshold, and ensure that the deviation between the actual shooting distance and the distance used for calibration is less than the distance threshold. The angle threshold and the distance threshold can be determined based on experience and the performance of the speckle TOF camera itself.

[0062] At the same time, at the same distance, one or more frames of images can be collected for calibration. When collecting multiple frames of images for calibration, the original images (raw images) corresponding to the multiple frames of depth images can be filtered by time domain filtering to obtain the depth value after removing random interference noise.

[0063] In addition, when a light spot is selected for position tracking, the confidence level corresponding to the depth value solved by the light spot can be used to determine whether the position offset corresponding to the light spot is accurate. For example, a confidence threshold can be set. When the confidence level of the light spot is higher than the confidence threshold, the position offset calculated based on the light spot is considered to be credible. If the confidence level of the light spot is lower than the confidence threshold at a certain distance, it is necessary to calibrate by increasing the infrared transmission power, increasing the integration time of the receiving end, or replacing a plane with a higher reflectivity. Compared with the method of obtaining the preset offset function by theoretical calculation, the preset offset function obtained by calibration by experimental method can cover more errors and is more in line with the actual situation.

[0064] In step S420, a first offset corresponding to each first light spot position in the first position template is calculated based on the historical depth reference image and a preset offset function.

[0065] In an exemplary embodiment, the depth value corresponding to each reference light spot in the historical depth reference image can represent the depth characteristics of the scene captured by the reference light spot in the speckle TOF camera within a certain time interval in history, so the position offset relative to the first acquisition distance can be calculated based on the historical depth reference value and the preset offset function.

[0066] Specifically, when calculating the first offset, refer to Figure 7 As shown, the following steps S710 and S720 may be included:

[0067] In step S710, the depth value corresponding to each reference light spot in the historical depth reference image is obtained, and the first light spot position corresponding to each reference light spot is determined in the first position template.

[0068] Specifically, the number of infrared light beams emitted by the speckle TOF camera is fixed, and a light spot will be generated when the receiving end receives a beam of reflected light. Therefore, each reference light spot corresponding to the historical depth reference image corresponds to the first light spot position in the first position template. For example, if the speckle TOF camera emits 9 light beams, a total of 9 reference light spots for generating the historical reference depth image are generated, and the first position template includes the first light spot positions corresponding to the 9 light spots. The reference light spot generated by the same light beam corresponds to the determined first light spot position. Therefore, the first light spot position corresponding to each reference light spot can be determined in the first position template based on the mutual correspondence.

[0069] In step S720, the position offset corresponding to each reference light spot is calculated according to a preset offset function and a depth value, and the position offset is determined as a first offset corresponding to a first light spot position corresponding to the reference light spot.

[0070] In an exemplary embodiment, when the depth value corresponding to each reference light spot is obtained, the position offset relative to the first light spot position corresponding to each reference light spot can be calculated according to the first acquisition distance and the preset offset function, and then the position offset is determined as the first offset corresponding to the first light spot position corresponding to each reference light spot. It should be noted that since the position offset calculated by the preset offset function is a relative amount, the position offset that needs to be calculated at this time is the position offset relative to the first light spot position. Therefore, during the calculation, the fixed light spot position used for reference in the preset offset function can be the first light spot position, that is, the fixed light spot position can be the light spot position when the distance of all objects in the scene is the first acquisition distance.

[0071] In step S430, each first light spot position is shifted according to the first shift amount, and a first search area corresponding to the shifted first light spot position is determined on the current light intensity image.

[0072] In an exemplary embodiment, after obtaining the first offset corresponding to each light spot in the first position template, the first light spot position corresponding to each light spot can be offset to obtain the offset position, and then the first search area corresponding to the offset first light spot position is determined on the current light intensity image.

[0073] Specifically, the first light spot position can be represented by pixel coordinates, and the offset distance of the first offset pair can be represented by the number of offset pixels, so the first light spot position after offset can also be represented by pixel coordinates. Therefore, when determining the first search area corresponding to the first light spot position after offset on the current light intensity image, the pixel coordinates corresponding to the first light spot position after offset can be directly found on the current light intensity image, and then the first search area on the current light intensity image is determined based on the pixel coordinates.

[0074] In an exemplary embodiment, when determining the first search area, the pixel coordinates corresponding to the offset first light spot position and the preset strategy can be used to determine the first search area. The preset strategy includes any pre-set strategy for determining an area based on a pixel coordinate. For example, the preset strategy may include a strategy for determining an area of ​​3*3 pixels or 5*5 pixels around a certain pixel as the center. At this time, the pixel coordinates corresponding to the first light spot position can be used as the center, and the area of ​​3*3 pixels or 5*5 pixels around it can be used as the first search area.

[0075] In some scenes, it is inevitable that the receiving end may not be able to receive the light spots corresponding to some light beams. At this time, these light beams cannot generate effective and reliable depth values, that is, in the historical depth reference image, these reference light spots have no corresponding depth values. Therefore, it is impossible to calculate the first offset corresponding to the first light spot position corresponding to these reference light spots, that is, only the area corresponding to the first light spot position before the offset can be determined. At this time, two situations may occur: the current scene is similar to the historical scene, and the light spot search is based on the first light spot position before the offset. At this time, the searched light spot is likely to be wrong; the current scene is very different from the historical scene, and the light spot search is based on the first light spot position before the offset. The accuracy of the searched light spot is unknown. In particular, when the position offset of a certain light spot is greater than or equal to the distance between the two light spots, two or more light spots may be searched in a small area. According to theoretical analysis and actual tests, this situation is likely to occur when the distance between the object and the speckle TOF camera is small, but the background distance of the scene where the object is located is large. That is, when the distance between the object and the speckle TOF camera is small, the solution of calculating the first offset through the historical depth reference image and the preset offset function may fail.

[0076] Furthermore, before calculating the first offset corresponding to each first spot position in the first position template based on the historical depth reference image and the preset offset function, the historical depth reference image may be judged first to avoid the above problem when the distance between the object and the speckle TOF camera is small. Figure 8 As shown, it may include steps S810 to S830:

[0077] In step S810, the depth values ​​corresponding to the reference light spots in the historical depth reference image are counted to determine the proportion of target light spots whose depth values ​​are less than a depth threshold.

[0078] In an exemplary embodiment, the depth values ​​corresponding to each reference light spot in the historical depth reference image may be first counted to determine the ratio of target light spots whose depth values ​​are less than the depth threshold to all light spots. For example, assuming that there are 10 light spots in total, 7 of which correspond to target light spots with depth values ​​less than the depth threshold, the light spot ratio is 70%. The depth threshold is a value set based on experience. In different application scenarios, the depth threshold may be set differently, and the present disclosure does not specifically limit this.

[0079] In step S820, when the light spot ratio is greater than the ratio threshold, a second search area corresponding to the target light spot is determined on the current light intensity image.

[0080] In an exemplary embodiment, when the spot ratio is greater than the ratio threshold, it may indicate that within a certain time interval in history, a large proportion of close-range objects exist in the scene captured by the speckle TOF camera, that is, the solution of calculating the first offset using the historical depth reference image and the preset offset function may fail.

[0081] In an exemplary embodiment, when determining the second search area corresponding to the target light spot on the current light intensity image, referring to Fig. 9 As shown, it may include steps S910 to S930:

[0082] In step S910, the adjacent light spots corresponding to each target light spot are obtained, and the second offset corresponding to the target light spot is calculated based on a preset offset function and the depth values ​​corresponding to the adjacent light spots.

[0083] In an exemplary embodiment, when the distance between two light spots is close and can represent the depth of the same object, the depth value corresponding to the adjacent light spot can be estimated as the depth value corresponding to the target light spot. At this time, for each target light spot, the adjacent light spot corresponding to the target light spot can be obtained first, and then based on the depth value, the second offset corresponding to the target light spot is calculated by a preset offset function.

[0084] In step S920, the first target light spot position corresponding to each target light spot is determined in the first position template.

[0085] In an exemplary embodiment, since the reference light spot generated by the same light beam and the determined first light spot position correspond to each other, the first target light spot position corresponding to each target light spot can be determined in the first position template according to the mutual correspondence.

[0086] In step S930, the first target light spot position corresponding to each target light spot is offset according to the second offset, and a second search area corresponding to the offset first target light spot position is determined on the current light intensity image.

[0087] The process of offsetting the first target light spot position corresponding to each target light spot by the second offset and determining the second search area corresponding to the offset first target light spot position on the current light intensity image is similar to the process of offsetting each first light spot position by the first offset and determining the first search area corresponding to the offset first light spot position on the current light intensity image in step S430. Details not disclosed can be found in the implementation method of this part and will not be repeated here.

[0088] It should be noted that, since the second offset is still a position offset relative to the first light spot position, when calculating the second offset, the fixed light spot position used for reference in the preset offset function may also be the first light spot position, that is, the fixed light spot position may be the light spot position when the distances of all objects in the scene are the first acquisition distance.

[0089] However, the method of estimating the depth value corresponding to the adjacent light spot as the depth value corresponding to the target light spot has limitations. That is, when there are a large number of invalid light spots, estimating the depth value corresponding to the adjacent light spot as the depth value corresponding to the target light spot can easily cause distortion. At the same time, even for adjacent light spots, it is difficult to ensure that the two light spots are reflected by objects at the same distance.

[0090] In order to avoid the above limitations, in an exemplary embodiment, when the light spot ratio is greater than the ratio threshold, the entire current light intensity image can be directly used as the second search area to perform pixel-by-pixel light spot search.

[0091] Furthermore, if the entire current light intensity image is directly used as the second search area for spot search, there is still a large amount of calculation. Therefore, an invalid area where a large number of invalid light spots are located can be first determined in the historical depth reference image, and then the area corresponding to the invalid area can be determined on the current light intensity image as the second search area, and the second search area can be searched pixel by pixel to find the pixel points that meet the light spot characteristics. Compared with searching the entire current light intensity image pixel by pixel, searching only the area corresponding to the invalid area pixel by pixel can still reduce some of the calculation.

[0092] In step S830, when the spot ratio is less than or equal to the ratio threshold, a first offset corresponding to each first spot position in the first position template is calculated based on the historical depth reference image and a preset offset function.

[0093] In an exemplary embodiment, when the spot ratio is less than or equal to the ratio threshold, it can be explained that within a certain time interval in history, there are close-range objects of a small proportion in the scene captured by the speckle TOF camera, that is, the solution of calculating the first offset using the historical depth reference image and the preset offset function will not fail. At this time, the first offset corresponding to each first spot position in the first position template can be calculated based on the historical depth reference image and the preset offset function, and then the first search area can be determined to perform spot search.

[0094] Within the working range of the speckle TOF camera, the relationship between the distance between the object and the speckle TOF camera and the number of pixel offsets is not a linear relationship, such as Fig.10As shown in the figure, the position offset caused by the same distance difference is larger at a close distance than at a long distance. For example, for a certain speckle TOF camera, the distance between the object and the speckle TOF camera changes by the same value A. When the distance between the object and the speckle TOF camera is close, the position offset of the light spot may be more than a dozen pixels; while when the distance between the object and the speckle TOF camera is far, the position offset of the light spot may be only two or three pixels. At this time, in order to determine the offset more accurately, the light spot positions collected at multiple distances can be selected as templates to determine the search area.

[0095] Specifically, refer to Fig.11 As shown, determining the search area on the current light intensity image based on the historical depth reference image may include steps S1110 to S1140:

[0096] In step S1110 , a location template set is obtained.

[0097] The position template set includes a plurality of second position templates, each second position template corresponds to a different second acquisition distance, and each second position template includes at least one second spot position acquired at the second acquisition distance corresponding to the second position template. That is, each second position template is the position of at least one spot of the speckle camera in the light intensity image when the scene distance is the corresponding second acquisition distance, which can usually be represented by pixel coordinates.

[0098] In some embodiments, a uniformly distributed second acquisition distance may also be determined within the range of the speckle TOF camera to acquire the corresponding second position template, which is not particularly limited in the present disclosure.

[0099] It should be noted that, in order to determine the offset more accurately, the second acquisition distance corresponding to the second position template can be set according to the different ranges of the distance between the object and the speckle TOF camera. Specifically, for a certain speckle TOF camera, the distance between the object and the speckle TOF camera changes by the same value A. When the distance between the object and the speckle TOF camera is far, the position offset of the light spot may be only two or three pixels. At this time, a smaller number of second acquisition distances can be set to ensure that the second light spot position can cover the range of the light spot offset to a greater extent. Therefore, by setting different preset strategies, a larger or smaller area can be determined for search, and there is no need to add more second acquisition distances to add more second position templates; when the distance between the object and the speckle TOF camera is close, the position offset of the light spot may be more than a dozen pixels, which varies greatly. At this time, a larger number of second acquisition distances need to be set to ensure that the second light spot position can cover the range of the light spot offset to a greater extent. Therefore, it is necessary to add more second acquisition distances to add more second position templates. By setting different numbers of second position templates in different distance ranges, more templates can be set within the range where the position offset changes sharply to more accurately determine the position offset.

[0100] In step S1120, the depth value corresponding to each reference light spot in the historical depth reference image is obtained, and the target second position template corresponding to each reference light spot is determined in the position template set based on the depth value.

[0101] In an exemplary embodiment, the target second position template corresponding to each reference light spot in the historical depth reference image can be determined in the position template set for the depth value corresponding to each reference light spot. For example, if the depth value corresponding to a reference light spot B in the historical depth reference image is 1.035m, the second position template with a second acquisition distance of 1.035m can be selected as the target second position template corresponding to reference light spot 1.

[0102] It should be noted that, in some embodiments, there may not be a second position template whose second acquisition distance is exactly the same as the depth value corresponding to the reference light spot. In this case, the second position template corresponding to the second acquisition distance with the smallest difference in depth value can be selected as the target second position template. For example, the depth value corresponding to a reference light spot 1 in the historical depth reference image is 1.035m, and there are only second position templates with second acquisition distances of 1m and 1.5m in the position template set, then the second position template with a second acquisition distance of 1m is selected as the template second position template.

[0103] In step S1130, the second target light spot position corresponding to each reference light spot is determined in the target second position template corresponding to each reference light spot.

[0104] In an exemplary embodiment, after determining the target second position templates corresponding to each reference light spot, it is also necessary to determine the second target light spot position corresponding to a certain reference light spot in the target second position template corresponding to the reference light spot.

[0105] Specifically, since the reference light spot generated by the same light beam corresponds to the determined first light spot position, the second target light spot position corresponding to each reference light spot can be determined in the target second position template according to the mutual correspondence. Specifically, the depth value corresponding to a reference light spot 1 in the historical depth reference image is 1.035m. After selecting the second position template with a second acquisition distance of 1.035m as the target second position template corresponding to the reference light spot 1, the position of the light beam d that generates the reference light spot 1 on the target second position template can be used as the second target light spot position.

[0106] In step S1140, a third search area corresponding to the second target light spot position is determined on the current light intensity image.

[0107] The process of determining the third search area corresponding to the second target spot position on the current light intensity image is similar to the process of determining the first search area corresponding to the offset first spot position on the current light intensity image in step S430. For details not disclosed, please refer to the implementation method of this part, and will not be repeated here.

[0108] In addition, in some embodiments, for a reference light spot, multiple second position templates can be selected as target second position templates, and then the second target light spot position corresponding to the reference light spot is determined in each target second position template, and then the third search area corresponding to each second target light spot position is determined on the current light intensity image and searched. After the search, the second target light spot position with the highest confidence or the one that best matches the light spot characteristics can be selected as the position where the light beam corresponding to the reference light spot is projected on the current light intensity image, that is, the light spot position formed by the light beam on the current light intensity image is the second target light spot position with the highest confidence or the one that best matches the light spot characteristics. The present disclosure does not specifically limit the method of selecting the second target light spot position from multiple second target light spot positions.

[0109] For example, if the depth value corresponding to a reference light spot 1 in the historical depth reference image is 1.035m, the second position templates with second acquisition distances of 0.9m, 1.0m and 1.5m can be selected as the target second position templates at the same time, and then the second target light spot position corresponding to the reference light spot 1 is determined in the three target second position templates to obtain three second target light spot positions. According to the three second target light spot positions, three third search areas are determined on the current light intensity image, and light spot searches are performed respectively. After the light spot search, a position that best meets the light spot characteristics can be selected as the projection position of the light beam corresponding to the reference light spot 1 on the current light intensity image.

[0110] Furthermore, in an exemplary embodiment, when there are multiple templates, the number of templates can be reduced in combination with a preset offset function. Specifically, the second acquisition distance corresponding to the second position template can be set to be sparsely distributed in the entire ranging range of the speckle TOF camera. At this time, the third search area corresponding to the second target spot position is determined on the current light intensity image, and the third search area corresponding to the second target spot position is determined by referring to Fig.12 As shown, the following steps S1210 and S1220 may be included:

[0111] In step S1210, a preset offset function is obtained, and a third offset corresponding to the second target spot position is calculated according to the preset offset function and the depth value corresponding to each reference spot.

[0112] In an exemplary embodiment, after the second target light spot position is obtained, a third offset corresponding to the second target light spot position determined by the reference light spot may be calculated based on a preset offset function and a depth value corresponding to the reference light spot.

[0113] It should be noted that, since the third offset is a position offset relative to the second target spot position, when calculating the third offset, the fixed spot position used for reference in the preset offset function may also be the second target spot position, that is, the fixed spot position may be the spot position when the distances of all objects in the scene are the corresponding second acquisition distance. The corresponding second acquisition distance refers to the second acquisition distance corresponding to the target second position template where the second target spot position is located.

[0114] In step S1220, each second target light spot position is offset according to the third offset, and a third search area corresponding to the offset second target light spot position is determined on the current light intensity image.

[0115] In an exemplary embodiment, after obtaining the third offset, the corresponding second target light spot position may be offset according to the third offset, and a third search area corresponding to the offset second target light spot position may be determined on the current light intensity image to perform a light spot search. It should be noted that the process of determining the third search area corresponding to the offset second target light spot position on the current light intensity image is similar to the process of determining the first search area corresponding to the offset first light spot position on the current light intensity image in step S430. The undisclosed details may be referred to the implementation contents of this part, and thus will not be described in detail.

[0116] In addition, when multiple templates are selected as the target second position templates, the above calculation and offset based on the preset offset function can be performed for each target second position template, and the third search area corresponding to each second target light spot position can be determined on the current light intensity image. After the light spot search, the second target light spot position with the highest confidence or the most consistent with the light spot characteristics can be selected as the position where the light beam corresponding to the reference light spot is projected on the current light intensity image.

[0117] By setting a plurality of second position templates in the position template set, the calculation amount of the spot search of the speckle TOF camera can be reduced by increasing the storage space occupied by the templates in the speckle TOF camera; in addition, since the plurality of templates can maximize the degree of possible offset positions of the covered spots, the searched spots are more accurate and reliable compared with a single template.

[0118] In an exemplary embodiment, when determining the search area on the current light intensity image based on the historical depth reference image, the search area can also be determined directly based on the historical depth reference image. Fig.13 As shown, it may include step S1310 and step S1320:

[0119] In step S1310, the reference light spot position corresponding to each reference light spot is determined according to the historical depth reference image.

[0120] In an exemplary embodiment, after obtaining the historical reference depth image, the reference spot position corresponding to each reference spot in the historical depth reference image can be directly determined. Specifically, when the speckle TOF camera generates a depth image, only the area illuminated by the spot can generate a depth value, so in the historical depth reference image, the position with a depth value is the reference spot position corresponding to the reference spot.

[0121] In step S1320, a fourth search area corresponding to the reference light spot position is determined on the current light intensity image.

[0122] In an exemplary embodiment, after the reference light spot position is determined, a fourth search area corresponding to the reference light spot position may be determined on the current light intensity image. It should be noted that the process of determining the fourth search area corresponding to the reference light spot position on the current light intensity image is similar to the process of determining the first search area corresponding to the offset first light spot position on the current light intensity image in step S430. The undisclosed details may be referred to the implementation contents of this part, and thus will not be described in detail.

[0123] Furthermore, in an exemplary embodiment, due to reasons such as the object being at an extremely long distance or the object having a low reflectivity, some light spots may not be able to generate depth values ​​in the historical depth reference image, or the generated depth values ​​may be invalid. Therefore, a supplementary search may be performed based on a template. Specifically, refer to Fig.14 As shown, it may include step S1410 and step S1420:

[0124] In step S1410, a third position template is obtained.

[0125] The third position template includes at least one third spot position acquired at a third acquisition distance, that is, when the scene distance is the third acquisition distance, the position of at least one spot of the speckle TOF camera in the light intensity image can usually be represented by pixel coordinates.

[0126] In step S1420, a supplementary search is performed on the current light intensity image according to the positions of the reference light spots and the third light spot.

[0127] In an exemplary embodiment, after performing a spot search on the fourth search area determined based on the historical depth reference image, some spots may not generate depth values ​​in the historical depth reference image, or the generated depth values ​​are invalid, due to reasons such as the object being at an extremely long distance or the object having a low reflectivity, and therefore the fourth search area may not be able to search for spots generated corresponding to all light beams emitted by the speckle TOF camera. At this point, a supplementary search may be performed on the current light intensity image based on the reference spot and the third spot position.

[0128] In an exemplary embodiment, a portion of the light spot positions can be determined based on the reference light spot in the historical depth reference image, so the third light spot positions corresponding to the light spots that do not generate depth values ​​can be determined first, and then a supplementary search can be performed for these light spots. Specifically, the third target light spot position corresponding to the reference light spot that can be obtained through the historical depth reference image can be determined in the third position template first; then the third light spot position excluding the third target light spot position in the third position template is used as the third remaining light spot position, and then the supplementary search area corresponding to the third remaining light spot position is determined on the current light intensity image, and a supplementary search of the light spot is performed in the supplementary search area.

[0129] For example, assuming that a speckle TOF camera emits a total of 9 beams of infrared light, theoretically there will be 9 valid depth values ​​in the historical depth reference image, and the third spot positions corresponding to the 9 spots will be included in the third position template. However, due to the fact that the distance between some objects in the scene and the speckle TOF camera is too far, or the reflectivity of some objects is too low, there are only 6 spots in the historical depth reference image. At this time, based on the one-to-one correspondence between the beam and the spot, the third target spot positions corresponding to the 6 spots can be determined in the third position template, and then the remaining 3 third spot positions in the third position template are determined as the third remaining spot positions, and then the supplementary search area is determined based on the third remaining spot position and a supplementary search is performed.

[0130] The mechanical energy spot search is performed by first searching the fourth search area determined based on the historical depth reference image and then performing a supplementary search based on the third position template. Compared with the solution of directly searching based on the position template, some computational complexity can be saved. This is suitable for scenes with high frame rates, high real-time requirements, and fewer ultra-long-distance or low-reflectivity objects, or scenes with small changes in the distant view distance of objects.

[0131] In an exemplary embodiment, when performing a spot search on a search area, the spot position can be determined by directly searching for the maximum value of the light intensity in the search area, or the spot position can be determined based on whether the maximum value of the light intensity and the light intensity distribution around the maximum value conform to the Gaussian function law, and the present disclosure does not make any special restrictions on this. Among them, the search area for the actual spot search can be determined according to the actual scheme adopted, for example, it can be the first search area, the second search area, the third search area, the fourth search area, the supplementary search area, or the fourth search area and the supplementary search area, and the present disclosure does not make any special restrictions on this.

[0132] It should be noted that, since the above-mentioned spot search process is implemented based on the historical depth reference image, when the speckle TOF camera is just turned on, the historical depth reference image is missing; or when the first frame after the camera is turned on is a close-up scene, not only is the historical depth reference image missing, but the spot position is also far from the spot position shown in the template. At this time, it is very likely that the spot cannot be found, resulting in the inability to resolve the depth. Therefore, when the speckle TOF camera is just turned on, the light intensity image of the preset frame number can be searched pixel by pixel to obtain a certain amount of historical data, and then the spot search can be performed by obtaining the historical depth reference image.

[0133] In addition, in the solution of spot search based on the position template set including multiple second position templates, in addition to first performing pixel-by-pixel spot search on the light intensity image of a preset number of frames to obtain a certain amount of historical data, historical data can also be obtained by traversing the spot positions shown by multiple second position templates when the speckle TOF camera is just turned on. Specifically, the spot positions shown by multiple second position templates can be traversed, and for a certain spot, the spot position that best meets the spot characteristics on the possible offset path of the spot can be searched as the search result.

[0134] In an exemplary embodiment, the first position template, the second position template, and the third position template may be obtained in a variety of ways, such as being directly determined by theoretical calculation, being directly collected by a speckle TOF camera, being calculated based on a preset offset function and data collected by the speckle TOF camera, etc., and the present disclosure does not make any special restrictions on this. Among them, in different embodiments, the collection distances corresponding to the first position template, the second position template, and the third position template may be set voluntarily, and the present disclosure does not make any special restrictions on the setting of the collection distances.

[0135] Specifically, when determining through theoretical calculation, calculation and software simulation can be performed directly based on the design parameters of the speckle TOF camera to obtain the theoretical position distribution of the light spot on the receiving end sensor, and then determine the position of the light spot on the light intensity image, that is, the position template. It should be noted that in order to make the position template more consistent with the situation of the real speckle TOF camera, the tolerance in the assembly process can be considered when performing theoretical calculations, that is, the data of the joint internal and external calibration can be included to include possible errors such as offset, tilt, rotation, etc. in the assembly process.

[0136] Specifically, a large plane can be photographed at a fixed distance by a speckle TOF camera to obtain a corresponding depth image, and then the spot position, that is, the spot position on the light intensity image, can be determined based on the depth image. It should be noted that when shooting based on a speckle TOF camera, the imaging surface of the speckle TOF camera needs to be kept parallel to the photographed large plane.

[0137] In addition, in theory, the above fixed distance can be any distance within the range of the speckle TOF camera, but in practical applications, a better value can be selected based on the spot offset corresponding to the speckle TOF camera. Specifically, if the position offset of the spot is small when the distance between the object and the speckle TOF camera changes by 1 unit within the range of the speckle TOF camera, the middle distance within the range can be selected through theoretical calculation, so that the position offset of the spot is relatively balanced before and after the distance when the distance changes per unit.

[0138] For example, when a speckle TOF camera is at a fixed distance of 10cm, the coordinate position of a spot is (1,1), when it is at a fixed distance of 10m, the coordinate position of the spot is (1,100), and when it is at a fixed distance of 1m, the coordinate position of the spot is (1,50). Then it is more appropriate to collect the template at a fixed distance of 1m. This is because the absolute distance of the spot offset backward or forward is similar, which is conducive to the spot search of the subsequent algorithm. In addition, in some applications, the template can also be collected directly at 10m or 10cm, but this will reduce the efficiency to a certain extent.

[0139] The above-mentioned method of shooting at a fixed distance by a speckle TOF camera only requires collecting a template once before leaving the factory. At present, it is necessary to keep the physical structure of the speckle TOF camera and the working environment and other influencing factors without major changes during subsequent use to prevent the template from failing. Among them, the influencing factors such as the physical structure and the working environment may include the base distance of the speckle TOF camera, the position of the lens, the temperature difference between the working temperature and the temperature when collecting the template within a certain range (for example, collecting the template at a temperature of -50°C but working in an environment of 56°C, that is, the temperature difference is too large), etc., and may also include other influencing factors, which are not specifically limited in the present disclosure.

[0140] Furthermore, based on the above-mentioned shooting at a fixed distance by the speckle TOF camera, the template can also be determined by calculation using a preset offset function. Specifically, in scenarios where the field of view of the speckle TOF camera is relatively large, or a large plane required for shooting cannot be provided, a depth image of any distance can be obtained first, and the spot position can be determined based on the depth image. Then, the obtained spot position is offset calculated using a preset offset function to determine the spot position at a specific distance as a template. The specific distance can be a distance that makes the position offset of the spot relatively balanced before and after the distance per unit distance change.

[0141] In addition, in some embodiments, the template can be adaptively acquired during the application of the speckle TOF camera. Specifically, a specific distance at which the template needs to be acquired is set in the speckle TOF camera. When the user uses the speckle TOF camera for ranging, if the depth value corresponding to a certain light spot is equal to a specific distance, and the confidence corresponding to the depth value is greater than the confidence threshold, the depth value can be considered to be credible, and the pixel coordinates corresponding to the light spot at this time are recorded as the position of the light spot at the specific distance, that is, the spot position corresponding to the light spot in the position template. In this way, the spot position corresponding to each light spot is continuously acquired during the user's use, and a complete template is adaptively generated.

[0142] It should be noted that before a complete template is generated, it is necessary to first search multiple frames of light intensity images pixel by pixel to determine the position of the light spot and generate a complete template; in addition, during use, it is very likely that the depth value corresponding to the light spot cannot be exactly equal to the specific distance. Therefore, by setting the first distance deviation, when the depth value is within the range of the specific distance ± the first distance deviation, it can be approximately considered that the depth value corresponding to a certain light spot is equal to the specific distance, and then the template is collected.

[0143] In addition, after collecting the spot position corresponding to a certain spot at a specific distance, the spot position can be continuously optimized based on the subsequent use process. Specifically, during the user's use, if the depth value corresponding to a certain spot is equal to a specific distance, and the confidence corresponding to the depth value is greater than the confidence threshold, the spot position of the spot can be updated based on the confidence corresponding to the depth value.

[0144] For example, if the confidence of the depth value obtained this time is not much different from the confidence of the previous record, within the range of the confidence of the previous record ± the preset confidence deviation, the spot position of the light spot at this time can be recorded, and the new spot position can be obtained by averaging the position recorded previously; if the confidence of the depth value obtained this time is much smaller than the confidence of the previous record, the spot position of the light spot at this time is considered to be unreliable compared with the previous time, and no record is made; if the confidence of the depth value obtained this time is much larger than the confidence of the previous record, but it has not reached the overexposure situation (for example, the confidence of the depth value obtained this time is 1.5 times that of the previous time, instead of 10 times), then the pixel coordinates recorded last time can be replaced, or the spot positions corresponding to the two light spots can be recorded at the same time, and the number and probability of the light spot appearing at each light spot position can be continuously recorded during the user's use. When searching for light spots in the future, the light spot positions with higher frequency or higher probability of light spots can be searched first, or each light spot position can be searched, and then the light spot corresponding to the light spot position that best meets the light spot characteristics is selected as the search result.

[0145] Through this adaptive way of acquiring templates, templates can be adaptively generated as users use them, and the templates can be continuously updated during subsequent use, so that the templates are more in line with the user's usage preferences.

[0146] It should be supplemented that, when acquiring multiple second position templates in the position template set, each second position template may be acquired in any of the above-mentioned multiple ways, and the present disclosure does not specifically limit this.

[0147] In an exemplary embodiment, after obtaining the position templates including the first position template, the second position template and the third position template through the above method, the position templates may be updated based on subsequent use by the user. Specifically, the spot position of each spot in the position template may be updated based on influencing factors such as confidence and the frequency of occurrence of the spot at each position in the position template.

[0148] For example, a record table can be established for a certain position template to characterize the reliability of the spot position of each spot in the template. For example, a position template is established when the distance between the object and the speckle TOF camera is 1.5m. During user use, when the depth value corresponding to a certain spot is 1.5m, the actual position of the spot at this time (which may have a certain deviation from the template position), the confidence and reflectivity corresponding to the spot at this time will be recorded, and based on the number of times the spot appears at the actual position, the confidence and reflectivity corresponding to the spot are used as the reliability of the spot appearing at the actual position. The next time the position template is used for spot search, the position with higher reliability can be preferentially selected in the position template to determine the search area for spot search.

[0149] It should be noted that, similar to the adaptive acquisition template method, during use, it is very likely that the depth value corresponding to the spot cannot be exactly equal to the acquisition distance corresponding to the position template. Therefore, by setting the second distance deviation, when the depth value is within the range of the acquisition distance ± the second distance deviation, it can be approximately considered that the depth value corresponding to a certain spot is equal to the acquisition distance, and then the corresponding record is made. Among them, the value of the second distance deviation can be determined according to the specific parameters and usage scenarios of the speckle TOF camera.

[0150] In addition, for a position template set containing multiple second position templates, the position template set can also be updated, that is, the second position template can be automatically increased or decreased. For example, if over a period of time, there is a large deviation between the actual position searched by a large proportion of light spots and the position shown in the position template, it can be explained that the second position template included in the current position template set may not be suitable for the current ranging scene, so a new template can be established. For example, if the proportion of pixels with a depth value of d4 in a certain depth image obtained is greater than a preset proportion threshold, a new second position template can be established with the second acquisition distance of d4. Of course, in subsequent use, the new second position template can also be continuously updated.

[0151] Furthermore, the method of obtaining the position template by self-use can be combined with the above-mentioned method of updating the position template. It is not necessary to extract and establish the template, but to establish a complete template during the user's use, and continuously update the adaptively established template. For example, one or more position templates can be established based on the depth values ​​that appear more frequently according to the current usage scenario, and a corresponding reliability table can be established. As the ranging scene of the speckle TOF camera continues to change, the position template is adaptively reduced, increased, or updated. Of course, before establishing a position template with higher reliability, it is necessary to perform a pixel-by-pixel spot search on multiple frames of light intensity images until a complete and highly reliable position template is obtained.

[0152] In the process of establishing the location template, in order to obtain a location template with higher reliability, a reliability condition can also be set for the location template, that is, when the location template meets the reliability condition, it is confirmed that the reliability of the location template is high and can be directly used in the subsequent use process. Specifically, the reliability condition can be set differently according to different ranging scenarios.

[0153] For example, the reliability condition may include that the ratio of the number of effective light spots among the light spots searched based on the current position template to the theoretical number of light spots or the number of light spots searched pixel by pixel is greater than a set value; for another example, the reliability condition may include that the ratio of the light spot positions shown by the established position template to the theoretical number of light spots is greater than a set value; for another example, the reliability condition may include that the reliability corresponding to each light spot in the position template is higher than a set value, etc., and the present disclosure does not make any special limitations on this.

[0154] By continuously updating the position template in the above manner, the template has the functions of learning and memory. As the use time increases, the spot search speed and accuracy of the speckle TOF camera will be improved.

[0155] In addition, when performing a spot search, the position template may not be suitable for certain ranging scenarios. In this case, the search based on the position template may miss many spots, or may search for more erroneous spots. Therefore, before using the position template, the adaptability of the position template can be verified. Therefore, an adaptability condition can be set for the position template, that is, when the position template meets the adaptability condition, the adaptability of the position template is confirmed. When the position template meets the adaptability condition, the position template is continued to be used for spot search; when the position template does not meet the adaptability condition, the adaptability of the position template can be further judged by other methods that do not use the position template for spot search.

[0156] For example, the adaptability condition may include that when the ratio of the number of light spots searched based on the position template to the theoretical number of light spots is less than a certain set value, it is determined that the position template does not meet the adaptability condition. At this time, the current light intensity image or the next frame of the light intensity image can be searched pixel by pixel. If the result of the pixel-by-pixel search is similar to the search result based on the position template, it means that some light spots cannot be searched due to the scene itself, such as exceeding the ranging range of the speckle TOF camera; if the result of the pixel-by-pixel search is significantly different from the search result based on the position template, it means that the position template is suitable for the current ranging scene. At this time, it may be necessary to use the pixel-by-pixel search method for the current ranging scene, or update and learn the position template until the position template meets the adaptability condition, and then use the position template again for the light spot search.

[0157] By making an adaptive judgment on the position template in the above manner, it is equivalent to adding a protection mechanism for the search results based on the position template. Even if an error occurs in the spot search method based on the position template, the search result can be corrected based on a pixel-by-pixel search method or other methods that do not require a position template, which will not affect the normal operation of the speckle TOF camera.

[0158] In summary, in this exemplary embodiment, a spot search method for a speckle TOF camera is proposed. Through the historical depth reference image and the obtained different position templates, a search area containing a smaller number of pixels than the current light intensity image is determined on the current light intensity image. Compared with the method of performing pixel-by-pixel spot search on the current light intensity image, the amount of calculation can be greatly reduced.

[0159] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0160] For further reference, Fig.15 As shown, in an exemplary embodiment of the present disclosure, a light spot search device 1500 is provided, comprising a reference acquisition module 1510 and a light spot search module 1520. Among them:

[0161] The reference acquisition module 1510 may be used to acquire a historical depth reference image corresponding to a current light intensity image acquired by a speckle TOF camera.

[0162] The light spot search module 1520 can be used to determine a search area on the current light intensity image based on the historical depth reference image, and perform a light spot search within the search area; wherein the number of pixels included in the search area is smaller than the number of pixels included in the current light intensity image.

[0163] In an exemplary embodiment, the light spot search module 1520 can be used to obtain a first position template and a preset offset function; wherein the first position template includes at least one first light spot position collected at a first collection distance; based on a historical depth reference image and a preset offset function, a first offset corresponding to each first light spot position in the first position template is calculated; each first light spot position is offset according to the first offset, and a first search area corresponding to the offset first light spot position is determined on the current light intensity image.

[0164] In an exemplary embodiment, the spot search module 1520 can be used to obtain the depth value corresponding to each reference spot in the historical depth reference image, and determine the first spot position corresponding to each reference spot in the first position template; calculate the position offset corresponding to each reference spot according to a preset offset function and the depth value, and determine the position offset as the first offset corresponding to the first spot position corresponding to the reference spot.

[0165] In an exemplary embodiment, the spot search module 1520 can be used to count the depth values ​​corresponding to each reference spot in the historical depth reference image, and determine the spot ratio of the target spot whose depth value is less than the depth threshold; when the spot ratio is greater than the ratio threshold, determine the second search area corresponding to the target spot on the current light intensity image; when the spot ratio is less than or equal to the ratio threshold, calculate the first offset corresponding to each first spot position in the first position template based on the historical depth reference image and the preset offset function.

[0166] In an exemplary embodiment, the light spot search module 1520 can be used to obtain adjacent light spots corresponding to each target light spot, and calculate a second offset corresponding to the target light spot based on a preset offset function and a depth value corresponding to the adjacent light spot; determine a first target light spot position corresponding to each target light spot in a first position template; offset the first target light spot position corresponding to each target light spot according to the second offset, and determine a second search area corresponding to the offset first target light spot position on the current light intensity image.

[0167] In an exemplary embodiment, the spot search module 1520 can be used to obtain a position template set; wherein the position template set includes multiple second position templates, each second position template corresponds to a different second acquisition distance, and each second position template includes at least one second spot position acquired at the second acquisition distance corresponding to the second position template; obtain the depth value corresponding to each reference spot in the historical depth reference image, and determine the target second position template corresponding to each reference spot in the position template set based on the depth value; determine the second target spot position corresponding to each reference spot in the target second position template corresponding to each reference spot; and determine the third search area corresponding to the second target spot position on the current light intensity image.

[0168] In an exemplary embodiment, the light spot search module 1520 can be used to obtain a preset offset function, and calculate a third offset corresponding to the second target light spot position based on the preset offset function and the depth value corresponding to each reference light spot; offset each second target light spot position according to the third offset, and determine a third search area corresponding to the second target light spot position after the offset on the current light intensity image.

[0169] In an exemplary embodiment, the light spot search module 1520 may be used to determine the reference light spot position corresponding to each reference light spot according to the historical depth reference image; and determine a fourth search area corresponding to the reference light spot position on the current light intensity image.

[0170] In an exemplary embodiment, the light spot search module 1520 can be used to obtain a third position template; wherein the third position template includes at least one third light spot position collected at a third collection distance; and a supplementary search is performed on the current light intensity image based on each reference light spot and the third light spot position.

[0171] In an exemplary embodiment, the light spot search module 1520 can be used to determine the third target light spot position corresponding to each reference light spot in the third position template; obtain the third remaining light spot position excluding the third target light spot position in the third position template; determine the supplementary search area corresponding to the third remaining light spot position on the current light intensity image, and perform a light spot search in the supplementary search area.

[0172] In an exemplary embodiment, the reference acquisition module 1510 can be used to acquire at least one frame of historical depth image acquired by a speckle TOF camera; wherein the historical acquisition time of the historical light intensity image corresponding to the historical depth image is before the current acquisition time of the current light intensity image; and generate a corresponding historical depth reference image based on the at least one frame of historical depth image.

[0173] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0174] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0175] In an exemplary embodiment of the present disclosure, an electronic device for implementing the light spot search method is also provided, which may be Figure 1The terminal device 101, 102, 103 or the server 105 in the embodiment. The electronic device at least comprises a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the light spot search method by executing the executable instructions.

[0176] Below Fig.16 Taking the mobile terminal 1600 in the example, the structure of the electronic device in the embodiment of the present disclosure is exemplarily described. It should be understood by those skilled in the art that in addition to the components specifically used for mobile purposes, Fig.16 The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 1600 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation on the mobile terminal 1600. In other embodiments, the mobile terminal 1600 may also adopt the same Fig.16 Different interface connection methods, or a combination of multiple interface connection methods.

[0177] like Fig.16 As shown, the mobile terminal 1600 may specifically include: a processor 1610, an internal memory 1621, an external memory interface 1622, a Universal Serial Bus (USB) interface 1630, a charging management module 1640, a power management module 1641, a battery 1642, an antenna 1, an antenna 2, a mobile communication module 1650, a wireless communication module 1660, an audio module 1670, a speaker 1671, a receiver 1672, a microphone 1673, an earphone interface 1674, a sensor module 1680, a display screen 1690, a camera module 1691, an indicator 1692, a motor 1693, a button 1694, and a subscriber identification module (SIM) card interface 1695, etc. The sensor module 1680 may include a depth sensor 16801, a pressure sensor 16802, a gyroscope sensor 16803, etc.

[0178] The processor 1610 may include one or more processing units, for example, the processor 1610 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0179] The processor 1610 is provided with a memory. The memory can store instructions for implementing six modular functions: detection instructions, connection instructions, information management instructions, analysis instructions, data transmission instructions, and notification instructions, and the execution is controlled by the processor 1610.

[0180] The wireless communication function of the mobile terminal 1600 can be implemented through antenna 1, antenna 2, mobile communication module 1650, wireless communication module 1660, modulation and demodulation processor and baseband processor. Among them, antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals; mobile communication module 1650 can provide solutions for wireless communication including 16G / 3G / 4G / 5G applied on mobile terminal 1600; modulation and demodulation processor can include modulator and demodulator; wireless communication module 1660 can provide solutions for wireless communication including wireless local area network (Wireless Local Area Networks, WLAN) (such as Wireless Fidelity (Wireless Fidelity, Wi-Fi) network), Bluetooth (Bluetooth, BT) and the like applied on mobile terminal 1600. In some embodiments, antenna 1 of mobile terminal 1600 is coupled with mobile communication module 1650, and antenna 2 is coupled with wireless communication module 1660, so that mobile terminal 1600 can communicate with the network and other devices through wireless communication technology.

[0181] The mobile terminal 1600 implements the display function through a GPU, a display screen 1690, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 1690 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1610 may include one or more GPUs, which execute program instructions to generate or change display information.

[0182] The mobile terminal 1600 can realize the shooting function through the ISP, the camera module 1691, the video codec, the GPU, the display screen 1690 and the application processor. Among them, the ISP is used to process the data fed back by the camera module 1691; the camera module 1691 is used to capture static images or videos; the digital signal processor is used to process digital signals, and in addition to processing digital image signals, it can also process other digital signals; the video codec is used to compress or decompress digital videos, and the mobile terminal 1600 can also support one or more video codecs. In some embodiments, the process of acquiring historical depth images can be realized through the speckle TOF camera module, and the process of spot search can be realized in combination with the ISP.

[0183] The external memory interface 1622 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile terminal 1600. The external memory card communicates with the processor 1610 through the external memory interface 1622 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0184] The internal memory 1621 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 1621 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile terminal 1600 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 1621 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal Flash Storage, UFS), etc. The processor 1610 executes various functional applications and data processing of the mobile terminal 1600 by running instructions stored in the internal memory 1621 and / or instructions stored in a memory provided in the processor.

[0185] The mobile terminal 1600 can implement audio functions such as music playing and recording through the audio module 1670 , the speaker 1671 , the receiver 1672 , the microphone 1673 , the earphone interface 1674 , and the application processor.

[0186] The depth sensor 16801 is used to obtain the depth information of the scene. The pressure sensor 168016 is used to sense the pressure signal and convert the pressure signal into an electrical signal. The gyroscope sensor 16803 can be used to determine the motion posture of the mobile terminal 1600. In addition, sensors with other functions can be set in the sensor module 1680 according to actual needs, such as an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0187] The mobile terminal 1600 may also include other devices that provide auxiliary functions. For example, the key 1694 includes a power key, a volume key, etc., and the user can input through the key to generate key signal input related to the user settings and function control of the mobile terminal 1600. Another example is the indicator 1692, the motor 1693, the SIM card interface 1695, etc.

[0188] In addition, the exemplary embodiments of the present disclosure further provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification, for example, the program product may be executed. Figure 3 , Figure 4 , Figures 7 to 9 , Figures 11 to 14 Any one or more steps in .

[0189] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0190] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0191] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0192] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0193] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A light spot search method, It is characterized in that Applied to a terminal device, the terminal device includes a speckle TOF camera, and the method includes: Acquire a historical depth reference image corresponding to the current light intensity image collected by the speckle TOF camera; Determine a search area on the current light intensity image based on the historical depth reference image, and perform a light spot search in the search area; wherein the number of pixels included in the search area is less than the number of pixels included in the current light intensity image; Wherein, determining a search area on the current light intensity image based on the historical depth reference image comprises: Acquire a first position template and a preset offset function; wherein the first position template includes at least one first spot position acquired at a first acquisition distance; Calculate the first offset corresponding to each of the first light spot positions in the first position template based on the historical depth reference image and the preset offset function; Each of the first light spot positions is offset according to the first offset, and a first search area corresponding to the offset first light spot position is determined on the current light intensity image.

2. The method according to claim 1, It is characterized in that The calculating, based on the historical depth reference image and the preset offset function, the first offset corresponding to each of the first light spot positions in the first position template comprises: Acquire a depth value corresponding to each reference light spot in the historical depth reference image, and determine a first light spot position corresponding to each reference light spot in the first position template; The position offset corresponding to each of the reference light spots is calculated according to the preset offset function and the depth value, and the position offset is determined as a first offset corresponding to a first light spot position corresponding to the reference light spot.

3. The method according to claim 1, It is characterized in that Before calculating the first offset corresponding to each of the first light spot positions in the first position template based on the historical depth reference image and the preset offset function, the method further includes: Performing statistics on the depth values ​​corresponding to the reference light spots in the historical depth reference image, and determining the light spot ratio of the target light spots whose depth values ​​are less than the depth threshold; When the light spot ratio is greater than a ratio threshold, determining a second search area corresponding to the target light spot on the current light intensity image; When the light spot ratio is less than or equal to a ratio threshold, a first offset corresponding to each of the first light spot positions in the first position template is calculated based on the historical depth reference image and the preset offset function.

4. The method according to claim 3, It is characterized in that The step of determining a second search area corresponding to the target light spot on the current light intensity image includes: Acquire adjacent light spots corresponding to each of the target light spots, and calculate a second offset corresponding to the target light spot based on the preset offset function and the depth value corresponding to the adjacent light spot; Determining a first target light spot position corresponding to each of the target light spots in the first position template; The first target light spot position corresponding to each of the target light spots is offset according to the second offset, and a second search area corresponding to the first target light spot position after the offset is determined on the current light intensity image.

5. The method according to claim 1, It is characterized in that The determining a search area on the current light intensity image based on the historical depth reference image comprises: Acquire a position template set; wherein the position template set includes a plurality of second position templates, each of the second position templates corresponds to a different second acquisition distance, and each of the second position templates includes at least one second spot position acquired at the second acquisition distance corresponding to the second position template; Acquire a depth value corresponding to each reference light spot in the historical depth reference image, and determine a target second position template corresponding to each reference light spot in the position template set based on the depth value; Determining the second target light spot position corresponding to each of the reference light spots in the target second position template corresponding to each of the reference light spots; A third search area corresponding to the second target light spot position is determined on the current light intensity image.

6. The method according to claim 5, It is characterized in that The determining of a third search area corresponding to the second target light spot position on the current light intensity image includes: Obtaining a preset offset function, and calculating a third offset corresponding to the second target light spot position according to the preset offset function and the depth value corresponding to each of the reference light spots; Each of the second target light spot positions is offset according to the third offset, and a third search area corresponding to the offset second target light spot position is determined on the current light intensity image.

7. The method according to claim 1, It is characterized in that The determining a search area on the current light intensity image based on the historical depth reference image comprises: Determine the reference light spot position corresponding to each reference light spot according to the historical depth reference image; A fourth search area corresponding to the reference light spot position is determined on the current light intensity image.

8. The method according to claim 7, It is characterized in that After performing the spot search on the fourth search area, the method further includes: Acquire a third position template; wherein the third position template includes at least one third light spot position acquired at a third acquisition distance; A supplementary search is performed on the current light intensity image according to the positions of the reference light spots and the third light spot.

9. The method according to claim 8, It is characterized in that The supplementary search of the current light intensity image according to the positions of the reference light spots and the third light spot comprises: Determine the third target light spot position corresponding to each of the reference light spots in the third position template; obtain the third remaining light spot position excluding the third target light spot position in the third position template; A supplementary search area corresponding to the third remaining light spot position is determined on the current light intensity image, and a light spot search is performed within the supplementary search area.

10. The method according to claim 1, It is characterized in that The acquiring of a historical depth reference image corresponding to the current light intensity image collected by the speckle TOF camera comprises: Acquire at least one frame of historical depth image acquired by the speckle TOF camera; wherein the historical acquisition time of the historical light intensity image corresponding to the historical depth image is before the current acquisition time of the current light intensity image; A corresponding historical depth reference image is generated based on the at least one frame of historical depth image.

11. A light spot search device, It is characterized in that Applied to a terminal device, the terminal device includes a speckle TOF camera, including: A reference acquisition module, used to acquire a historical depth reference image corresponding to the current light intensity image collected by the speckle TOF camera; A light spot search module, used to determine a search area on the current light intensity image based on the historical depth reference image, and perform a light spot search within the search area; wherein the number of pixels included in the search area is less than the number of pixels included in the current light intensity image; Wherein, the light spot search module is configured to execute: Acquire a first position template and a preset offset function; wherein the first position template includes at least one first spot position acquired at a first acquisition distance; Calculate the first offset corresponding to each of the first light spot positions in the first position template based on the historical depth reference image and the preset offset function; Each of the first light spot positions is offset according to the first offset, and a first search area corresponding to the offset first light spot position is determined on the current light intensity image.

12. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

13. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 10 by executing the executable instructions.