Binocular depth estimation method and system, electronic equipment and readable storage medium
Through the binocular depth estimation method, the trained binocular model and size proportional projection coefficients are used for 3D reconstruction, which solves the problems of high equipment cost and environmental complexity in small and medium-sized enterprises, achieves efficient and accurate depth estimation, and improves the system's reliability. Flexibility and ease of use.
Patent Information
- Application Number
- CN202410797824.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-27
AI Technical Summary
Industrial-grade binocular depth estimation systems require high-performance hardware support, making it difficult to promote and apply them in small and medium-sized enterprises. Complex environments and equipment calibration issues reduce the accuracy and flexibility of estimation.
A binocular depth estimation method is proposed. By acquiring binocular images, using the trained binocular model to extract depth features, calculate the size ratio projection coefficient, and perform three-dimensional reconstruction based on the disparity map and target depth parameters to generate a three-dimensional point cloud image. Avoid the noise introduced by upsampling and improve the accuracy and efficiency of estimation.
Efficient and accurate binocular depth estimation is achieved on low-cost equipment, reducing the difficulty of system deployment, improving flexibility and ease of use, and adapting to different industrial environments.
Smart Images

Figure CN118710696A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a binocular depth estimation method, system, electronic device and readable storage medium. Background Art
[0002] Existing binocular depth estimation is used in many fields, but industrial-grade binocular depth estimation systems often require high-performance hardware support, including powerful graphics processing units (GPUs) and large-capacity memory. This makes it difficult to promote and apply in large-scale production, especially for small and medium-sized enterprises, which may find it difficult to afford the high cost. Therefore, in traditional methods, binocular depth estimation implemented in low-cost equipment will reduce the accuracy of the final estimate.
[0003] In industrial scenarios, the complexity of the environment will lead to various complex lighting conditions, occlusion maps, and different material surfaces in actual applications, thereby reducing the accuracy and stability of depth estimation. In addition, the cumbersome calibration and calibration between different devices and cameras limits the flexibility and ease of use of the binocular depth estimation system, increasing the difficulty of deployment in actual industrial applications. Summary of the invention
[0004] In view of the above problems, the present application proposes a binocular depth estimation method, system, electronic device and readable storage medium.
[0005] The present application embodiment provides a binocular depth estimation method, including:
[0006] Acquire a binocular image, and use a trained binocular model to perform depth feature extraction on the binocular image to obtain a corresponding disparity map;
[0007] Calculating a size ratio projection coefficient according to the size information of the disparity map and a preset calibration size;
[0008] Based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter, the disparity map is three-dimensionally reconstructed to obtain a three-dimensional point cloud map corresponding to the disparity map.
[0009] Furthermore, in the above binocular depth estimation method, the target depth parameter is obtained by pre-calibration, including:
[0010] Constructing a test binocular image and setting a plurality of reference points in the test binocular image, each of the reference points including corresponding reference point information;
[0011] According to the test binocular image, a corresponding test disparity image is obtained;
[0012] The target depth parameter is calculated according to the reference point information and the test disparity map.
[0013] Furthermore, in the above binocular depth estimation method, the reference point information includes a real depth value of the reference point; and the target depth parameter is calculated according to the reference point information and the test disparity map, including:
[0014] Obtain a test disparity value corresponding to the reference point in the test disparity map;
[0015] Calculating a depth parameter of the reference point according to the test disparity value and the true depth value;
[0016] The target depth parameter is calculated based on the depth parameter of each reference point.
[0017] Furthermore, in the above binocular depth estimation method, the preset calibration size includes a calibration image width; and the size ratio projection coefficient is calculated according to the size information of the disparity map and the preset calibration size, including:
[0018] The ratio of the width of the calibration image to the width of the disparity image is used as the size ratio projection coefficient.
[0019] Furthermore, in the above binocular depth estimation method, the disparity information includes the disparity value and coordinates of each pixel in the disparity map; and the three-dimensional reconstruction of the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter includes:
[0020] Using the depth value of the pixel point in the disparity map and the target depth parameter, calculate the depth value of the corresponding pixel point;
[0021] Based on the depth value, coordinate information, size ratio projection coefficient and camera calibration parameters of the pixel point, the horizontal and vertical coordinates of the projection of the corresponding pixel point in the three-dimensional coordinate system are calculated;
[0022] According to the depth value and the horizontal and vertical coordinates of the pixel point, the corresponding point cloud is obtained.
[0023] Furthermore, in the above binocular depth estimation method, the camera calibration parameters include the camera principal point and the camera focal length, and the calculation formula for three-dimensional reconstruction of the disparity map includes:
[0024] Z j =α / D j ;
[0025] x=(β*W i -C x )*Z j / fx ;
[0026] y=(β*H i -C y )*Z j / f y ;
[0027] Among them, C x is the x-axis coordinate of the camera principal point, C y is the y-axis coordinate of the camera's principal point; W i is the width coordinate of the i-th pixel in the binocular image, H i is the high coordinate of the i-th pixel in the binocular image; Z j is the depth value of the jth pixel in the disparity map, α is the target depth parameter, and D j is the disparity value of the j-th pixel in the disparity map; x is the horizontal coordinate of the j-th pixel projected in the three-dimensional coordinate system, y is the vertical coordinate of the i-th pixel projected in the three-dimensional coordinate system; β is the size ratio projection coefficient; f x is the number of pixels of the camera focal length in the x-axis direction, f y is the focal length of the camera in the y direction; wherein, there is a corresponding relationship between the i-th pixel point in the binocular image and the j-th pixel point in the disparity map.
[0028] Furthermore, in the above binocular depth estimation method, the binocular model training process includes:
[0029] Input the binocular training images into the student model to be trained and the teacher model respectively, so as to output the student prediction results and the teacher soft labels respectively;
[0030] Based on the hard labels of the binocular training image, the student prediction results and the teacher soft labels, a distillation loss is calculated;
[0031] Train the student model by using the distillation loss to obtain a trained initial student model;
[0032] Calculating a pruning loss according to the distillation loss and a student weight parameter in the student model, wherein the student weight parameter corresponds to a teacher weight parameter in the teacher model;
[0033] The initial student model is trained using the pruning loss to obtain the trained binocular model.
[0034] Furthermore, in the above binocular depth estimation method, each point cloud in the three-dimensional point cloud image corresponds to actual position distance information, and the method further includes:
[0035] Dividing each point cloud into different interval segments according to the actual position distance information;
[0036] In each of the intervals, the intervals are divided into a plurality of sub-areas according to the distribution of the point cloud;
[0037] The sub-region with the largest number of point clouds in the same interval segment is taken as the obstacle region.
[0038] Another embodiment of the present application further provides a binocular depth estimation system, comprising:
[0039] An acquisition unit is used to acquire a binocular image and perform depth feature extraction on the binocular image using a trained binocular model to obtain a corresponding disparity map;
[0040] A calculation unit, configured to calculate a size ratio projection coefficient according to the size information of the disparity map and a preset calibration size;
[0041] The three-dimensional reconstruction unit is used to perform three-dimensional reconstruction on the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter to obtain a three-dimensional point cloud map corresponding to the disparity map.
[0042] Another embodiment of the present application further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the binocular depth estimation method as described above.
[0043] The embodiments of the present application have the following beneficial effects:
[0044] The embodiment of the present application proposes a binocular depth estimation method, which first obtains a binocular image, and uses a trained binocular model to extract depth features from the binocular image to obtain a corresponding disparity map; calculates a size ratio projection coefficient based on the size information of the disparity map and a preset calibration size; and performs three-dimensional reconstruction on the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient, and a pre-calibrated target depth parameter to obtain a three-dimensional point cloud map corresponding to the disparity map. The present application uses a new point cloud generation method to avoid the problem of noise introduced by upsampling in the disparity map in the traditional method, thereby improving the accuracy and processing efficiency of depth estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.
[0046] Figure 1A first flow chart of a binocular depth estimation method according to some embodiments of the present application is shown;
[0047] Figure 2 A second flow chart of a binocular depth estimation method according to some embodiments of the present application is shown;
[0048] Figure 3 A third flow chart of a binocular depth estimation method according to some embodiments of the present application is shown;
[0049] Figure 4 A schematic diagram showing the actual position of a camera in a binocular depth estimation method according to some embodiments of the present application is shown;
[0050] Figure 5 A fourth flow chart of a binocular depth estimation method according to some embodiments of the present application is shown;
[0051] Figure 6 A fifth flow chart of a binocular depth estimation method according to some embodiments of the present application is shown;
[0052] Figure 7 A schematic diagram of the structure of a binocular depth estimation system in some embodiments of the present application is shown. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0054] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0055] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0056] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0057] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. Terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0058] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0059] Typically, when implementing binocular depth estimation on low-cost computing devices, a smaller disparity map is usually output, but it needs to be upsampled to the size of the image captured by the camera (larger than the size information of the disparity map), thereby introducing more additional noise and computational burden.
[0060] In addition, in actual industrial environments, depth estimation depends on accurate camera focal length (f) and optical center distance (B) calibration under different equipment and environments, which reduces the accuracy of depth estimation.
[0061] Therefore, in order to solve the above problems, the present application proposes a binocular depth estimation method.
[0062] Please refer to Figure 1 , is a flow chart of a binocular depth estimation method proposed in an embodiment of the present application. Exemplarily, the binocular depth estimation method is applied to an electronic device, for example, the electronic device may be a robot, a car, etc.
[0063] In some embodiments, Figure 1 As shown, the binocular depth estimation method includes:
[0064] S110, acquiring a binocular image, and using a trained binocular model to perform depth feature extraction on the binocular image to obtain a corresponding disparity map.
[0065] The image output by the binocular camera after taking pictures can be used as the binocular image in this embodiment. Of course, in the actual application process, the image output by the camera needs to be distorted to obtain a standard image, so the standard image can also be used as the binocular image in this embodiment. If it is found that there are many irrelevant contents in the standard image after dedistortion, it is necessary to crop it, keep the most important content, remove the unimportant content, improve the speed of subsequent algorithms and reduce time. Therefore, the image obtained after cropping the standard figure obtained by dedistortion can also be used as the binocular image in this embodiment.
[0066] In some embodiments of the binocular depth estimation method, Figure 2 As shown, the binocular image is input into the trained binocular model and the disparity map is output.
[0067] In order to obtain a better disparity map, the improved scheme can be used to train the model to obtain a more optimized binocular model, and then the binocular model is used to infer the disparity map of the binocular image.
[0068] Optionally, the binocular model training process includes:
[0069] S111, input the binocular training image to the student model to be trained and the teacher model respectively, so as to output the student prediction result and the teacher soft label respectively.
[0070] S112, based on the hard labels of the binocular training image, the student prediction results and the teacher soft labels, the distillation loss is calculated.
[0071] Specifically, the same binocular training image is input into the student model to be trained and the teacher model respectively, and the disparity map output by the student model is used as the student prediction result Y stu , the disparity map output by the teacher model is used as the teacher soft label Y soft , the hard label of the binocular training image refers to the real disparity map Y t .
[0072] Alternatively, the formula for calculating distillation loss is:
[0073] L distill =(1-a)·CrossEntropy(Y true ,Y stu )+a·CrossEntropy(Y soft ,Y stu );
[0074] Among them, L distill is the distillation loss, CrossEntropy is the cross entropy loss function, and a is the hyperparameter that weighs the two losses.
[0075] S113, train the student model through distillation loss to obtain a trained initial student model.
[0076] S114, calculating the pruning loss according to the distillation loss and the student weight parameter in the student model, wherein the student weight parameter corresponds to the teacher weight parameter in the teacher model.
[0077] S115, using the branch reduction loss to train the initial student model to obtain a trained binocular model.
[0078] The initial student model obtained after training with the distillation loss can be further compressed to remove redundant connections or parameters in the initial student model, thereby reducing the model size and the amount of calculation, which can improve the calculation speed and accuracy of stereo depth estimation in low-cost devices. Finally, the pruned model is used as the above-mentioned stereo model. Among them, the student weight parameters and the teacher weight parameters are one-to-one corresponding to each other.
[0079] Alternatively, the calculation formula for the branch loss is:
[0080] L prune =L distill +λ·Sparsity;
[0081]
[0082] Among them, L prune is the pruning loss, λ is the hyperparameter for balancing the distillation loss and the pruning loss, Sparsity is the sparsity of the student model, n is the total number of student weight parameters in the student model, and w is the weight parameter.
[0083] S210, calculating a size ratio projection coefficient according to size information of the disparity map and a preset calibration size.
[0084] Before de-distortion, the image output by the camera needs to be calibrated for de-distortion. The calibration content includes calibration image width and calibration image height.
[0085] In some embodiments of the binocular depth estimation method, the preset calibration size includes the calibration image width, and the size ratio projection coefficient is calculated based on the size information of the disparity map and the preset calibration size, including:
[0086] The ratio of the calibration image width to the disparity image width is used as the size ratio projection coefficient.
[0087] Exemplarily, if the preset calibration size is 1280*720 and the size information of the disparity map is 80*48, then the size ratio projection coefficient is 16.
[0088] Optionally, the ratio of the calibration image height to the disparity image height may also be used as a size ratio projection coefficient, wherein the corresponding side length means that the width specified in the calibration image corresponds to the width specified in the disparity image, and the height specified in the calibration image corresponds to the height specified in the disparity image.
[0089] Of course, it should be noted that the height and width are both predetermined and are not differentiated by length.
[0090] S310 , based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter, the disparity map is three-dimensionally reconstructed to obtain a three-dimensional point cloud image corresponding to the disparity map.
[0091] In some embodiments of the binocular depth estimation method, Figure 3 As shown, the target depth parameters are obtained by pre-calibration, including:
[0092] S311, construct a test binocular image and set a number of reference points in the test binocular image, each reference point including corresponding reference point information.
[0093] S312, testing the binocular image according to the test binocular image to obtain a corresponding test disparity map.
[0094] S313: Calculate target depth parameters according to the reference point information and the test disparity map.
[0095] The target depth parameters are obtained by pre-calibration. First, place the camera at a specific location (such as Figure 4 The specific location is the same or similar environment as the environment to be measured later. The image obtained by taking a picture with a camera placed at the specific location is used as the test binocular image in this embodiment. The test binocular image includes the specific point (the actual selected position). The reference point is the point in the test binocular image corresponding to the specific point, such as Figure 4 As shown in the figure, this figure can be regarded as a schematic diagram of the actual position of the camera. A1, A2, A3, B1, B2, and B3 are all actual specific points. After the binocular camera takes a picture, the actual points will be displayed in the test binocular image test binocular image, which are a1, a2, a3, b1, b2, and b3 respectively. The reference point information includes the depth value of each reference point (the vertical distance from the actual point to the camera). For example, the actual depth of A1 is L1, the actual depth of A2 is L2, and so on.
[0096] Optionally, the test binocular image is input into the binocular model to obtain a corresponding test disparity map.
[0097] In some embodiments of the binocular depth estimation method, Figure 5 As shown, the reference point information includes the real depth values of several reference points; according to the reference point information and the test disparity map, the target depth parameters are calculated, including:
[0098] S3131, obtaining a test disparity value corresponding to the reference point in the test disparity map.
[0099] S3132: Calculate the depth parameter of the reference point according to the test disparity value and the true depth value.
[0100] In current depth estimation schemes, the calibration relies on accurate camera focal length f and optical center distance B. In actual industrial environments, this calibration is difficult to achieve accurately, so measuring f and B alone is not accurate enough. Therefore, according to the formula It can be seen that the product of f and B, that is, the value of the depth parameter f*B, can be calculated using the real depth value Z and the disparity value D of each reference point. However, the depth parameter obtained using one reference point is not accurate enough. Therefore, several specific reference points are used to perform calculations separately to obtain the depth parameter of each reference point to calculate the final actual depth parameter. The depth parameter calculated in this way is closer to the actual depth parameter.
[0101] S3133: Calculate the target depth parameter based on the depth parameter of each reference point.
[0102] Optionally, the average value of the depth parameter of each reference point may be selected as the target depth parameter. Of course, other calculation methods may also be used to obtain the target depth parameter, which is not limited here.
[0103] Exemplarily, as shown in the figure, the depth parameters corresponding to the six specific points A1, A2, A3, B1, B2, and B3 are calculated, which are α1, α2, α3, α4, α5, and α6 respectively. The final target depth parameter is
[0104] In some embodiments of the binocular depth estimation method, the disparity information includes the disparity value and coordinates of each pixel in the disparity map; based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter, the disparity map is three-dimensionally reconstructed, including:
[0105] The depth value of the corresponding pixel is calculated using the depth value of the pixel in the disparity map and the target depth parameter.
[0106] Based on the depth value, coordinate information, size ratio projection coefficient and camera calibration parameters of the pixel point, the horizontal and vertical coordinates of the corresponding pixel point projected in the three-dimensional coordinate system are calculated.
[0107] According to the depth value and horizontal and vertical coordinates of the pixel point, the corresponding point cloud is obtained.
[0108] Each pixel in the disparity map is mapped into a point cloud, and all point clouds are synthesized into a three-dimensional point cloud map. In this embodiment, the disparity map does not need to be upsampled, and the mapped three-dimensional point cloud map is directly used for various subsequent operations, such as obstacle avoidance. This avoids the additional noise added during the upsampling process, which causes errors in subsequent operations, and also avoids the computational burden caused by upsampling. Among them, the camera calibration parameters include the camera principal point and the camera focal length.
[0109] Optionally, the calculation formula for mapping into a three-dimensional point cloud is:
[0110] Z j =α / D j ;
[0111] x=(β*W i -C x )*Z j / f x ;
[0112] y=(β*H i -C y )*Z j / f y ;
[0113] Specifically, C x is the x-axis coordinate of the camera principal point, C y is the y-axis coordinate of the camera principal point, where the principal point is the intersection of the binocular image and the camera optical axis, which can be selected as the center of the binocular image, that is, the corresponding horizontal and vertical coordinates are half of the corresponding side length of the binocular image. i is the width coordinate of the i-th pixel in the binocular image, H i is the high coordinate of the i-th pixel in the binocular image. j is the depth value of the jth pixel in the disparity map, α is the target depth parameter, D j is the disparity value of the j-th pixel in the disparity map. x is the horizontal coordinate of the j-th pixel projected in the three-dimensional coordinate system, y is the vertical coordinate of the i-th pixel projected in the three-dimensional coordinate system; β is the size ratio projection coefficient. f x is the number of pixels of the camera focal length in the x-axis direction, f y is the focal length of the camera in the y direction. The larger the focal length, the higher the magnification of the image. There is a corresponding relationship between the i-th pixel point in the binocular image and the j-th pixel point in the disparity map.
[0114] In some embodiments of the binocular depth estimation method, Figure 6 As shown, each point cloud in the three-dimensional point cloud image corresponds to actual position distance information, and the method further includes:
[0115] S410, dividing each point cloud into different interval segments according to the actual position distance information.
[0116] Specifically, each point cloud in the 3D point cloud has a corresponding actual position distance, which indicates the actual distance between the actual point corresponding to the point cloud and the device (such as a camera, robot, etc.), and is divided into different intervals according to the actual position distance. For example, it is divided into 0-0.6m, 0.6-1.2m, etc., and there is no limitation here, and it can also be divided into other intervals.
[0117] S420: Divide each interval into multiple sub-areas according to the distribution of the point cloud.
[0118] Specifically, there will be multiple point clouds distributed in the same interval segment, some of which are several point clouds clustered together, and some are discrete. They are divided into multiple sub-areas according to the clustering of the point clouds. Point clouds that are obviously clustered in a pile can be divided into the same sub-area.
[0119] S430: taking the sub-region with the largest number of point clouds in the same interval as the obstacle region.
[0120] Specifically, the sub-region with the largest number of point clouds in each interval segment is used as the obstacle region. When multiple obstacle regions are identified, the obstacle region in the smallest (closest) interval segment is used for the current risk avoidance operation.
[0121] The embodiment of the present application proposes a binocular depth estimation method, which first obtains a corresponding disparity map based on a binocular image; then obtains a preset calibration size of the binocular image; then calculates a size ratio projection coefficient based on the size information of the disparity map and the preset calibration size; finally, maps the disparity map into a three-dimensional point cloud map according to the size ratio projection coefficient and the target depth parameter. The present application uses a new point cloud generation method to avoid the problem of noise introduced by upsampling in the disparity map in the traditional method, thereby improving the accuracy and processing efficiency of depth estimation.
[0122] In addition, this application uses a unique optimization algorithm to optimize the binocular model and uses it on low-cost computing resource devices. It not only reduces the operation parameters and the amount of operation, but also improves the accuracy and reduces the difficulty of deploying the depth estimation system in actual industrial applications. In the depth estimation process, because it is calibrated in a more optimal way, a more accurate f*B value (target depth parameter) is obtained. This solution is not limited by the complex industrial environment. At the same time, it can also obtain the appropriate f*B value according to different industrial environments, which improves the flexibility and ease of use of the depth estimation system.
[0123] Another embodiment of the present application further provides a binocular depth estimation system 500, such as Figure 7 As shown, the system 500 includes:
[0124] The acquisition unit 510 is used to acquire a binocular image and perform depth feature extraction on the binocular image using a trained binocular model to obtain a corresponding disparity map.
[0125] The calculation unit 520 is used to calculate the size ratio projection coefficient according to the size information of the disparity map and the preset calibration size.
[0126] The 3D reconstruction unit 530 is used to perform 3D reconstruction on the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter to obtain a 3D point cloud image corresponding to the disparity map.
[0127] In some embodiments of the binocular depth estimation system 500, the binocular depth estimation system 500 also includes an obstacle avoidance unit; the obstacle avoidance unit is used to divide each point cloud into different interval segments according to the actual position distance information; within each interval segment, it is divided into multiple sub-areas according to the distribution of the point clouds; the sub-area with the largest number of point clouds in the same interval segment is used as an obstacle area; wherein each point cloud in the three-dimensional point cloud map corresponds to the actual position distance information.
[0128] Another embodiment of the present application further proposes an electronic device, including a storage unit and a processing unit, wherein the storage unit stores a computer program, and the processing unit executes the steps of the above-mentioned binocular depth estimation method by calling the computer program stored in the storage unit.
[0129] Specifically, the electronic device may be a robot, a car, etc.
[0130] Another embodiment of the present application further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the above-mentioned binocular depth estimation method.
[0131] It can be understood that the method steps of this embodiment correspond to the binocular depth estimation method in the above embodiment, wherein the options of the above binocular depth estimation method are also applicable to this embodiment and will not be repeated here.
[0132] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0134] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0135] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A binocular depth estimation method, characterized in that: include: Acquire a binocular image, and use a trained binocular model to perform depth feature extraction on the binocular image to obtain a corresponding disparity map; Calculating a size ratio projection coefficient according to the size information of the disparity map and a preset calibration size; Based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter, the disparity map is three-dimensionally reconstructed to obtain a three-dimensional point cloud map corresponding to the disparity map.
2. The binocular depth estimation method according to claim 1, characterized in that: The target depth parameter is obtained by pre-calibration, including: Constructing a test binocular image and setting a plurality of reference points in the test binocular image, each of the reference points including corresponding reference point information; According to the test binocular image, a corresponding test disparity image is obtained; The target depth parameter is calculated according to the reference point information and the test disparity map.
3. The binocular depth estimation method according to claim 2, characterized in that: The reference point information includes a real depth value of the reference point; and the target depth parameter is calculated according to the reference point information and the test disparity map, including: Obtain a test disparity value corresponding to the reference point in the test disparity map; Calculating a depth parameter of the reference point according to the test disparity value and the true depth value; The target depth parameter is calculated based on the depth parameter of each reference point.
4. The binocular depth estimation method according to claim 1, characterized in that: The preset calibration size includes a calibration image width; the size ratio projection coefficient is calculated according to the size information of the disparity map and the preset calibration size, including: The ratio of the width of the calibration image to the width of the disparity image is used as the size ratio projection coefficient.
5. The binocular depth estimation method according to claim 1, characterized in that: The disparity information includes the disparity value and coordinates of each pixel in the disparity map; and the three-dimensional reconstruction of the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter includes: Using the depth value of the pixel point in the disparity map and the target depth parameter, calculate the depth value of the corresponding pixel point; Based on the depth value, coordinate information, size ratio projection coefficient and camera calibration parameters of the pixel point, the horizontal and vertical coordinates of the projection of the corresponding pixel point in the three-dimensional coordinate system are calculated; According to the depth value and the horizontal and vertical coordinates of the pixel point, the corresponding point cloud is obtained.
6. The binocular depth estimation method according to claim 5, characterized in that: The camera calibration parameters include the camera principal point and the camera focal length. The calculation formula for three-dimensional reconstruction of the disparity map includes: Z j =α / D j ; x=(β*W i -C x )*Z j / f x ; y=(β*H i -C y )*Z j / f y ; Among them, C x is the x-axis coordinate of the camera principal point, C y is the y-axis coordinate of the camera's principal point; W i is the width coordinate of the i-th pixel in the binocular image, H i is the high coordinate of the i-th pixel in the binocular image; Z j is the depth value of the jth pixel in the disparity map, α is the target depth parameter, and D j is the disparity value of the j-th pixel in the disparity map; x is the horizontal coordinate of the j-th pixel projected in the three-dimensional coordinate system, y is the vertical coordinate of the i-th pixel projected in the three-dimensional coordinate system; β is the size ratio projection coefficient; f x is the number of pixels of the camera focal length in the x-axis direction, f y is the focal length of the camera in the y direction; wherein, there is a corresponding relationship between the i-th pixel point in the binocular image and the j-th pixel point in the disparity map.
7. The binocular depth estimation method according to claim 1, characterized in that: The binocular model training process includes: Input the binocular training images into the student model to be trained and the teacher model respectively, so as to output the student prediction results and the teacher soft labels respectively; Based on the hard labels of the binocular training image, the student prediction results and the teacher soft labels, a distillation loss is calculated; Train the student model by using the distillation loss to obtain a trained initial student model; Calculating a pruning loss according to the distillation loss and a student weight parameter in the student model, wherein the student weight parameter corresponds to a teacher weight parameter in the teacher model; The initial student model is trained using the pruning loss to obtain the trained binocular model.
8. The binocular depth estimation method according to claim 1, characterized in that: Each point cloud in the three-dimensional point cloud image corresponds to actual position distance information, and the method further includes: Dividing each point cloud into different interval segments according to the actual position distance information; In each of the intervals, the intervals are divided into a plurality of sub-areas according to the distribution of the point cloud; The sub-region with the largest number of point clouds in the same interval segment is taken as the obstacle region.
9. A binocular depth estimation system, characterized in that: include: An acquisition unit is used to acquire a binocular image and perform depth feature extraction on the binocular image using a trained binocular model to obtain a corresponding disparity map; A calculation unit, configured to calculate a size ratio projection coefficient according to the size information of the disparity map and a preset calibration size; The three-dimensional reconstruction unit is used to perform three-dimensional reconstruction on the disparity map based on the disparity information of the disparity map, the size ratio projection coefficient and the pre-calibrated target depth parameter to obtain a three-dimensional point cloud map corresponding to the disparity map.
10. An electronic device, characterized in that: It comprises a storage unit and a processing unit, wherein the storage unit stores a computer program, and the processing unit executes the steps of the binocular depth estimation method according to any one of claims 1 to 8 by calling the computer program stored in the storage unit.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the binocular depth estimation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Underwater environment three-dimensional reconstruction method based on binocular vision
CN112132958A
Three-dimensional reconstruction method and device, electronic equipment and computer readable storage medium
CN116597098A
SYSTEM AND METHOD FOR FORMING AND REPRODUCING A THREE-DIMENSIONAL VIDEO IMAGE
RU2009110511A
Methods and systems for binocular stereo vision
US20180322648A1
