Light spot addressing method, device, equipment and medium
By acquiring and processing images through the infrared depth camera module to determine the coordinates of the center of mass of the light spot, the problem of low efficiency of light spot addressing is solved and the efficiency and accuracy of light spot addressing are improved.
Patent Information
- Application Number
- CN202210396117.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-15
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-04-15
AI Technical Summary
In the existing technology, the light spot addressing efficiency is low, which affects the output efficiency of depth data.
The infrared depth camera module is used to obtain a reference image of the target plane, which is binarized to determine the centroid coordinates of the calibration spot, and mapped to the projection position in the target image to determine the address of the light spot to be located.
The complexity of light spot addressing is simplified, the efficiency of light spot addressing is improved, and efficient light spot addressing is achieved.
Smart Images

Figure CN114820767B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical technology, and in particular to a light spot addressing method, device, equipment and medium. Background Art
[0002] TOF (Time of Flight) is a technology that calculates the distance between a camera module and an object by measuring the time it takes for a modulated infrared laser pulse of a specific wavelength to reflect from the surface of the object being measured. The principle is to calculate the phase difference between two or more pulses to obtain the time difference, and then use the speed of light to determine the actual flight distance of the pulse.
[0003] Combining TOF technology with a camera module yields an infrared depth camera module (referred to as a TOF module). The image data captured by the depth camera module includes depth information. Depth information can be obtained by first identifying light spots in the image, then filtering out valid pixels in the image, and then calculating depth data based on these valid pixels.
[0004] However, since the position of the light spot in different frames is not fixed, real-time light spot addressing is required. However, related technologies mainly use complex image processing methods to achieve light spot addressing, which is inefficient and seriously affects the output efficiency of depth data. Summary of the Invention
[0005] The embodiments of the present application solve the technical problem of low efficiency of light spot addressing in the prior art by providing a light spot addressing method, device, equipment and medium, and achieve the technical effect of improving the efficiency of light spot addressing.
[0006] In a first aspect, the present application provides a light spot addressing method, the method comprising:
[0007] When the infrared depth camera module and the target plane are in a target state, the infrared depth camera module is used to obtain a picture of the target plane to obtain a reference image;
[0008] Binarize the reference image to obtain a spot image containing a calibration spot;
[0009] Determine the centroid coordinates of each calibration spot according to the pixel coordinates corresponding to each calibration spot in the spot image;
[0010] The projection position of each centroid coordinate mapped to the target image is determined, and the address of each light spot to be located in the target image is determined according to the projection position corresponding to each centroid coordinate.
[0011] Furthermore, the infrared depth camera module and the target plane are in a target state, including:
[0012] The infrared depth camera module is parallel to the target plane;
[0013] The distance between the infrared depth camera module and the target plane is 0.3m-1m;
[0014] The field of view of the infrared depth camera module is within the plane of the target plane.
[0015] Furthermore, the reference image is binarized to obtain a spot image containing a calibration spot, including:
[0016] Get the actual pixel value of each pixel in the reference image;
[0017] Identify a first target pixel and a second target pixel in a reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value;
[0018] The pixel value of the first target pixel is set to a third preset pixel value, and the pixel value of the second target pixel is set to a fourth preset pixel value to obtain a light spot image; the third preset pixel value is different from the fourth preset pixel value.
[0019] Furthermore, the address of each light spot to be located in the target image is determined according to the projection position corresponding to each centroid coordinate, including:
[0020] For any centroid coordinate, within a preset range centered on the projection position corresponding to the centroid coordinate, the address corresponding to the pixel with the largest pixel value and an unrecognized address is used as the address of a light spot to be located in the target image.
[0021] In a second aspect, the present application provides a light spot addressing device, the device comprising:
[0022] A reference image acquisition module is used to acquire a picture of the target plane through the infrared depth camera module when the infrared depth camera module and the target plane are in a target state to obtain a reference image;
[0023] A binarization processing module is used to perform binarization processing on the reference image to obtain a spot image containing a calibration spot;
[0024] A centroid coordinate determination module, configured to determine the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image;
[0025] The address determination module is used to determine the projection position of each centroid coordinate mapped to the target image, and determine the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate.
[0026] Furthermore, the infrared depth camera module and the target plane are in a target state, including:
[0027] The infrared depth camera module is parallel to the target plane;
[0028] The distance between the infrared depth camera module and the target plane is 0.3m-1m;
[0029] The field of view of the infrared depth camera module is within the plane of the target plane.
[0030] Furthermore, the binarization processing module includes:
[0031] An actual pixel value acquisition module is used to obtain the actual pixel value of each pixel in the reference image;
[0032] a classification module, configured to identify a first target pixel and a second target pixel in a reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value;
[0033] The pixel value replacement module is used to set the pixel value of the first target pixel to a third preset pixel value and the pixel value of the second target pixel to a fourth preset pixel value to obtain a spot image; the third preset pixel value is different from the fourth preset pixel value.
[0034] Furthermore, the address determination module includes:
[0035] The address determination submodule is used to, for any centroid coordinate, take the address corresponding to the pixel with the largest pixel value and no recognized address as the address of a light spot to be located in the target image within a preset range centered on the projection position corresponding to the centroid coordinate.
[0036] In a third aspect, the present application provides an electronic device, comprising:
[0037] processor;
[0038] a memory for storing processor-executable instructions;
[0039] The processor is configured to execute to implement a light spot addressing method provided in the first aspect.
[0040] In a fourth aspect, the present application provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement a light spot addressing method as provided in the first aspect.
[0041] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0042] In this application, when the TOF module and the target plane are in the target state, the TOF module is used to obtain the image of the target plane to obtain a reference image and a target image; then, the reference image is binarized to obtain a spot image containing a calibration spot; the target image is binarized to obtain a target image containing a spot to be located; then, according to the pixel coordinates corresponding to each calibration spot in the spot image, the centroid coordinates of each calibration spot are determined; finally, the projection position of each centroid coordinate mapped to the target image is determined, and according to the projection position corresponding to each centroid coordinate, the address of each spot to be located in the target image is determined. It can be seen from this that the present application only needs to calibrate a certain frame of image once to obtain the centroid coordinates of the calibration spot in the image. When the TOF module subsequently outputs the image in real time, there is no need to perform complex image processing on the subsequent output image. According to the projection position of the centroid coordinates of the calibration spot in the subsequent image, the accurate center position of the spot in the subsequent image can be obtained, which greatly simplifies the complexity of spot addressing and improves the efficiency of spot addressing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 A schematic flow chart of a light spot addressing method provided in this application;
[0045] Figure 2 Schematic diagram of the relative position of the TOF module and the target plane in this application;
[0046] Figure 3 is a schematic diagram of a reference image obtained in this application;
[0047] Figure 4 is a schematic diagram of the target image obtained in this application;
[0048] Figure 5 For Figure 3 The reference image shown is a spot image after binarization processing;
[0049] Figure 6-Figure 7 for Figure 4 A partial magnified view of the target image shown;
[0050] Figure 8For Figure 4 The schematic diagram of the target image after spot addressing is shown;
[0051] Figure 9 A schematic structural diagram of a light spot addressing device provided in this application;
[0052] Figure 10 This is a schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0053] The embodiments of the present application solve the technical problem of low efficiency of light spot addressing in the prior art by providing a light spot addressing method.
[0054] The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0055] A light spot addressing method comprises: when an infrared depth camera module and a target plane are in a target state, acquiring a picture of the target plane through the infrared depth camera module to obtain a reference image; binarizing the reference image to obtain a light spot image containing calibration light spots; determining the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image; determining the projection position of each centroid coordinate mapped to the target image, and determining the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate.
[0056] In this embodiment, when the TOF module and the target plane are in a target state, the TOF module acquires a picture of the target plane to obtain a reference image and a target image; then, the reference image is binarized to obtain a spot image containing a calibration spot; the target image is binarized to obtain a target image containing a spot to be located; then, based on the pixel coordinates corresponding to each calibration spot in the spot image, the centroid coordinates of each calibration spot are determined; finally, the projection position of each centroid coordinate mapped to the target image is determined, and based on the projection position corresponding to each centroid coordinate, the address of each spot to be located in the target image is determined. Thus, it can be seen that in this embodiment, only one calibration is required for a frame of image to obtain the centroid coordinates of the calibration spot in the image. When the TOF module subsequently outputs an image in real time, there is no need to perform complex image processing on the subsequent output image. Based on the projection position of the centroid coordinates of the calibration spot in the subsequent image, the accurate center position of the spot in the subsequent image can be obtained, which greatly simplifies the complexity of spot addressing and improves the efficiency of spot addressing.
[0057] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.
[0058] First, the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.
[0059] This embodiment provides Figure 1 A light spot addressing method is shown, the method comprising:
[0060] Step S11: When the TOF module (i.e., infrared depth camera module) and the target plane are in a target state, the TOF module acquires a picture of the target plane to obtain a reference image;
[0061] Step S12, performing binarization processing on the reference image to obtain a spot image containing a calibration spot;
[0062] Step S13, determining the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image;
[0063] Step S14 , determining the projection position of each centroid coordinate mapped to the target image, and determining the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate.
[0064] Regarding step S11 , when the TOF module and the target plane are in a target state, the TOF module acquires a picture of the target plane to obtain a reference image.
[0065] The imaging principle of the TOF module, that is, the infrared depth camera module, is different from that of the ordinary camera module. Ordinary camera modules receive visible light, so the image obtained by ordinary camera modules is similar to the image obtained by the naked eye. The infrared depth camera module only receives light of specific wavelengths, such as 940nm and 1350nm infrared light. In the case of only visible light, the infrared depth camera module cannot obtain visible images. The infrared depth camera module has its own infrared light emitter. When working, the infrared depth camera module receives the image of the light spot projected by its own infrared light emitter. Therefore, the area not illuminated by the light spot is black. For example Figure 3 As shown in FIG, the image obtained by the infrared depth camera module when shooting the target plane in a dark environment.
[0066] The TOF module and the target plane are in the target state (for details, please refer to Figure 2 ) means:
[0067] The TOF module is parallel to the target plane;
[0068] The distance d between the TOF module and the target plane is 0.3m-1m;
[0069] The field of view of the TOF module is within the plane of the target plane.
[0070] The reference image is captured when the TOF module and the target plane are in the target state and can be used as the reference image. The target plane can be a white plane.
[0071] Regarding step S12, the reference image is binarized to obtain a spot image containing a calibration spot.
[0072] Specifically, the method for performing binarization processing on the reference image includes steps S21 to S23.
[0073] Step S21, obtaining the actual pixel value of each pixel in the reference image;
[0074] Step S22, identifying a first target pixel and a second target pixel in the reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value;
[0075] Step S23 , setting the pixel value of the first target pixel to a third preset pixel value, and setting the pixel value of the second target pixel to a fourth preset pixel value, to obtain a light spot image; the third preset pixel value is different from the fourth preset pixel value.
[0076] Each pixel in the reference image is classified based on its actual pixel value. When the actual pixel value of a pixel is less than a first preset pixel value, the pixel is classified as a first target pixel; when the actual pixel value of a pixel is greater than a second preset pixel value, the pixel is classified as a first target pixel; when the actual pixel value of a pixel is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value, the pixel is classified as a second target pixel.
[0077] By setting the pixel value of the first target pixel to a third preset pixel value (e.g., 0) and the pixel value of the second target pixel to a fourth preset pixel value (e.g., 255), a spot image that is clearer than the reference image can be obtained. The larger the difference between the third preset pixel value and the fourth preset pixel value, the clearer the calibration spot in the obtained spot image; and the smaller the difference between the third preset pixel value and the fourth preset pixel value, the blurrier the calibration spot in the obtained spot image. Generally, the clearer the calibration spot, the more accurate the centroid coordinates obtained. Therefore, in actual operation, the third preset pixel value and the fourth preset pixel value with a larger difference can be selected, for example, the third preset pixel value is 0 and the fourth preset pixel value is 255.
[0078] For example, identification Figure 3 The first target pixel and the second target pixel in the image are set to 0 and the second target pixel is set to 255, and the following can be obtained: Figure 5 The light spot image shown. Figure 3 The reference image shown is Figure 5 Compared with the light spot image shown in FIG, the light spot in the light spot image is clearer.
[0079] Regarding step S13, the centroid coordinates of each calibration light spot are determined according to the pixel coordinates corresponding to each calibration light spot in the light spot image.
[0080] In order to distinguish the light spot in the light spot image from the light spot in the image of the light spot address to be identified (ie, the target image that appears later), the light spot in the light spot image is recorded as the calibration light spot, and the light spot in the target image is recorded as the light spot to be located.
[0081] The calibration spot in the spot image is usually composed of multiple pixels. In order to accurately mark the position of each calibration spot, the centroid coordinates of each calibration spot can be calculated based on the pixel coordinates of the multiple pixels that constitute the calibration spot. The relevant calculation method can refer to the relevant technology and will not be repeated here.
[0082] Regarding step S14 , the projection position of each centroid coordinate mapped to the target image is determined, and the address of each light spot to be located in the target image is determined according to the projection position corresponding to each centroid coordinate.
[0083] The target image may be an image captured in a state different from the target state and requiring spot addressing. The centroid coordinates obtained from the spot image may be mapped to the target image to determine the projection position of the centroid coordinates in the target image.
[0084] The addresses of the light spots to be located in the target image can be determined according to the projection positions of the centroid coordinates in the target image.
[0085] Specifically, for any centroid coordinate, within a preset range centered on the projection position corresponding to the centroid coordinate, the address corresponding to the pixel with the maximum pixel value and an unrecognized address is used as the address of a light spot to be located in the target image. The preset range can be determined based on the projection position, specifically, a range centered on the projection position, or a range defined by a fixed area encompassing the projection position, without limitation.
[0086] The following is an example of the range determined by taking the projection position as the center.
[0087] For example, from Figure 5 Select a calibration spot, determine the centroid coordinates of the calibration spot, and map the centroid coordinates to Figure 4 In the target image shown, we can get Figure 6 The enlarged view of the part shown ( Figure 6 is a local magnified image of a certain area of the target image). Figure 6 The middle white square A is Figure 5 The centroid coordinates of a calibration spot are mapped to the projected position in the target image. The area enclosed by the outer white box is the preset range centered on square A. Two pixels with higher pixel values are identified within the white box: pixel 1 and pixel 2. The pixel value of pixel 1 is 121, and the pixel value of pixel 2 is 132. Since the coordinates of pixel 1 and pixel 2 have not been identified before, the position of one of the pixels can be determined. Specifically, pixel 2 with the larger pixel value is determined as the spot to be located within the preset area, and the coordinate position of pixel 2 is determined as the coordinate position of the spot to be located.
[0088] For example, from Figure 5 Choose one with Figure 6 The projection position of the calibration spot adjacent to the calibration spot corresponding to grid A is Figure 7 The area enclosed by the white box outside Grid B is the preset range centered on the projection position of Grid B. The gray box area between Grid A and Grid B is Figure 6 The area where pixel No. 2, whose address has been identified, is located can be pixel No. 2 itself, or a range area including pixel No. 2, such as a range area determined with pixel No. 2 as the center. This embodiment does not impose any restrictions on this.
[0089] For example, when Figure 7The gray box area in the figure is the area of pixel No. 2 itself (recorded as the searched area), and when the searched area is within the preset range determined with grid B as the center (for example, an 11*11 pixel range, recorded as grid B area), no matter whether the pixel value of the searched area is the maximum value in grid B area, the pixels in the searched area can no longer be used as the light spot to be located in grid B area. Instead, the address of the pixel with the largest pixel value among other pixels in grid B area is determined as the address of the light spot to be located.
[0090] when Figure 7 The gray box area in the figure is the range area determined by pixel No. 2 (for example, a 5*5 pixel area, recorded as the searched area). When the searched area intersects or overlaps with the B grid area, no matter whether the pixel value of the searched area is the maximum value in the B grid area, the pixels in the searched area can no longer be used as the light spot to be located in the B grid area. Instead, the address of the pixel with the largest pixel value among other pixels in the B grid area is determined as the address of the light spot to be located.
[0091] According to the above method, we can Figure 4 The target image shown is addressed with a light spot, and the final result is as follows Figure 8 The light spot addressing diagram shown.
[0092] In specific implementation, the inventors found that the recognition rate of the light spot addressing method provided by this embodiment can reach more than 90%, and is applicable to images taken in various environments and also to images corresponding to various light spot distribution types.
[0093] In summary, when the TOF module and the target plane are in the target state, the present embodiment acquires the image of the target plane through the TOF module to obtain a reference image and a target image; then, the reference image is binarized to obtain a spot image containing a calibration spot; the target image is binarized to obtain a target image containing a spot to be located; then, based on the pixel coordinates corresponding to each calibration spot in the spot image, the centroid coordinates of each calibration spot are determined; finally, the projection position of each centroid coordinate mapped to the target image is determined, and based on the projection position corresponding to each centroid coordinate, the address of each spot to be located in the target image is determined. It can be seen that the present embodiment only needs to calibrate a certain frame of image once to obtain the centroid coordinates of the calibration spot in the image. When the TOF module subsequently outputs the image in real time, there is no need to perform complex image processing on the subsequent output image. According to the projection position of the centroid coordinates of the calibration spot in the subsequent image, the accurate center position of the spot in the subsequent image can be obtained, which greatly simplifies the complexity of spot addressing and improves the efficiency of spot addressing.
[0094] Based on the same inventive concept, this embodiment provides Figure 9A light spot addressing device is shown, the device comprising:
[0095] The reference image acquisition module 91 is used to acquire a picture of the target plane through the infrared depth camera module when the infrared depth camera module and the target plane are in a target state to obtain a reference image;
[0096] A binarization processing module 92 is used to perform binarization processing on the reference image to obtain a spot image containing a calibration spot;
[0097] A centroid coordinate determination module 93 is used to determine the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image;
[0098] The address determination module 94 is used to determine the projection position of each centroid coordinate mapped to the target image, and determine the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate.
[0099] Furthermore, the infrared depth camera module and the target plane are in a target state, including:
[0100] The infrared depth camera module is parallel to the target plane;
[0101] The distance between the infrared depth camera module and the target plane is 0.3m-1m;
[0102] The field of view of the infrared depth camera module is within the plane of the target plane.
[0103] Furthermore, the binarization processing module 92 includes:
[0104] An actual pixel value acquisition module is used to obtain the actual pixel value of each pixel in the reference image;
[0105] a classification module, configured to identify a first target pixel and a second target pixel in a reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value;
[0106] The pixel value replacement module is used to set the pixel value of the first target pixel to a third preset pixel value and the pixel value of the second target pixel to a fourth preset pixel value to obtain a spot image; the third preset pixel value is different from the fourth preset pixel value.
[0107] Furthermore, the address determination module 94 includes:
[0108] The address determination submodule is used to, for any centroid coordinate, take the address corresponding to the pixel with the largest pixel value and no recognized address as the address of a light spot to be located in the target image within a preset range centered on the projection position corresponding to the centroid coordinate.
[0109] Based on the same inventive concept, this embodiment provides Figure 10 An electronic device as shown includes:
[0110] Processor 101;
[0111] a memory 102 for storing instructions executable by the processor 101;
[0112] The processor 101 is configured to execute to implement a light spot addressing method as provided above.
[0113] Based on the same inventive concept, this embodiment provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor 101 of the electronic device, the electronic device can implement a light spot addressing method as provided above.
[0114] Since the electronic device described in this embodiment is an electronic device used to implement the information processing method in the embodiment of this application, based on the information processing method described in the embodiment of this application, those skilled in the art will be able to understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application will not be described in detail here. As long as those skilled in the art implement the electronic device used by the information processing method in the embodiment of this application, it falls within the scope of protection to be provided by this application.
[0115] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0117] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0119] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0120] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A light spot addressing method, characterized in that: The method comprises: When the infrared depth camera module and the target plane are in a target state, the infrared depth camera module is used to capture a picture of the target plane to obtain a reference image; Binarizing the reference image to obtain a spot image containing a calibration spot; Determining the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image; Determining the projection position of each centroid coordinate mapped to the target image, and determining the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate; the reference image and the light spot image correspond to each other; the target image and the light spot image are two independent images, and the target image is an image captured in a state different from the target state and requires light spot addressing; Determining the addresses of the light spots to be located in the target image according to the projection positions corresponding to the coordinates of the centroids includes: For any centroid coordinate, within a preset range centered on the projection position corresponding to the centroid coordinate, the address corresponding to the pixel with the maximum pixel value and an unrecognized address is used as the address of a light spot to be located in the target image.
2. The method according to claim 1, wherein The infrared depth camera module and the target plane are in a target state, including: The infrared depth camera module is parallel to the target plane; The distance between the infrared depth camera module and the target plane is 0.3 meters to 1 meter; The field of view of the infrared depth camera module is within the plane of the target plane.
3. The method according to claim 1, wherein The binarization process is performed on the reference image to obtain a spot image containing a calibration spot, including: Obtaining an actual pixel value of each pixel in the reference image; Identifying a first target pixel and a second target pixel in the reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value; The pixel value of the first target pixel is set to a third preset pixel value, and the pixel value of the second target pixel is set to a fourth preset pixel value to obtain the light spot image; the third preset pixel value is different from the fourth preset pixel value.
4. A light spot addressing device, characterized in that: The device comprises: A reference image acquisition module is used to acquire a picture of the target plane through the infrared depth camera module when the infrared depth camera module and the target plane are in a target state to obtain a reference image; A binarization processing module, used for performing binarization processing on the reference image to obtain a spot image containing a calibration spot; a centroid coordinate determination module, configured to determine the centroid coordinates of each calibration light spot according to the pixel coordinates corresponding to each calibration light spot in the light spot image; An address determination module is used to determine the projection position of each centroid coordinate mapped to the target image, and determine the address of each light spot to be located in the target image according to the projection position corresponding to each centroid coordinate; The reference image and the spot image correspond to each other; the target image and the spot image are two independent images, and the target image is an image captured in a state different from the target state and requires spot addressing; The address determination module includes: The address determination submodule is used to, for any centroid coordinate, use the address corresponding to the pixel with the largest pixel value and unrecognized address within a preset range centered on the projection position corresponding to the centroid coordinate as the address of a light spot to be located in the target image.
5. The device according to claim 4, characterized in that The infrared depth camera module and the target plane are in a target state, including: The infrared depth camera module is parallel to the target plane; The distance between the infrared depth camera module and the target plane is 0.3 meters to 1 meter; The field of view of the infrared depth camera module is within the plane of the target plane.
6. The device according to claim 4, characterized in that The binarization processing module includes: An actual pixel value acquisition module, configured to acquire an actual pixel value of each pixel in the reference image; a classification module, configured to identify a first target pixel and a second target pixel in the reference image, wherein the first target pixel refers to a pixel whose actual pixel value is less than a first preset pixel value and a pixel whose actual pixel value is greater than a second preset pixel value; the second target pixel refers to a pixel whose actual pixel value is greater than or equal to the first preset pixel value and less than or equal to the second preset pixel value; and the first preset pixel value is less than the second preset pixel value; A pixel value replacement module is used to set the pixel value of the first target pixel to a third preset pixel value and the pixel value of the second target pixel to a fourth preset pixel value to obtain the light spot image; the third preset pixel value is different from the fourth preset pixel value.
7. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute to implement a light spot addressing method according to any one of claims 1 to 3.
8. A non-transitory computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to implement a light spot addressing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Centroid identification and positioning method of infrared light spot image
CN111462225A