Camera calibration method, device, terminal equipment and storage medium
By obtaining position coding information and target depth map, the camera coding information is automatically determined and the calibration relationship is established, which solves the problem that camera calibration needs to be manually performed in the prior art, and achieves fast and accurate camera calibration.
Patent Information
- Application Number
- CN202111675973.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the prior art, camera calibration requires manual operation, which is complex and inefficient.
By obtaining position encoding information, the target depth map of the target camera is determined, and the camera encoding information is determined based on the target depth map, the camera calibration relationship is established, and an automated camera calibration is realized.
Without manual calibration, the installation location of each camera can be quickly and accurately determined, improving calibration efficiency.
Smart Images

Figure CN114494454B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera calibration technology, and in particular to a camera calibration method, device, terminal equipment and storage medium. Background Art
[0002] With the development of intelligent terminal devices, image recognition and processing technologies are becoming more and more widely used, and virtual reality enhancement technology is also favored by the majority of users. For example, 3D fitting rooms are designed to allow customers to experience the effects of dressing in a virtual environment. In order to achieve the effect of the user's clothing matching, it is necessary to take images of the user in all directions. The existing 3D fitting room is equipped with multiple depth cameras, which obtain depth images respectively to capture the user's image from various angles.
[0003] However, in the prior art, due to the large number of depth cameras, some or all of them may be replaced, and after the depth camera is connected to the upper terminal device, the device enumeration is random, resulting in the images taken by each depth camera being displayed in disorder, which cannot correspond to the installation position of the depth camera. At this time, the camera calibration needs to be performed manually, which is complicated and inefficient.
[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0005] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, a camera calibration method, apparatus, terminal device and storage medium are provided, aiming to solve the problems in the prior art that manual calibration is required for camera calibration, the operation is complicated and the efficiency is low.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a camera calibration method, wherein the method comprises:
[0008] Acquire position coding information reflecting the camera installation position information, and determine a target depth map of the target camera corresponding to the position coding information according to the position coding information;
[0009] Determining camera encoding information of the target camera according to the target depth map;
[0010] A camera calibration relationship is established according to the camera encoding information and the position encoding information.
[0011] In one implementation, the step of obtaining position coding information reflecting the camera installation position information includes:
[0012] Acquire spatial structure information of a preset space, and determine camera installation position information according to the spatial structure information;
[0013] According to the camera installation position information, position coding information corresponding to the camera installation position information is determined.
[0014] In one implementation, determining, according to the position coding information, a target depth map of a target camera corresponding to the position coding information includes:
[0015] According to the position coding information, performing occlusion processing on the target camera corresponding to the position coding information;
[0016] Get the depth maps corresponding to all cameras;
[0017] The target depth map corresponding to the target camera is determined according to the depth maps corresponding to all the cameras.
[0018] In one implementation, determining the target depth map corresponding to the target camera according to the depth maps corresponding to all cameras includes:
[0019] Obtaining depth maps corresponding to all cameras, and determining a depth value corresponding to each of the depth maps;
[0020] The target depth map is determined according to the depth value corresponding to each of the depth maps.
[0021] In one implementation, determining the target depth map according to the depth value corresponding to each of the depth maps includes:
[0022] Obtain the number of pixels whose depth value is 0 in each of the depth maps;
[0023] Calculate the ratio of the number of pixels with a depth value of 0 to the total number of pixels in each of the depth maps;
[0024] A depth map whose ratio is higher than a preset value is acquired, and the depth map whose ratio is higher than the preset value is used as the target depth map.
[0025] In one implementation, determining the target depth map according to the depth value corresponding to each of the depth maps includes:
[0026] Obtain the number of pixels whose depth value is 0 in each of the depth maps;
[0027] Calculate the ratio of the number of pixels with a depth value of 0 to the total number of pixels in each of the depth maps;
[0028] The depth map with the highest ratio is obtained, and the depth map with the highest ratio is used as the target depth map.
[0029] In one implementation, determining the camera encoding information of the target camera according to the target depth map includes:
[0030] Parsing the target depth map to obtain device information of the target camera corresponding to the target depth map, which is used to reflect the device model and camera coding information of the camera that photographed the target depth map;
[0031] The camera encoding information is determined according to the device information.
[0032] In a second aspect, an embodiment of the present invention further provides a camera calibration device, wherein the device comprises:
[0033] A target depth map determination module, used to obtain position coding information, and determine a target depth map of a target camera corresponding to the position coding information according to the position coding information, wherein the position coding information is used to reflect the installation position information of the camera;
[0034] A camera coding information determination module, used to determine the camera coding information of the target camera according to the target depth map;
[0035] The camera calibration relationship establishing module is used to establish a camera calibration relationship according to the camera coding information and the position coding information.
[0036] In a third aspect, an embodiment of the present invention further provides a 3D fitting room, comprising a plurality of cameras, the camera calibration device and a three-dimensional reconstruction device, wherein:
[0037] The multiple cameras are used to collect depth maps of different parts of the human body;
[0038] The camera calibration device is used to obtain the calibration relationship between each camera;
[0039] The three-dimensional reconstruction device is used to convert the depth map into point cloud data, and reconstruct a three-dimensional model of the human body using the calibration relationship and the point cloud data.
[0040] In a fourth aspect, an embodiment of the present invention further provides a terminal device, wherein the terminal device includes a memory, a processor, and a camera calibration program stored in the memory and executable on the processor, and when the processor executes the camera calibration program, the steps of the camera calibration method described in any one of the above schemes are implemented.
[0041] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a camera calibration program is stored. When the camera calibration program is executed by a processor, the steps of the camera calibration method described in any one of the above schemes are implemented.
[0042] Beneficial effects: Compared with the prior art, the present invention provides a camera calibration method. The present invention first obtains position coding information, and the position coding information is used to reflect the installation position information of the camera. Since the depth map captured by each camera is not displayed according to the position number, but is random, the present invention can determine the target depth map of the target camera corresponding to the position coding information according to the position coding information, that is, determine which target depth map is captured by the camera at the installation position corresponding to the position coding information. After determining the target depth map, the present invention can determine the camera coding information according to the target depth map, and the camera coding information can reflect which camera is the target camera that captured the target depth map. Finally, the present invention can establish a camera calibration relationship according to the position coding information corresponding to the target depth map and the camera coding information corresponding to the target depth map. The camera calibration relationship can reflect the correspondence between the position coding information and the camera coding information, that is, determine the installation position of each target camera. It can be seen that the present invention obtains the target depth map corresponding to the position coding information and analyzes the target depth map to determine the camera corresponding to each target depth map, thereby obtaining the installation position of each target camera, that is, obtaining the position coding information corresponding to each camera coding information. The whole process does not require manual calibration, and can achieve rapid calibration of the camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 The present invention provides a flow chart of a specific implementation of the camera calibration method.
[0044] Figure 2 A schematic diagram of camera installation positions when the camera calibration method provided by an embodiment of the present invention is applied in a 3D fitting room.
[0045] Figure 3 A schematic diagram of an ideal image display when the camera calibration method provided by an embodiment of the present invention is applied in a 3D fitting room.
[0046] Figure 4 A schematic diagram of actual image display when the camera calibration method provided by an embodiment of the present invention is applied in a 3D fitting room.
[0047] Figure 5 A schematic diagram of the principle of determining a target depth map when the camera calibration method provided by an embodiment of the present invention is applied in a 3D fitting room.
[0048] Figure 6 It is a principle block diagram of a camera calibration device provided by an embodiment of the present invention.
[0049] Figure 7 It is a block diagram of the internal structure principle of the terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0051] The present embodiment provides a camera calibration method. Through the method of the present embodiment, camera calibration can be quickly implemented and the calibration efficiency can be improved. In specific implementation, the present embodiment first obtains position coding information, and the position coding information is used to reflect the installation position information of the camera. Since the depth map captured by each camera is not displayed according to the position number, but randomly, the present embodiment can determine the target depth map of the target camera corresponding to the position coding information according to the position coding information, that is, determine which target depth map is captured by the camera at the installation position corresponding to the position coding information. After determining the target depth map, the present embodiment can determine the camera coding information according to the target depth map, and the camera coding information can reflect which camera is the target camera that captured the target depth map. Finally, the present embodiment can establish a camera calibration relationship according to the position coding information corresponding to the target depth map and the camera coding information corresponding to the target depth map. The camera calibration relationship can reflect the corresponding relationship between the position coding information and the camera coding information, that is, determine the installation position of each target camera. It can be seen that this embodiment obtains the target depth map corresponding to the position coding information and analyzes the target depth map to determine the camera corresponding to each target depth map, thereby obtaining the installation position of each target camera, that is, obtaining the position coding information corresponding to each camera coding information. The whole process does not require manual calibration, and can achieve rapid calibration of the camera.
[0052] For example, when the camera calibration method of this embodiment is applied to a 3D fitting room, the 3D fitting room is provided with a plurality of cameras, and each camera has a fixed installation position. Figure 2 As shown in , 16 cameras are installed in the 3D fitting room, and each installation position for installing a camera is provided with unique position coding information, such as position 1, position 2, ... position 16. Since there are many cameras, and after the upper terminal device (such as a computer) is connected to these cameras, when the depth map captured by these cameras is displayed, the ideal display effect is as follows: Figure 3 As shown in Figure 3 The installation position of each camera matches the display position of its depth map, so that the image of each direction of the user can be obtained more intuitively and clearly. However, in actual applications, when the depth maps taken by these cameras are displayed, the display effect is out of order, such as Figure 4 As shown. Therefore, in this example, it is necessary to determine which camera each position coding information corresponds to, that is, to determine the installation position of each camera. First, obtain the position coding information, such as obtaining position 1. Then determine which target depth map is taken by the target camera corresponding to position 1, for example, determine that the target depth map taken by the target camera corresponding to position 1 is Figure 5 The fourth one in the fourth row from the top to the bottom in Figure A, at this time, the target depth map corresponding to the position coding information (i.e., position 1) is determined. Then the target depth map is analyzed to determine the camera coding information of the target camera corresponding to the target depth map. For example, the determined camera coding information is ACB8613006Z, which is unique and can be used to determine which camera is the target camera at this time. When the position coding information corresponding to the target depth map (i.e., position 1) and the camera coding information corresponding to the target depth map (such as ACB8613006Z) are obtained, the camera calibration relationship can be obtained as: position 1--ACB8613006Z. According to the above method, the camera coding information of the remaining cameras and their corresponding position coding information can be determined in turn, that is, the calibration of all cameras is completed.
[0053] Exemplary Methods
[0054] The camera calibration method in this embodiment can be applied to a terminal device, which can be a host computer connected to all cameras, such as a computer, a mobile phone, a tablet and other intelligent terminal products. Figure 1 As shown in , the camera calibration method in this embodiment includes the following steps:
[0055] Step S100: acquiring position coding information reflecting the installation position of a camera, and determining a target depth map of a target camera corresponding to the position coding information according to the position coding information.
[0056] Since the position coding information in this embodiment is used to reflect the installation location information of the camera, each installation location information will correspond to a camera. When the terminal device obtains the position coding information, it can determine which target depth map is taken by the target camera installed at the installation location corresponding to the position coding information based on the position coding information, thereby determining the correspondence between the position coding information and the target depth map.
[0057] In one implementation, when acquiring the position coding information, the present embodiment first acquires the spatial structure information of the preset space, in which a plurality of cameras are arranged, and each camera is fixedly installed at a specific position. Therefore, after obtaining the spatial structure information, the present embodiment can determine the camera installation position information based on the spatial structure information, and the camera installation position information is preset and fixed, and in order to prevent confusion, each camera installation position information is correspondingly provided with a position coding information.
[0058] In specific application, the camera calibration method in this embodiment can be applied to a 3D fitting room. Figure 2 As shown in Figure 2 It reflects the framework structure diagram of the 3D fitting room. Therefore, this embodiment can first obtain the spatial structure information corresponding to the 3D fitting room (i.e., the preset space). The spatial structure information reflects the overall framework structure and internal structure layout of the 3D fitting room. Therefore, according to the spatial structure information, the camera installation position in the 3D fitting room and the position coding information corresponding to each camera installation position can be obtained. Figure 2 As shown, 16 camera installation positions are set in the 3D fitting room, and their position coding information are: position 1, position 2...position 16. In addition, in a specific application embodiment, as Figure 2 As shown in , the 3D fitting room is a rectangular structure, and the camera installation positions are fixedly set on the four sides of the rectangular, and four camera installation positions are set on each side. In order to obtain the user's depth map more conveniently and clearly, the present embodiment can also set the four camera installation positions on each side to be at equal distances, so that the user can be photographed in all directions without blind spots, and the depth map taken by each camera will not have image overlap or duplication, thereby improving the image quality, so that the target depth map corresponding to each camera can be more accurately determined in the subsequent steps.
[0059] In one implementation, in this embodiment, when determining the target depth map corresponding to the position encoding information, the following steps are included:
[0060] Step S101, performing occlusion processing on the target camera corresponding to the position coding information according to the position coding information;
[0061] Step S102: Obtain depth maps corresponding to all cameras;
[0062] Step S103: Determine a target depth map corresponding to a target camera according to the depth maps corresponding to all cameras.
[0063] In specific implementation, when determining the target depth map corresponding to the position coding information, this embodiment can be implemented by analyzing and confirming one by one. This embodiment can first block the target camera corresponding to the position coding information, that is, block the target camera installed at the installation position corresponding to the position coding information. Then obtain the depth maps of all cameras. Based on all the depth maps, the depth value corresponding to each pixel in each depth map can be obtained. Since the target camera is blocked, the depth map taken by the target camera should be black or most of the area is black, and the depth value corresponding to the black pixel is 0. Therefore, this embodiment can perform depth value analysis on all depth maps, and determine the target depth map corresponding to the target camera from all depth maps.
[0064] Specifically, after the target camera corresponding to the position coding information is blocked, this embodiment starts to obtain the depth maps of all cameras, and then obtains the number of pixels with a depth value of 0 in each depth map. Then, the ratio of the number of pixels with a depth value of 0 to the total number of pixels in each depth map is calculated. If in a depth map, the ratio of the number of pixels with a depth value of 0 to the total number of pixels is higher than a preset value, such as 90%, it means that the depth map is black or a large area is black, that is, the depth map is the target depth map obtained by the blocked target camera. In another implementation, among all the depth maps, the ratio of the number of pixels with a depth value of 0 to the total number of pixels in a certain depth map is the highest, which means that the depth map is the darkest, so the depth map can also be determined as the target depth map obtained by the blocked target camera.
[0065] For example, when the position code information obtained is position 1, the target camera corresponding to position 1 is blocked, and then all depth maps are obtained. After the depth values of all depth maps are analyzed, it is determined that the target depth map obtained by the target camera at position 1 is Figure 5 The fourth one in the fourth row from the top of Figure A is black. When the position code information is obtained as position 11, the target camera corresponding to position 11 is blocked, and then all depth maps are obtained. After the depth value of all depth maps is analyzed, it is determined that the target depth map taken by the target camera at position 11 is Figure 5 The third one in the second row from the top in Figure B is black. Therefore, by repeating the above steps and blocking the target camera corresponding to each position coding information in turn, the target depth map corresponding to each position coding information can be determined.
[0066] Step S200: Determine camera coding information of a target camera according to a target depth map.
[0067] After obtaining the target depth map, this embodiment needs to determine which camera the target depth map was taken by. At this time, what is determined is the camera coding information of the target camera. The camera coding information is a unique identifier used to distinguish cameras. Each camera has only one unique camera coding information, and each depth map is also taken by the corresponding camera. The installation position of each camera is different, so each depth map is also unique and there will be no duplication. Therefore, this embodiment can determine the camera coding information of the target camera that took the target depth map based on the determined target depth map.
[0068] In one implementation, this embodiment includes the following steps when determining the camera encoding information:
[0069] Step S201, parsing the target depth map to obtain device information of the target camera corresponding to the target depth map;
[0070] Step S202: Determine camera encoding information according to device information.
[0071] Specifically, the camera encoding information in this embodiment can be directly read based on the program, and in order to distinguish the depth map taken by each camera, the camera will carry device information in the depth map information when taking the depth map. The device information is used to reflect the device model of the camera taking the depth map at this time, the camera encoding information and other information. To this end, after determining the target depth map, this embodiment can parse and process the target depth map to obtain the device information of the target camera corresponding to the target depth map, and then determine the camera encoding information based on the device information. For example, Figure 5 As shown, the determined Figure 5 The camera encoding information corresponding to the fourth target depth map in the fourth row from the top to the bottom of Figure A is: ACB8613006Z. Figure 5 The camera encoding information corresponding to the third target depth map in the second row from the top in Figure B is: ACB861300C6.
[0072] Step S300: establishing a camera calibration relationship according to the camera coding information and the position coding information.
[0073] In this embodiment, when the position coding information corresponding to the target depth map (such as position 1) and the camera coding information corresponding to the target depth map (such as ACB8613006Z) are determined, the camera calibration relationship can be obtained. In the camera calibration relationship, the correspondence between the position coding information and the camera coding information is reflected. Since the position coding information reflects the unique installation position of the camera, and the camera coding information reflects the unique identification of the camera, through the camera calibration relationship, it is possible to accurately and quickly determine the position of each camera installed in the preset space (such as a 3D fitting room), thereby realizing the rapid and accurate calibration of the camera. In one implementation, after obtaining the camera calibration relationship, this embodiment can save the camera calibration relationship to a preset folder. For example, the following Table 1 reflects the camera calibration relationship of a 3D fitting room.
[0074] Positional encoding information Camera encoding information Position 2 ACB512870005 Position 4 ACB112530199 Position 5 ACB8613000J Position 8 ACB8613002X Position 7 ACB86130061 Position 14 ACB8613006L Position 13 ACB8613006P Position 1 ACB8613006Z Position 3 ACB86130072 Position 15 ACB86130085 Position 10 ACB8613008A Position 16 ACB861300AN Position 9 ACB861300C0 Position 11 ACB861300C6 Position 6 ACB861300DE Position 12 ACB861300EG
[0075] Table 1
[0076] In other embodiments, after determining the camera calibration relationship, this embodiment can further accurately calibrate the camera. Specifically, since the camera calibration relationship obtained in this embodiment reflects the installation positions of the 16 cameras in the 3D fitting room, it is possible to obtain the depth map of each camera and then convert each depth map into point cloud data. When converting each depth map into point cloud data, the internal parameters of each camera can be read and the conversion between the depth map and the point cloud data can be realized based on the internal parameters.
[0077] Specifically, the camera intrinsic parameters can be expressed in matrix form as:
[0078]
[0079] Where f is the focal length of the camera, (Cx, Cy) is the optical center, and the units are all pixels.
[0080] Furthermore, based on the above parameters, the formula for converting the depth map into a three-dimensional point cloud (X, Y, Z) can be expressed as:
[0081]
[0082] Among them, z is the depth value of each pixel in the depth map, and (x, y) is the coordinate of each pixel on the depth map.
[0083] After obtaining the point cloud data of 16 depth maps, these point cloud data are spliced to obtain the global point cloud data inside the 3D fitting room, and then the pre-stored point cloud data of the 3D fitting room is called for alignment, so as to accurately calibrate the camera based on the alignment result and further adjust the camera's position and posture. In addition, in order to improve the accuracy of precise calibration, this example can also repeatedly collect 16 depth maps, convert them into point cloud data respectively, and repeatedly perform the operations of splicing these point cloud data and aligning them with the pre-stored point cloud data, so as to perform continuous and stable fine calibration of the camera to ensure the camera's shooting effect and shooting quality.
[0084] In summary, the present embodiment can first obtain position coding information, and the position coding information is used to reflect the installation position information of the camera. Since the depth map captured by each camera is not displayed according to the position number, but randomly, the present embodiment can determine the target depth map of the target camera corresponding to the position coding information according to the position coding information, that is, determine which target depth map is captured by the camera at the installation position corresponding to the position coding information. After determining the target depth map, the present embodiment can determine the camera coding information according to the target depth map, and the camera coding information can reflect which camera is the target camera that captured the target depth map. Finally, the present embodiment can establish a camera calibration relationship according to the position coding information corresponding to the target depth map and the camera coding information corresponding to the target depth map. The camera calibration relationship can reflect the correspondence between the position coding information and the camera coding information, that is, determine the installation position of each target camera. It can be seen that this embodiment obtains the target depth map corresponding to the position coding information and analyzes the target depth map to determine the camera corresponding to each target depth map, thereby obtaining the installation position of each target camera, that is, obtaining the position coding information corresponding to each camera coding information. The whole process does not require manual calibration, and can achieve rapid calibration of the camera.
[0085] Exemplary Devices
[0086] Based on the above embodiments, the present invention also provides a camera calibration device, such as Figure 6 As shown, the device includes: a target depth map determining module 10, a camera coding information determining module 20, and a camera calibration relationship establishing module 30. Specifically, the target depth map determining module 10 is used to obtain position coding information, and determine the target depth map of the target camera corresponding to the position coding information according to the position coding information. The camera coding information determining module 20 is used to determine the camera coding information of the target camera according to the target depth map. The camera calibration relationship establishing module 30 is used to establish a camera calibration relationship according to the camera coding information and the position coding information.
[0087] Based on the above embodiment, the embodiment of the present invention further provides a 3D fitting room, including multiple cameras, the above camera calibration device and a three-dimensional reconstruction device, wherein:
[0088] Multiple cameras for collecting depth maps of different parts of the human body;
[0089] A camera calibration device, used to obtain the calibration relationship between each camera;
[0090] The three-dimensional reconstruction device is used to convert the depth map into point cloud data, and reconstruct a three-dimensional model of the human body using the calibration relationship and the point cloud data.
[0091] Based on the above embodiments, the present invention further provides a terminal device, whose principle block diagram can be shown as follows: Figure 7 As shown. The terminal device includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected through a system bus. Among them, the processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera calibration method is implemented. The display screen of the terminal device can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the terminal device is pre-set inside the terminal device to detect the operating temperature of the internal device.
[0092] Those skilled in the art will understand that Figure 7 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal device to which the scheme of the present invention is applied. The specific terminal device may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0093] In one embodiment, a terminal device is provided. The terminal device includes a memory, a processor, and a camera calibration program stored in the memory and executable on the processor. When the processor executes the camera calibration program, the following operation instructions are implemented:
[0094] Acquire position coding information reflecting the camera installation position, and determine a target depth map of the target camera corresponding to the position coding information according to the position coding information;
[0095] Determine the camera encoding information of the target camera according to the target depth map;
[0096] A camera calibration relationship is established based on the camera encoding information and the position encoding information.
[0097] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0098] In summary, the present invention discloses a camera calibration method, apparatus, terminal device and storage medium, the method comprising: obtaining position coding information, and determining a target depth map of a target camera corresponding to the position coding information according to the position coding information, wherein the position coding information is used to reflect the installation position information of the camera; determining the camera coding information of the target camera according to the target depth map; and establishing a camera calibration relationship according to the camera coding information and the position coding information. The present invention obtains a target depth map corresponding to the position coding information and analyzes the target depth map to determine the target camera corresponding to each target depth map, thereby obtaining the installation position of each target camera, that is, obtaining the position coding information corresponding to each camera coding information. The entire process does not require manual calibration, and can achieve rapid calibration of the camera.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A camera calibration method, characterized in that: The method comprises: Acquiring position coding information reflecting camera installation position information, and determining a target depth map of a target camera corresponding to the position coding information according to the position coding information, including: According to the position coding information, perform occlusion processing on the target camera corresponding to the position coding information; obtain depth maps corresponding to all cameras; and determine the target depth map corresponding to the target camera according to the depth maps corresponding to all cameras; Determining the camera coding information of the target camera according to the target depth map includes: parsing the target depth map to obtain device information of the target camera corresponding to the target depth map, which is used to reflect the device model and camera coding information of the camera that photographed the target depth map; determining the camera coding information according to the device information; the camera coding information is a unique identifier used to distinguish cameras; A camera calibration relationship is established according to the camera encoding information and the position encoding information.
2. The camera calibration method according to claim 1, characterized in that: The obtaining of position coding information reflecting the camera installation position information includes: Acquire spatial structure information of a preset space, and determine camera installation position information according to the spatial structure information; According to the camera installation position information, position coding information corresponding to the camera installation position information is determined.
3. The camera calibration method according to claim 1, characterized in that: The step of determining the target depth map corresponding to the target camera according to the depth maps corresponding to all the cameras includes: Determining a depth value corresponding to each of the depth maps; The target depth map is determined according to the depth value corresponding to each of the depth maps.
4. The camera calibration method according to claim 3, characterized in that: The step of determining the target depth map according to the depth value corresponding to each of the depth maps includes: Obtain the number of pixels whose depth value is 0 in each of the depth maps; Calculate the ratio of the number of pixels with a depth value of 0 to the total number of pixels in each of the depth maps; A depth map whose ratio is higher than a preset value is acquired, and the depth map whose ratio is higher than the preset value is used as the target depth map.
5. The camera calibration method according to claim 3, characterized in that: The step of determining the target depth map according to the depth value corresponding to each of the depth maps includes: Obtain the number of pixels whose depth value is 0 in each of the depth maps; Calculate the ratio of the number of pixels with a depth value of 0 to the total number of pixels in each of the depth maps; The depth map with the highest ratio is obtained, and the depth map with the highest ratio is used as the target depth map.
6. A camera calibration device, characterized in that: The device comprises: A target depth map determination module is used to obtain position coding information and determine a target depth map of a target camera corresponding to the position coding information according to the position coding information, wherein the position coding information is used to reflect the installation position information of the camera, including: According to the position coding information, perform occlusion processing on the target camera corresponding to the position coding information; obtain depth maps corresponding to all cameras; and determine the target depth map corresponding to the target camera according to the depth maps corresponding to all cameras; A camera coding information determination module is used to determine the camera coding information of the target camera according to the target depth map, including: parsing the target depth map to obtain device information of the target camera corresponding to the target depth map, which is used to reflect the device model and camera coding information of the camera that shoots the target depth map; determining the camera coding information according to the device information; the camera coding information is a unique identifier used to distinguish cameras; The camera calibration relationship establishing module is used to establish a camera calibration relationship according to the camera coding information and the position coding information.
7. A 3D fitting room, characterized in that: The device comprises a plurality of cameras, a camera calibration device and a three-dimensional reconstruction device as claimed in claim 6, wherein: The multiple cameras are used to collect depth maps of different parts of the human body; The camera calibration device is used to obtain the calibration relationship between each camera; The three-dimensional reconstruction device is used to convert the depth map into point cloud data, and reconstruct a three-dimensional model of the human body using the calibration relationship and the point cloud data.
8. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a camera calibration program stored in the memory and executable on the processor. When the processor executes the camera calibration program, the steps of the camera calibration method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a camera calibration program, and when the camera calibration program is executed by the processor, the steps of the camera calibration method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Imaging apparatus capable of wireless communication
CN104349054A
Virtual fitting method and system
CN107067299A