A zooming head two-eye distance measuring method and system based on DH coordinate system

By using the DH coordinate system for gimbal ranging, an initial positional relationship is established through a single calibration, and the intrinsic parameter matrix is ​​updated in real time. This solves the problems of cumbersome gimbal camera calibration and insufficient accuracy in existing technologies, and achieves fast and accurate binocular ranging.

CN115496811BActive Publication Date: 2026-01-02HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210970424.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-12
Publication Date
2026-01-02
Estimated Expiration
2042-08-12

AI Technical Summary

Technical Problem

In existing binocular ranging technology, the calibration process of the gimbal camera is cumbersome and lacks accuracy. In particular, multiple calibrations are required when zooming, and different gimbals need to refit the mathematical model, which lacks universality.

Method used

The DH coordinate system is adopted. The initial position relationship of the gimbal camera is established through one calibration. The DH coordinate system is constructed, the intrinsic parameter matrix is ​​updated in real time, and the kinematic equations of the DH coordinate system are used for real-time ranging. The linear fitting method is abandoned to realize real-time ranging of the binocular camera.

Benefits of technology

It enables fast and accurate ranging for gimbal cameras, is versatile, requires no multiple calibrations, is applicable to different gimbal models, and updates the intrinsic parameter matrix in real time during zooming, improving ranging accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115496811B_ABST
    Figure CN115496811B_ABST
Patent Text Reader

Abstract

The application relates to a DH coordinate system-based holder binocular distance measuring method and system, which comprises the following steps: calibrating a holder camera to obtain an internal parameter matrix of the camera; constructing a DH coordinate system according to the position relationship of the camera relative to the holder base, and calculating the homogeneous transformation matrix of the camera relative to the holder base; using the homogeneous transformation matrix between the two holder bases and the homogeneous transformation matrix of the camera relative to the holder base, and through matrix multiplication, obtaining the homogeneous transformation matrix between the two cameras, and then obtaining the rotation matrix and the translation matrix between the two cameras; using the rotation matrix, the translation matrix and the internal parameter matrix of the two cameras to perform stereo correction on a target image; and then performing feature point matching and disparity calculation on the depth map corresponding to the target image. The application discards the fitting mode, obtains the initial position between the two cameras through initial calibration, establishes a kinematics equation according to the DH coordinate, and thus realizes real-time distance measurement of the binocular camera.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of binocular stereo vision technology, and in particular to a zooming gimbal binocular distance measuring method and system based on a DH coordinate system. BACKGROUND

[0002] Machine vision technology is widely used in mobile robots, semi-automatic mobile robots, automatic driving and other fields, and binocular vision distance measurement based on images has the advantages of low cost and simple equipment, and occupies an increasingly important position in the field of machine vision. Binocular distance measurement technology simulates the human eye to observe objects and obtains object depth information through a series of processing methods such as feature point recognition. With the rapid development of mobile robots and automatic driving, there are higher and higher requirements for the camera field of view range and observation angle in binocular distance measurement technology.

[0003] Most existing binocular distance measurement methods use two single cameras or one binocular camera scheme. By calibrating the cameras, the initial relative position between the two cameras is obtained. When two cameras simultaneously capture an object in a certain direction, stereo rectification and image matching are used to calculate the disparity map, thereby obtaining the depth information of the image. However, because the camera position is fixed in this scheme, binocular distance measurement can only be performed in a certain direction of the surrounding environment. Moreover, when the camera zooms in, the intrinsic matrix changes, and re-calibration is required for binocular distance measurement. To solve the above problems, a gimbal camera capable of horizontal and pitch rotation is used as an image acquisition device. The gimbal camera can control the camera to move and observe objects in any direction, and can zoom in for local magnification. In order to use the gimbal camera for binocular distance measurement, real-time calibration of the gimbal camera is required, which is not practical for mobile robots or automatic driving. Some current solutions use a linear fitting function method, which changes the measurement distance and angle of the gimbal camera and changes the camera focal length in segments for calibration. After repeating the above steps and obtaining multiple sets of calibration data, a linear fitting mathematical model is obtained, which eliminates the need for repeated calibration during actual shooting and solves the gimbal pose problem during binocular measurement. However, the calibration results obtained by each rotation of the gimbal are linearly interpolated, and the accuracy is not sufficient. Moreover, a large number of calibration times are required to fit the mathematical model, which is cumbersome and lacks commonality. Different gimbals need to be re-fitted. SUMMARY

[0004] The present application provides a zooming gimbal distance measuring method and system based on a DH coordinate. This method discards the fitting method and obtains the initial position between the two cameras through an initial calibration. According to the DH coordinate, a kinematic equation is established to update the intrinsic matrix between the two cameras in real time, thereby realizing real-time distance measurement of the binocular camera.

[0005] The technical solution of the present application to solve the above technical problems is as follows:

[0006] In a first aspect, the present application provides a DH coordinate system-based gimbal binocular distance measuring method, comprising:

[0007] Calibrate the cameras on the two gimbals to obtain the intrinsic parameter matrices of the two cameras;

[0008] According to the positional relationship of the two cameras relative to the respective gimbal bases, a DH coordinate system is constructed, and based on the DH coordinate system, the homogeneous transformation matrices of the two cameras relative to the respective gimbal bases are calculated;

[0009] Using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrices of the two cameras relative to the respective gimbal bases, the homogeneous transformation matrix between the two cameras is obtained by matrix multiplication, and the rotation matrix and the translation matrix between the two cameras are obtained according to the homogeneous transformation matrix between the two cameras;

[0010] Using the rotation matrix and the translation matrix between the two cameras and the intrinsic parameter matrices of the two cameras, the target images captured by the two cameras are rectified stereoscopically;

[0011] For the rectified target images, the SGBM algorithm is used for feature point matching and disparity calculation to obtain the depth map corresponding to the target images.

[0012] Further, based on the DH coordinate system, the homogeneous transformation matrices of the two cameras relative to the respective gimbal bases are calculated, comprising:

[0013] According to the link transformation matrix formula, the homogeneous transformation matrices of the rotation axis I relative to the base coordinate system, the rotation axis II relative to the rotation axis I, and the camera coordinate system relative to the rotation axis II are calculated respectively; the rotation axis I in the DH coordinate system is used to control the horizontal rotation of the camera, and the rotation axis II is used to control the pitch rotation of the camera;

[0014] The homogeneous transformation matrices of the rotation axis I relative to the base coordinate system, the rotation axis II relative to the rotation axis I, and the camera coordinate system relative to the rotation axis II are multiplied to obtain the homogeneous transformation matrix of the camera relative to the gimbal base.

[0015] Further, the method further comprises, before rectifying the target images stereoscopically, if any camera zooms, updating the intrinsic parameter matrix of the camera that zooms, and then using the updated intrinsic parameter matrix to participate in the stereoscopic rectification of the target images.

[0016] Further, updating the intrinsic parameter matrix of the camera that zooms comprises:

[0017] A zoom ratio size r of the camera is acquired, and an intrinsic matrix of the camera is updated in real time according to a relationship between the zoom ratio r of the camera, a field of view FOV, and a focal length f of the camera, as shown in the following formula:

[0018]

[0019]

[0020] In the above formula, FOV' h represents a horizontal field of view before the focal length changes, FOV' v represents a vertical field of view before the focal length changes, W is the width of the plane, and H is the height of the plane.

[0021] Further, a homogeneous transformation matrix between the two gimbal bases and a homogeneous transformation matrix of the two cameras relative to the respective gimbal bases are used to obtain a homogeneous transformation matrix between the two cameras through matrix multiplication, as shown in the following formula:

[0022]

[0023]

[0024]

[0025]

[0026] In the formula, subscript l represents the left gimbal camera, subscript r represents the right gimbal camera, represents a homogeneous transformation matrix of the coordinate system n relative to the coordinate system n-1, T b represents a homogeneous transformation matrix between the two gimbal bases, and T represents a homogeneous transformation matrix between the two cameras.

[0027] Further, a Bouguet algorithm is used to perform stereo correction on the target images captured by the two cameras.

[0028] In a second aspect, the application provides a gimbal binocular distance measuring system based on a DH coordinate system, comprising:

[0029] A calibration module calibrates the cameras on the two gimbals to obtain intrinsic matrices of the two cameras;

[0030] A first matrix calculation module constructs a DH coordinate system according to the positional relationship of the two cameras relative to the respective gimbal bases, and calculates homogeneous transformation matrices of the two cameras relative to the respective gimbal bases based on the DH coordinate system;

[0031] A second matrix calculation module obtains a homogeneous transformation matrix between the two cameras by matrix multiplication of a homogeneous transformation matrix between the two gimbal bases and homogeneous transformation matrices of the two cameras relative to the respective gimbal bases, and obtains a rotation matrix and a translation matrix between the two cameras according to the homogeneous transformation matrix;

[0032] A correction module performs stereo correction on target images captured by the two cameras by using the rotation matrix, the translation matrix, and intrinsic parameter matrices of the two cameras.

[0033] A depth calculation module performs feature point matching and disparity calculation on the corrected target images by using an SGBM algorithm to obtain a depth map corresponding to the target images.

[0034] In a third aspect, the present application provides an electronic device, comprising:

[0035] A memory for storing a computer software program;

[0036] A processor for reading and executing the computer software program, thereby realizing the method for gimbal binocular distance measurement based on a DH coordinate system according to the first aspect of the present application.

[0037] In a fourth aspect, the present application provides a non-transitory computer readable storage medium, wherein the storage medium stores a computer software program for realizing the method for gimbal binocular distance measurement based on a DH coordinate system according to the first aspect of the present application.

[0038] The present application has the following advantages:

[0039] 1) Only one initial calibration is needed, and no multiple calibrations are needed to obtain a large amount of data for mathematical model fitting. The method is universal and can be used for different models of gimbals. No fitting or linear interpolation is performed, and the distance measurement result is more accurate and faster according to the strict derivation of the principle.

[0040] 2) Real-time updating of the intrinsic parameters of the zoom camera is realized, so that the gimbal can observe the depth of objects in different magnifications in any direction of the surrounding environment. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 A method for gimbal binocular distance measurement based on a DH coordinate system according to an embodiment of the present application is shown in the flowchart;

[0042] Figure 2 A rotation model structure diagram of a gimbal camera according to an embodiment of the present application is shown in the diagram;

[0043] Figure 3 A diagram showing the alignment of images before and after correction according to an embodiment of the present application is shown in the diagram;

[0044] Figure 4 A DH coordinate system-based method provided for embodiments of the present invention

[0045] A schematic diagram of the gimbal binocular ranging system;

[0046] Figure 5 A schematic diagram of an embodiment of the electronic device provided in this invention;

[0047] Figure 6 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention. Detailed Implementation

[0048] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0049] like Figure 1 As shown, this embodiment of the invention provides a binocular ranging method for pan-tilt units based on the DH coordinate system, including the following steps:

[0050] S100 calibrates the cameras on the two gimbals to obtain the intrinsic parameter matrices of the two cameras.

[0051] This example uses a high-precision checkerboard pattern as the marker for visual measurement, with 9*6 corner points. Two gimbal cameras are used as image acquisition devices, with an image size of 640*360. The Zhang Zhengyou camera calibration method is used to perform dual-target calibration on the two gimbals. The parameters that need to be calibrated include the intrinsic parameters of the two gimbal cameras, the rotation and translation matrix between the two gimbals, and the distortion parameters of the two gimbal cameras.

[0052] In this embodiment, the intrinsic parameter matrices and distortion coefficients of the two gimbal cameras obtained by measurement are shown below:

[0053]

[0054]

[0055] d1=[-0.28029 -0.40925 -7.1315e-04 2.0229e-03 -8.7911e-01]

[0056] d2=[-0.28268 -0.10393 -1.1139e-03 1.5499e-03 -2.2555e+01]

[0057] K and d are the intrinsic parameter matrix and distortion coefficient of the gimbal camera, respectively.

[0058] S200, based on the positional relationship between the two cameras relative to their respective gimbal bases, constructs a DH coordinate system, such as... Figure 2The rotation axis I of the base is taken as the first Z axis, the rotation axis II of the gimbal eccentricity is taken as the second Z axis, and the part of the camera site distance from the rotation axis II is taken as the third Z axis. The rotation axis I is responsible for controlling the horizontal rotation of the camera, and the rotation axis II controls the pitch rotation of the camera.

[0059] Based on the DH coordinate system, the homogeneous matrices of the rotation axis I relative to the base coordinate, the rotation axis II relative to the rotation axis I, and the camera coordinate system relative to the rotation axis II are respectively solved according to the link transformation matrix formula. The link transformation matrix is as follows:

[0060]

[0061]

[0062] The transformation matrix of the coordinate system {i} relative to {i-1} is represented. That is, each two consecutive link coordinate systems are connected by four parameters α i-1 , a i-1 , d i , θ i , and the meanings of the four parameters are as follows:

[0063] α i-1 : rotate α i-1 angle around x i-1 axis;

[0064] a i-1 : move a i-1 along x i-1 axis;

[0065] d i : rotate θ i angle around z i axis;

[0066] θ i : move d i along z i axis.

[0067] The DH parameter table is established with the gimbal base as the base coordinate system, and then the homogeneous coordinate transformation matrix between the nth coordinate system relative to the n-1th coordinate system is listed according to the constructed DH parameter table. The homogeneous coordinate transformation matrix between each adjacent coordinate system is as follows:

[0068]

[0069]

[0070]

[0071] wherein, R represents the homogeneous transformation matrix of coordinate system 1 relative to coordinate system 2, SIZE1 and SIZE2 represent the two eccentric distances of the PTZ camera relative to the PTZ base respectively.

[0072] In the embodiment, the configured DH parameter table is as follows:

[0073]

[0074] Rotating the heading angle and the pitch angle of one of the PTZs by 30 degrees respectively, the homogeneous transformation matrix is as shown in the following figure:

[0075]

[0076]

[0077]

[0078] S300, using the homogeneous transformation matrix between the two PTZ bases and the homogeneous transformation matrix of the two cameras relative to the respective PTZ bases, the homogeneous transformation matrix between the two cameras is obtained by matrix multiplication, and the rotation matrix and the translation matrix between the two cameras are obtained according to the homogeneous transformation matrix.

[0079] The multiplication formula is as follows:

[0080]

[0081]

[0082]

[0083]

[0084] In the formula, subscript l represents the left PTZ camera, subscript r represents the right PTZ camera, R represents the homogeneous transformation matrix of coordinate system n relative to coordinate system n-1, T b R represents the homogeneous transformation matrix between the two PTZ bases, T represents the homogeneous transformation matrix between the two cameras.

[0085] In the embodiment, the homogeneous transformation matrix of PTZ camera 1 relative to PTZ camera 2 is as follows:

[0086]

[0087] S400, if zooming occurs in any camera, the intrinsic matrix of the camera that zooms is updated.

[0088] Specifically, a camera zoom ratio size r is acquired, and a camera intrinsic matrix is updated in real time according to a relationship between the camera zoom ratio r and a field of view FOV, and a relationship between the field of view FOV and a camera focal length f, as shown in the following formula:

[0089]

[0090]

[0091] In the above formula, FOV' h represents a horizontal field of view before the focal length changes, FOV' v represents a vertical field of view before the focal length changes, W is a width of a plane, H is a height of the plane, f x = f / dx, f y = f / dy, dx and dy are sizes of one pixel.

[0092] In the embodiment, one camera or two cameras locally magnify an observed object, for example, an object is observed at a 4x zoom ratio.

[0093]

[0094] S500, a stereoscopic correction is performed on target images captured by the two cameras by using a rotation matrix and a translation matrix between the two cameras and the updated intrinsic matrix of the two cameras.

[0095] The Bouguet algorithm is used for the stereoscopic correction, that is, each camera is rotated by half to achieve face alignment, and the picture polar line is horizontal and the pole point is located at infinity, so as to achieve line alignment between the two cameras, and the calculation formula is as follows:

[0096] R l = R rect ·r l ,R r = R rect ·r r

[0097]

[0098]

[0099] wherein R rect is a matrix constructed to convert the pole point to infinity, P hl and P hr , P vl and P vr are re-projection matrices of the left and right cameras in the horizontal and vertical directions. After the correction, the binocular images should be face-aligned and line-aligned, as shown in Figure 3 .

[0100] After the re-projection matrix of the left and right cameras is calculated, the image is corrected and mapped, that is, two parallel planes are obtained, and the calculation formula is as follows:

[0101]

[0102] After the world coordinates (X, Y, Z) are multiplied by the re-projection matrix, the pixel coordinates (x, y) are obtained.

[0103] In the embodiment, the re-projection matrix S obtained after the stereo correction is as follows:

[0104]

[0105] S600, for the corrected target image, the SGBM algorithm is used for feature point matching and disparity calculation to obtain the depth map corresponding to the target image.

[0106] The semi-global fast matching algorithm (SGBM) is used, the image is processed by using the sobel operator, the sum of the absolute values of the gray differences (SAD) of all pixels in the neighborhood of the pixel to be matched is used as the cost function, and the sobel operator and the SAD cost are as follows:

[0107] Sobel (x, y) = 2 [P (x + 1, y) - P (x - 1, y)] + P (x + 1, y - 1)

[0108] -P (x - 1, y - 1) + P (x + 1, y + 1) - P (x - 1, y + 1)

[0109]

[0110] x, y respectively represent the pixel coordinates of the pixel points of the original image. The cost function is constructed for feature point matching, the pixel left of the matched feature points is obtained, and the depth information is obtained by disparity calculation. The disparity calculation formula is as follows:

[0111]

[0112] d = xl - x

[0113]

[0114] According to the disparity d and the baseline T between the two pan-tilt cameras, the depth z is calculated. Thus, after the different disparities of the matched feature points are calculated, different gray values are assigned to the pixel points according to the disparity, and the depth map is obtained.

[0115] The above technical scheme of the present application can achieve the following beneficial effects compared with the prior art:

[0116] 1) Only need to carry out initial calibration, no need to carry out multiple calibration to obtain a large amount of data for fitting of mathematical model. And it is universal, and can be used for different models of gimbals. Without fitting, linear interpolation is carried out according to strict derivation of principle, and the result is more accurate and fast.

[0117] 2) Real-time updating of the internal parameters of the zoom camera is realized, so that the gimbal can observe the depth of objects in different magnifications in any direction of the surrounding environment.

[0118] As shown in Figure 4 , the embodiment of the application also provides a gimbal binocular ranging system based on a DH coordinate system, which comprises:

[0119] The calibration module calibrates the cameras on the two gimbals to obtain the internal parameter matrices of the two cameras;

[0120] The first matrix calculation module constructs a DH coordinate system according to the positional relationship of the two cameras relative to the respective gimbal bases, and calculates the homogeneous transformation matrices of the two cameras relative to the respective gimbal bases based on the DH coordinate system;

[0121] The second matrix calculation module obtains the homogeneous transformation matrix between the two cameras by matrix multiplication using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrices of the two cameras relative to the respective gimbal bases, and obtains the rotation matrix and the translation matrix between the two cameras according to the homogeneous transformation matrix;

[0122] The correction module performs stereoscopic correction on the target images captured by the two cameras using the rotation matrix, the translation matrix and the internal parameter matrices of the two cameras;

[0123] The depth calculation module performs feature point matching and disparity calculation on the corrected target images using the SGBM algorithm to obtain the depth map corresponding to the target images.

[0124] Please refer to Figure 5 , Figure 5 The embodiment of the electronic device provided by the embodiment of the application is shown in the figure. As shown in Figure 5 , the embodiment of the application provides an electronic device 500, which comprises a memory 510, a processor 520 and a computer program 511 stored in the memory 520 and capable of running on the processor 520, and the processor 520 implements the following steps when executing the computer program 511:

[0125] S100, calibrate the cameras on the two gimbals to obtain the internal parameter matrices of the two cameras;

[0126] S200, a DH coordinate system is constructed according to the positional relationship of the two cameras relative to the respective gimbal bases, and a homogeneous transformation matrix of the two cameras relative to the respective gimbal bases is calculated based on the DH coordinate system;

[0127] S300, a homogeneous transformation matrix between the two cameras is obtained by matrix multiplication using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases, and a rotation matrix and a translation matrix between the two cameras are obtained according to the homogeneous transformation matrix;

[0128] S400, if zooming occurs in any camera, the intrinsic matrix of the camera that zooms is updated;

[0129] S500, the target images captured by the two cameras are rectified using the rotation matrix, the translation matrix and the updated intrinsic matrix of the two cameras.

[0130] Please refer to Figure 6 , Figure 6 An embodiment of a computer readable storage medium provided by the embodiment of the application is shown in the figure. Figure 6 As shown in the figure, the embodiment provides a computer readable storage medium 600, which stores a computer program 611, and the computer program 611 is executed by a processor to implement the following steps:

[0131] S100, calibrate the cameras on the two gimbals to obtain the intrinsic matrix of the two cameras;

[0132] S200, a DH coordinate system is constructed according to the positional relationship of the two cameras relative to the respective gimbal bases, and a homogeneous transformation matrix of the two cameras relative to the respective gimbal bases is calculated based on the DH coordinate system;

[0133] S300, a homogeneous transformation matrix between the two cameras is obtained by matrix multiplication using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases, and a rotation matrix and a translation matrix between the two cameras are obtained according to the homogeneous transformation matrix;

[0134] S400, if zooming occurs in any camera, the intrinsic matrix of the camera that zooms is updated;

[0135] S500, the target images captured by the two cameras are rectified using the rotation matrix, the translation matrix and the updated intrinsic matrix of the two cameras.

[0136] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0137] Those skilled in the art will appreciate that embodiments of the present application can be readily used as software, hardware, or a combination of software and hardware. In one

[0138] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.

[0139] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.

[0141] While preferred embodiments of the application have been described, additional variations and modifications can be made to these embodiments by those skilled in the art once they have the benefit of the foregoing description. Therefore, the appended claims are intended to cover all such variations and modifications as falling within the scope of the application.

[0142] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A gimbal binocular ranging method based on a DH coordinate system, characterized in that, The method comprises the following steps: Calibrate the two cameras on the two gimbals to obtain the intrinsic matrix of the two cameras; According to the positional relationship of the two cameras relative to the respective gimbal bases, a DH coordinate system is constructed, and based on the DH coordinate system, the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases is calculated; Using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases, the homogeneous transformation matrix between the two cameras is obtained through matrix multiplication, and the rotation matrix and the translation matrix between the two cameras are obtained according to the homogeneous transformation matrix between the two cameras; Using the rotation matrix, the translation matrix between the two cameras and the intrinsic matrix of the two cameras, the target images taken by the two cameras are rectified stereoscopically; Using the SGBM algorithm, the feature point matching and the disparity calculation are performed on the rectified target images to obtain the depth map corresponding to the target images.

2. The method of claim 1, wherein, Based on the DH coordinate system, the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases is calculated, comprising: According to the link transformation matrix formula, the homogeneous transformation matrix of the rotation axis I relative to the base coordinate system, the rotation axis II relative to the rotation axis I and the camera coordinate system relative to the rotation axis II is calculated respectively; the rotation axis I in the DH coordinate system is used to control the horizontal rotation of the camera, and the rotation axis II is used to control the pitching rotation of the camera; The homogeneous transformation matrix of the rotation axis I relative to the base coordinate system, the rotation axis II relative to the rotation axis I and the camera coordinate system relative to the rotation axis II is multiplied to obtain the homogeneous transformation matrix of the camera relative to the gimbal base.

3. The method of claim 1, wherein, Further comprising, before rectifying the target images stereoscopically, if any camera zooms, the intrinsic matrix of the camera zooming is updated, and then the updated intrinsic matrix is used to participate in the stereoscopic rectification of the target images.

4. The method of claim 3, wherein, The intrinsic matrix of the camera zooming is updated, comprising: Obtaining the zoom ratio r of the camera, and updating the intrinsic matrix of the camera in real time according to the relationship between the camera ratio r and the field of view angle FOV, the field of view angle FOV and the camera focal length f, as shown in the following formula: In the above equation, FOV h represents the horizontal field of view before the focal length change, FOV v represents the vertical field of view before the focal length change, W is the width of the plane of the image, and H is the height of the plane of the image.

5. The method of claim 1, wherein, Using the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases, the homogeneous transformation matrix between the two cameras is obtained through matrix multiplication, as shown below: wherein subscript I denotes the left pan-tilt camera and subscript r denotes the right pan-tilt camera, denotes the homogeneous transformation matrix of coordinate system n with respect to coordinate system n-1, T b denotes the homogeneous transformation matrix between the two pan-tilt bases, T denotes the homogeneous transformation matrix between the two cameras.

6. The method of claim 1, wherein, The Bouguet algorithm is used to rectify the target images taken by the two cameras stereoscopically.

7. A DH coordinate system based pan-tilt binocular ranging system, characterized in that, The method comprises the following steps: A calibration module calibrates the two cameras on the two gimbals to obtain the intrinsic matrix of the two cameras; A first matrix calculation module constructs a DH coordinate system according to the positional relationship of the two cameras relative to the respective gimbal bases, and calculates the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases based on the DH coordinate system; A second matrix calculation module uses the homogeneous transformation matrix between the two gimbal bases and the homogeneous transformation matrix of the two cameras relative to the respective gimbal bases to obtain the homogeneous transformation matrix between the two cameras through matrix multiplication, and obtains the rotation matrix and the translation matrix between the two cameras according to the homogeneous transformation matrix; A rectification module uses the rotation matrix, the translation matrix between the two cameras and the intrinsic matrix of the two cameras to rectify the target images taken by the two cameras stereoscopically; A depth calculation module, for the corrected target image, uses an SGBM algorithm to perform feature point matching and disparity calculation to obtain a depth map corresponding to the target image.

8. An electronic device, comprising: The application relates to a kind of cloud platform based on DH coordinate system's two eyes distance measuring method of holder, including: Memory for storing computer software programs; Processor for reading and executing the computer software programs, thereby realizing the cloud platform based on DH coordinate system's two eyes distance measuring method of holder of any one of claims 1-6.

9. A non-transitory computer-readable storage medium, comprising: The storage medium stores computer software programs for realizing the cloud platform based on DH coordinate system's two eyes distance measuring method of holder of any one of claims 1-6.