Method, apparatus and electronic device for binocular calibration
By calculating the camera parameters and yaw angle, and using image feature point matching and template matching, self-calibration without third-party sensors is achieved, solving the problem of inaccurate distance measurement in online calibration of binocular systems, and improving user experience.
Patent Information
- Application Number
- CN202210362020.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The existing binocular visual calibration methods cannot be effectively calibrated in online scenarios, and require third-party sensors to provide depth information, resulting in inaccurate distance measurement and reducing user experience.
By obtaining the image sets captured by the first and second cameras, calculating the inclination angle, rolling angle and yaw angle parameters, measuring the translation parameters using a calibration ruler, combining image feature point matching and template matching, calculating the scaling ratio and depth distance, iteratively solving the loss function, and completing self-calibration without the need for third-party sensors to provide depth information.
It realizes self-calibration without third-party sensors, solves the problem of inaccurate distance measurement caused by slight changes during use of the binocular system, and improves the user experience.
Smart Images

Figure CN114758009B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of binocular vision calibration, and in particular to a method, device and electronic device for binocular calibration. Background Art
[0002] Most of the existing binocular calibrations are offline calibrations. A calibration board is used to provide depth information to calibrate the positional relationship between two cameras. This method is not applicable to online scenarios. Online calibration can only use the information in the real scene for calibration and cannot use external auxiliary devices such as calibration boards and calibration rooms.
[0003] During the use of the binocular system, a slight displacement phenomenon often occurs. After the binocular system is calibrated, due to reasons such as materials and installation methods, the relative positions between the lenses may change slightly during use. At this time, the original calibration parameters are not applicable to the latest state. If there is no condition for offline calibration again, online calibration is required.
[0004] Most of the existing online calibrations also require other sensors to provide depth information. When there is no third-party sensor such as a laser or radar to provide depth information, online calibration cannot be performed, resulting in inaccurate ranging and thus reducing the user experience. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method, device and electronic device for binocular calibration, which can complete binocular calibration without using a third-party sensor to provide depth information, thereby solving the problem of inaccurate ranging caused by slight changes during the use of binoculars, and further improving the user experience.
[0006] In a first aspect, an embodiment of the present invention provides a method for binocular calibration, which includes: obtaining a first image set and a second image set captured by a first camera and a second camera for tracking a target object; arbitrarily obtaining a set of first target image and second target image with the same timestamp from the first image set and the second image set; calculating camera parameters according to the first target image and the second target image; where the camera parameters include tilt angle parameters and roll angle parameters; calculating the scaling ratio value of each frame of image in the first image set with respect to the target object with the first frame of image; calculating the yaw angle parameter based on multiple scaling ratio values.
[0007] The above method further includes: measuring the lens center points of the first camera and the second camera using a calibration ruler to obtain translation parameters.
[0008] The steps of calculating the camera parameters based on the first target image and the second target image include: performing binocular stereo calibration and distortion removal on the first target image and the second target image according to preset calibration parameters to obtain a first processed image and a second processed image, so as to preliminarily align the first processed image and the second processed image in the epipolar direction; respectively extracting and matching feature points from the first processed image and the second processed image to obtain a plurality of matching points; and calculating the camera parameters based on the plurality of matching points.
[0009] The steps of calculating the camera parameters based on the plurality of matching points include: constructing a first loss function regarding the camera parameters based on the plurality of matching points; iteratively solving the minimum value of the first loss function; and taking the minimum value as the camera parameters.
[0010] The steps of calculating the scaling ratio value of each frame image in the first image set and the first frame image with respect to the target object include: inputting each frame image in the first image set and the first frame image into a pre-trained scaling ratio calculation model to obtain the scaling ratio value of each frame image and the first frame image with respect to the target object.
[0011] The steps of calculating the yaw angle parameter based on the plurality of scaling ratio values include: determining the scaling ratio change curvature based on the scaling ratio value change curve constructed based on the plurality of scaling ratio values; performing template matching and triangulation ranging on the first image and the second image with the same timestamp in the first image set and the second image set to obtain the depth distance of the target object from the first camera at each moment; determining the depth distance change curvature based on the depth distance change curve constructed based on the depth distance at each moment; and calculating the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature.
[0012] The steps of calculating the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature include: constructing a second loss function regarding the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature; iteratively solving the minimum value of the second loss function; and taking the minimum value as the yaw angle parameter.
[0013] In a second aspect, an embodiment of the present invention further provides a binocular calibration device, where the device includes: a first acquisition module, configured to acquire a first image set and a second image set obtained by a first camera and a second camera shooting and tracking a target object; a second acquisition module, configured to arbitrarily acquire a set of first target images and second target images with the same timestamp from the first image set and the second image set; a first calculation module, configured to calculate camera parameters according to the first target image and the second target image; where the camera parameters include a tilt angle parameter and a roll angle parameter; a second calculation module, configured to calculate the scaling ratio value of each frame image in the first image set and the first frame image with respect to the target object; and a third calculation module, configured to calculate the yaw angle parameter based on the plurality of scaling ratio values.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above method.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above method.
[0016] The embodiments of the present invention bring the following beneficial effects:
[0017] An embodiment of the present application provides a method, device, and electronic device for binocular calibration. Among them, a set of first target image and second target image with the same timestamp is arbitrarily obtained from the first image set and the second image set captured by the first camera and the second camera for tracking a target object. The tilt angle parameter and the roll angle parameter are calculated based on the first target image and the second target image, and the scaling ratio value of each frame image in the first image set with respect to the first frame image for the target object is calculated. The yaw angle parameter is calculated based on multiple scaling ratio values. During the process of calibrating the tilt angle parameter, roll angle parameter, and yaw angle parameter of the two cameras in the present application, as long as there is a target object with relative displacement, self-calibration can be completed without using any third-party sensors or calibration devices to provide depth information for calibration, thereby solving the problem of inaccurate ranging caused by small changes during the use of binoculars, and further improving the user experience.
[0018] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification and the drawings.
[0019] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings
[0020] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 It is a flowchart of a method for binocular calibration provided by an embodiment of the present invention;
[0022] Figure 2 This is a flowchart of another binocular calibration method provided by an embodiment of the present invention;
[0023] Figure 3 This is a schematic structural diagram of a binocular calibration device provided by an embodiment of the present invention;
[0024] Figure 4 This is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0026] Considering the problem that most existing online calibrations cannot complete online calibration without depth information provided by other sensors, resulting in inaccurate ranging and thus reducing the user experience; based on this, a binocular calibration method, device, and electronic device provided by an embodiment of the present invention can complete online self-calibration as long as there is a target object with relative displacement, without using any third-party sensors or calibration devices to provide depth information for calibration, thereby solving the problem of inaccurate ranging caused by small changes during the use of binoculars, and further improving the user experience.
[0027] This embodiment provides a binocular calibration method. Among them, referring to Figure 1 the flowchart of a binocular calibration method shown in the following, this method specifically includes the following steps:
[0028] Step S102, obtaining a first image set and a second image set obtained by a first camera and a second camera shooting a tracking target object;
[0029] The above-mentioned first camera and second camera can be understood as image collectors in a binocular device. Among them, the binocular device can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a drone, a robot, a smart wearable device (such as a smart helmet, smart glasses), a virtual reality device, etc., which is not limited herein.
[0030] Generally, the relative installation positions of the first camera and the second camera in the binocular device are in a left-right structure. In this embodiment, the first camera is installed on the left side of the second camera, and correspondingly, the second camera is installed on the right side of the first camera to respectively collect image sets of the target object. The above target object can be any moving object, such as a walking person, a moving vehicle, or an object being moved, which is not limited herein.
[0031] Step S104: Arbitrarily obtain a set of first target image and second target image with the same timestamp from the first image set and the second image set;
[0032] The above timestamp can be understood as the current moment when the camera collects the image. Since the first camera and the second camera start image collection simultaneously, each image in the first image set can find an image corresponding to the same timestamp in the second image set. Therefore, an arbitrary timestamp (i.e., the image collection moment) can be selected, and then the first target image corresponding to this timestamp is selected from the first image set, and the second target image corresponding to this timestamp is selected from the second image set, that is, the first target image and the second target image correspond to the same timestamp.
[0033] Step S106: Calculate the camera parameters according to the first target image and the second target image; wherein, the camera parameters include the tilt angle parameter and the roll angle parameter;
[0034] Generally, for binocular calibration, what needs to be calibrated is the relative position relationship (camera extrinsic parameters) between the two cameras, that is, the rotation parameters and the translation parameters. Since the translation parameters do not require accuracy below the millimeter level, during the calibration process of the translation parameters, the above translation parameters can be obtained by measuring the lens center points of the first camera and the second camera using a calibration ruler.
[0035] In practical applications, the rotation parameters can be decomposed into Euler angle parameters in three directions, that is, the tilt angle parameter, the roll angle parameter, and the yaw angle parameter. In this embodiment, only the tilt angle parameter and the roll angle parameter can be calculated through the first target image and the second target image, while the yaw angle parameter can be calculated through steps S108 - S110.
[0036] Step S108: Calculate the scaling ratio value of each frame of image in the first image set with respect to the first frame image for the target object;
[0037] During the binocular acquisition process, since the left camera is the main one, in this embodiment, the first image set collected by the first camera is selected to calculate the scaling ratio value. This scaling ratio value can be understood as the size change ratio of each frame of image in the first image set with respect to the first frame image for the target object.
[0038] Step S110: Calculate the yaw angle parameter based on multiple scaling ratio values.
[0039] The binocular calibration method provided in this embodiment can complete self-calibration only through the first image set and the second image set of the target object with relative displacement, without using any third-party sensors or calibration devices to provide depth information for calibration, thus solving the problem of inaccurate ranging caused by small changes during the use of binoculars, and further improving the user experience.
[0040] This embodiment provides another binocular calibration method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation manners of calculating the camera parameters and the yaw angle parameter. As Figure 2 shown in the flowchart of another binocular calibration method, the binocular calibration method in this embodiment includes the following steps:
[0041] Step S202: Obtain the first image set and the second image set obtained by the first camera and the second camera shooting the tracking target object;
[0042] Step S204: Arbitrarily obtain a set of first target image and second target image with the same timestamp from the first image set and the second image set;
[0043] Step S206: Perform binocular stereo rectification and distortion removal processing on the first target image and the second target image according to the preset calibration parameters to obtain the first processed image and the second processed image, so as to preliminarily align the first processed image and the second processed image in the epipolar direction;
[0044] The preset calibration parameters include distortion parameters and internal and external parameters. The distortion parameter refers to the deviation between the actual corresponding pixel position of the object point in the image and the theoretical projection point calculated based on the imaging model during the camera photographing process. This deviation is generally described by the radial distortion parameter and the tangential distortion parameter. The internal and external parameters include the camera internal parameters and the camera external parameters. In actual applications, the preset calibration parameters can be preset when the binocular device leaves the factory, or can be the camera external parameters calibrated according to the first image set and the second image set last time, and, the distortion parameters and the camera internal parameters determined based on the calibrated camera external parameters.
[0045] In specific implementation, according to the rotation parameters of the camera's internal parameters and external parameters, the mapping matrices in the X direction and Y direction are calculated on the first target image and the second target image respectively using the initUndistortRectifyMap function in OpenCV. Then, on the first target image and the second target image respectively, the remap function in OpenCV is used according to the obtained mapping matrices to get the binocular stereo rectified images. After rectification, distortion removal processing is performed through the rotation parameters of the camera's external parameters, so that in practice, two non-coplanar row-aligned images after distortion removal are rectified into coplanar row (epipolar line direction) alignment. Then, through the camera's internal parameters, the camera coordinate system is converted into the image pixel coordinate system, and the first processed image and the second processed image are preliminarily aligned in the epipolar line direction. Among them, coplanar row alignment means that the image planes of the two cameras are on the same plane, and when the same point is projected onto the image planes of the two cameras, it is on the same row of the two pixel coordinate systems.
[0046] Step S208: Extract and match feature points from the first processed image and the second processed image respectively to obtain a plurality of matching points.
[0047] After obtaining the first processed image and the second processed image that are preliminarily aligned in the epipolar line direction, the first processed image and the second processed image can be used to extract feature points according to a preset feature point algorithm, obtaining a plurality of first feature points of the first processed image and a plurality of second feature points of the second processed image. Furthermore, based on a preset matching algorithm, the first feature points and the second feature points are matched to obtain a plurality of mutually matching points, and the mismatched points are filtered, so that the matching points of the first processed image and the matching points of the second processed image are in one-to-one correspondence.
[0048] The above preset matching algorithm may include but is not limited to the brute force matching algorithm (Brute Force), the K-nearest neighbor algorithm (K-NearestNeighbor, KNN), or the exhaustive search algorithm, etc. The preset feature point algorithm includes but is not limited to feature extraction algorithms such as ORB (OrientedFast and Rotated Brief), Scale-Invariant Feature Transform (Sift), or Speeded Up Robust Features (Surf), etc. The preset matching algorithm and the preset feature point algorithm are not limited herein.
[0049] Step S210: Calculate the camera parameters based on a plurality of matching points.
[0050] The calculation process of the camera parameters is as follows: Based on a plurality of matching points, a first loss function regarding the camera parameters is constructed; the minimum value of the first loss function is iteratively solved; and the minimum value is used as the camera parameters.
[0051] By iteratively optimizing the first loss function, the binocular stereo rectification can be changed, that is, the positions of the feature points after binocular de-distortion are changed. Finally, for the feature points that match each other, the y-values of the longitudinal coordinates of the matching points on the processed image after binocular de-distortion are the same, which means the optimization is completed.
[0052] Step S212: Calculate the scaling ratio values of each frame of image in the first image set with respect to the first frame of image for the target object.
[0053] Specifically, input each frame of image in the first image set and the first frame of image into a pre-trained scaling ratio calculation model to obtain the scaling ratio values of each frame of image with respect to the first frame of image for the target object. Among them, the above-mentioned scaling ratio calculation model is a network model trained by a neural network using an image set of objects moving in real time.
[0054] Step S214: Determine the scaling ratio change curvature based on the scaling ratio value change curve constructed from multiple scaling ratio values.
[0055] Each frame of image in the first image set has a scaling ratio with respect to the first frame of image for the target object. A scaling ratio value change curve formed by a series of images is fitted with a quadratic equation or a cubic equation to obtain a set of parameters, and this set of parameters is the scaling ratio change curvature.
[0056] Step S216: Perform template matching and triangulation ranging on the first image and the second image with the same time stamp in the first image set and the second image set to obtain the depth distance of the target object from the first camera at each moment.
[0057] The left recognition frame of the target object is detected from the first image through the network. The full image of the second image is subjected to template matching of the left recognition frame to obtain the right recognition frame, and then triangulation ranging is performed on the center points of the left recognition frame and the right recognition frame to obtain the depth distance of the target object from the first camera at each moment.
[0058] Step S218: Determine the depth distance change curvature based on the depth distance change curve constructed from the depth distances corresponding to each moment.
[0059] A depth distance change curve formed by a series of depth distances is fitted with a quadratic equation or a cubic equation to obtain a set of parameters, and this set of parameters is the depth distance change curvature.
[0060] Step S220: Calculate the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature.
[0061] The specific calculation process is as follows: Construct a second loss function for the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature; iteratively solve the minimum value of the second loss function; and take the minimum value as the yaw angle parameter.
[0062] The binocular calibration method provided by the embodiments of the present application can obtain depth distance information based on the first image and the second image with the same timestamp in the first image set and the second image set collected by the first camera and the second camera, and complete binocular calibration without using a third-party sensor to provide depth information, thereby solving the problem of inaccurate ranging caused by small changes during the use of binoculars, and further improving the user experience.
[0063] Corresponding to the above method embodiments, this embodiment provides a binocular calibration device. Refer to Figure 3 the structural schematic diagram of a binocular calibration device shown in
[0064] A first acquisition module 302, configured to acquire a first image set and a second image set obtained by the first camera and the second camera shooting and tracking a target object;
[0065] A second acquisition module 304, configured to arbitrarily acquire a set of first target image and second target image with the same timestamp from the first image set and the second image set;
[0066] A first calculation module 306, configured to calculate camera parameters according to the first target image and the second target image; wherein, the camera parameters include an inclination angle parameter and a roll angle parameter;
[0067] A second calculation module 308, configured to calculate the scaling ratio value of each frame of image in the first image set with respect to the first frame image for the target object;
[0068] A third calculation module 310, configured to calculate a yaw angle parameter based on multiple scaling ratio values.
[0069] The embodiments of the present application provide a binocular calibration device. Among them, a set of first target image and second target image with the same timestamp are arbitrarily acquired from the obtained first image set and second image set of the first camera and the second camera shooting and tracking the target object, the inclination angle parameter and the roll angle parameter are calculated according to the first target image and the second target image, and the scaling ratio value of each frame of image in the first image set with respect to the first frame image for the target object is calculated, and the yaw angle parameter is calculated based on multiple scaling ratio values. During the process of calibrating the inclination angle parameter, the roll angle parameter and the yaw angle parameter of the two cameras in the present application, as long as there is a target object with relative displacement, self-calibration can be completed without using any third-party sensor or calibration device to provide depth information for calibration, thereby solving the problem of inaccurate ranging caused by small changes during the use of binoculars, and further improving the user experience.
[0070] The apparatus for binocular calibration provided by the embodiments of the present invention has the same technical features as the method for binocular calibration provided by the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.
[0071] The embodiments of the present invention further provide an electronic device for running the above method for binocular calibration; see Figure 4 the structural schematic diagram of an electronic device shown in. The electronic device includes a memory 100 and a processor 101. Among them, the memory 100 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 101 to implement the above method for binocular calibration.
[0072] Furthermore, Figure 4 the electronic device shown in further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103 and the memory 100 are connected through the bus 102.
[0073] Among them, the memory 100 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 103 (which can be wired or wireless), a communication connection is realized between this system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 4 only a bidirectional arrow is used in to represent it, but it does not mean that there is only one bus or one type of bus.
[0074] The processor 101 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 101 or the instructions in the form of software. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and combines its hardware to complete the steps of the method in the foregoing embodiments.
[0075] The embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions cause the processor to implement the above-mentioned method for dual target calibration. For the specific implementation, reference can be made to the foregoing method embodiments, and details are not described herein again.
[0076] The computer program product of the method, device and electronic device for dual target calibration provided by the embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the foregoing method embodiments. For the specific implementation, reference can be made to the method embodiments, and details are not described herein again.
[0077] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0078] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0079] In the description of this application, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to this application. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0080] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of this application, used to illustrate the technical solutions of this application, rather than limiting it. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed in this application can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for binocular calibration, characterized in that The method includes: Obtaining a first image set and a second image set obtained by a first camera and a second camera photographing a tracking target object; Arbitrarily obtaining a set of first target image and second target image with the same timestamp from the first image set and the second image set; Calculating camera parameters according to the first target image and the second target image; wherein, the camera parameters include a tilt angle parameter and a roll angle parameter; Calculating the scaling ratio value of each frame image in the first image set and the first frame image with respect to the target object; Calculating a yaw angle parameter based on a plurality of the scaling ratio values; Wherein, the first camera is a left camera.
2. The method according to claim 1, characterized in that, The method further includes: Measuring the lens center points of the first camera and the second camera using a calibration ruler to obtain a translation parameter.
3. The method according to claim 1, wherein The step of calculating camera parameters according to the first target image and the second target image includes: Performing binocular stereo rectification and distortion removal processing on the first target image and the second target image according to preset calibration parameters to obtain a first processed image and a second processed image, so as to preliminarily align the first processed image and the second processed image in the epipolar line direction; Performing feature point extraction and matching on the first processed image and the second processed image respectively to obtain a plurality of matching points; Calculating camera parameters based on a plurality of the matching points.
4. The method according to claim 3, wherein The step of calculating camera parameters based on a plurality of the matching points includes: Constructing a first loss function about camera parameters based on a plurality of the matching points; Iteratively solving the minimum value of the first loss function; Taking the minimum value as the camera parameters.
5. The method according to claim 1, characterized in that The step of calculating the scaling ratio value of each frame image in the first image set and the first frame image with respect to the target object includes: Inputting each frame image in the first image set and the first frame image into a pre-trained scaling ratio calculation model to obtain the scaling ratio value of each frame image and the first frame image with respect to the target object.
6. The method according to claim 1, characterized in that The step of calculating a yaw angle parameter based on a plurality of the scaling ratio values includes: Determining the scaling ratio change curvature based on a scaling ratio value change curve constructed based on a plurality of the scaling ratio values; Performing template matching and triangulation ranging on the first image and the second image with the same timestamp in the first image set and the second image set to obtain the depth distance of the target object from the first camera at each moment; Determining the depth distance change curvature based on a depth distance change curve constructed based on the depth distance corresponding to each moment; Calculating a yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature.
7. The method according to claim 6, characterized in that, The step of calculating a yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature includes: Constructing a second loss function about the yaw angle parameter according to the scaling ratio change curvature and the depth distance change curvature; Iteratively solving the minimum value of the second loss function; Taking the minimum value as the yaw angle parameter.
8. A device for binocular calibration, characterized in that, The device includes: A first acquisition module, configured to acquire a first image set and a second image set obtained by a first camera and a second camera photographing a tracking target object; A second acquisition module, configured to arbitrarily acquire a set of first target images and second target images with the same timestamps from the first image set and the second image set; A first calculation module, configured to calculate camera parameters according to the first target images and the second target images; wherein the camera parameters include a tilt angle parameter and a roll angle parameter; A second calculation module, configured to calculate a scaling ratio value of each frame of image in the first image set with respect to the first frame of image for the target object; A third calculation module, configured to calculate a yaw angle parameter based on a plurality of the scaling ratio values; Wherein, the first camera is a left camera.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Assessment method, device and equipment for vehicle positioning accuracy
CN110033489A
Pedestrian trajectory tracking method and apparatus based on binocular camera calibration, computer device, and storage medium
WO2021139176A1