Camera calibration method, camera calibration device and computer storage medium

By identifying and calculating the target coordinate difference between multiple cameras and updating the external parameters between cameras, the problem of difficult access to GPS information in tunnel scenarios in traditional methods is solved, and the external parameter calibration between cameras and vehicles are realized in any road scenarios. Position matching enables low-cost inter-camera tracking.

CN119169104AInactive Publication Date: 2024-12-20ZHEJIANG DAHUA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411661128.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2024-12-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In traffic digital scenarios, traditional camera calibration methods rely on GPS information and cannot accurately complete external parameter calibration between cameras in tunnels and other scenarios, resulting in the inability to realize the effective connection of vehicle trajectories and accurate physical location in any road scenarios. .

Method used

By acquiring images collected by multiple cameras, identifying the same targets in the image, calculating external parameters between cameras, using the target coordinate difference value to update the rotation matrix and translation matrix between cameras, establishing equations for joint solution, and realizing external parameters between cameras Parameter calibration and does not depend on latitude and longitude information.

Benefits of technology

In any road scenario, the external parameter solution and target cross-camera tracking between multiple cameras are implemented at low cost, which solves the problem that traditional methods are difficult to obtain GPS information in tunnel scenarios, and realizes accurate external parameter calibration between cameras and vehicle position match.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169104A_ABST
    Figure CN119169104A_ABST
Patent Text Reader

Abstract

The invention provides a camera calibration method, a camera calibration device and a computer storage medium. The camera calibration method comprises the following steps: acquiring a first image acquired by a first camera and a second image acquired by a second camera; identifying the same target in the first image and the second image; obtaining a first target coordinate of a target of the first image in a reference coordinate system and a second target coordinate of a target of the second image in the reference coordinate system; and calculating inter-camera external parameters between the first camera and the second camera by using the first target coordinate and the second target coordinate. Through the camera calibration method, the problem of solving the external parameters among multiple cameras in any road scene is solved, the method does not depend on longitude and latitude, and target cross-camera tracking is achieved at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of camera calibration, and in particular to a camera calibration method, a camera calibration device and a computer storage medium. Background Art

[0002] In traffic digitization scenarios, in order to observe the real-time position of vehicles in the picture, it is necessary to connect the vehicle's trajectory in series through camera calibration and give the target's accurate physical position. Due to the large similarity in appearance of different vehicles, it is impossible to complete the target relay across cameras through feature matching. The traditional method is to calibrate each camera with the GPS (Global Positioning System) and complete the target matching across cameras through GPS values. However, it is difficult to obtain accurate GPS information in tunnel scenarios, resulting in the inability to complete the external parameter calibration between cameras in any road scenario. Summary of the invention

[0003] In order to solve the above technical problems, the present application proposes a camera calibration method, a camera calibration device and a computer storage medium.

[0004] In order to solve the above technical problems, the present application proposes a camera calibration method, which includes: Acquire a first image captured by the first camera and a second image captured by the second camera; identifying a common object in the first image and the second image; Acquire first target coordinates of the target in the first image in a reference coordinate system, and second target coordinates of the target in the second image in the reference coordinate system; An inter-camera extrinsic parameter between the first camera and the second camera is calculated using the first target coordinates and the second target coordinates.

[0005] The reference coordinate system is a world coordinate system based on the first camera or a world coordinate system based on the second camera.

[0006] Wherein, the camera calibration method further includes: Initialize camera external parameters; According to the initialized inter-camera extrinsic parameters, obtaining transformation parameters between a first world coordinate system of the first camera and a second world coordinate system of the second camera; The transformation parameters are used to transform the first target coordinates or the second target coordinates into the reference coordinate system.

[0007] The external parameters between cameras include rotation angle, lateral translation, and longitudinal translation; The calculating the inter-camera extrinsic parameters between the first camera and the second camera by using the first target coordinates and the second target coordinates includes: Calculating a coordinate difference between the first target coordinates and the second target coordinates; Updating the initialized camera extrinsic parameters according to the coordinate difference; According to the updated inter-camera extrinsic parameters, third target coordinates of the target in the second image in the reference coordinate system are acquired until the updated inter-camera extrinsic parameters make the target in the first image coincide with the target in the second image in the reference coordinate system.

[0008] Wherein, the inter-camera external parameters include a rotation matrix and a translation matrix; the target includes a plurality of matching targets; The calculating the inter-camera extrinsic parameters between the first camera and the second camera by using the first target coordinates and the second target coordinates includes: Using the rotation matrix and the translation matrix, establish an equation between the first target coordinates and the second target coordinates; The equations of the plurality of matching targets are jointly solved to obtain the rotation matrix and the translation matrix.

[0009] The step of identifying the same target in the first image and the second image includes: According to the installation distance between the first camera and the second camera, calibrate the overlap area within the image acquisition range of the first camera, and calibrate the overlap area within the image acquisition range of the second camera; Detecting a plurality of first candidate targets in an overlapping area of ​​the first image, and detecting a plurality of second candidate targets in an overlapping area of ​​the second image; When the number of the first candidate target and the second candidate target reaches a preset number, the first candidate target is matched with the second candidate target to obtain a plurality of identical targets that are successfully matched.

[0010] Wherein, the camera calibration method further includes: Acquire a lane line image from the first camera; When the lane line in the lane line image is a curve, extracting a plurality of pixel points respectively on the first lane line and the second lane line; Initializing camera extrinsic parameters of the first camera; Converting the plurality of pixel points into lane point coordinates of a world coordinate system according to the camera extrinsic parameters; Fitting a plurality of first straight lines according to adjacent lane points of the first lane line; Fitting a plurality of second straight lines according to adjacent lane points of the second lane line; Calculating the distance between each group of corresponding first straight lines and second straight lines, and counting the distance variances between the plurality of first straight lines and the plurality of second straight lines; Iteratively changing the camera extrinsic parameters, and obtaining a distance variance calculated by each change of the camera extrinsic parameters; The camera extrinsic parameters corresponding to the minimum value of the distance variance are used as the camera extrinsic parameters for final calibration of the second camera.

[0011] The step of calculating the distance between each group of corresponding first straight lines and second straight lines includes: Obtain any candidate point on the first straight line; Determine whether an intersection point of a perpendicular line from the candidate point to the second straight line is located on a line segment between adjacent lane points of the second straight line; If yes, taking the distance from the candidate point to the second straight line as the distance between the first straight line and the second straight line; If not, continue to select other candidate points.

[0012] In order to solve the above technical problems, the present application also proposes a camera calibration device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the camera calibration method as described above.

[0013] In order to solve the above technical problems, the present application also proposes a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the above camera calibration method.

[0014] Compared with the prior art, the beneficial effects of the present application are as follows: the camera calibration device obtains a first image captured by a first camera and a second image captured by a second camera; identifies the same target in the first image and the second image; obtains the first target coordinates of the target in the first image in a reference coordinate system and the second target coordinates of the target in the second image in the reference coordinate system; uses the first target coordinates and the second target coordinates to calculate the inter-camera extrinsic parameters between the first camera and the second camera. Through the above camera calibration method, the problem of solving the extrinsic parameters between multiple cameras in any road scene is solved without relying on longitude and latitude, and cross-camera tracking of targets can be achieved at a low cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 It is a flowchart of an embodiment of a camera calibration method provided by the present application; Figure 2 is a flowchart of another embodiment of the camera calibration method provided by the present application; Figure 3 is a structural schematic diagram of an embodiment of a camera calibration device provided by the present application; Figure 4 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0017] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0018] This application solves the problem of solving the camera's own extrinsic parameters in any road scene, as well as the problem of solving the extrinsic parameters between multiple cameras without relying on longitude and latitude, and realizes cross-camera tracking of targets at low cost.

[0019] Please refer to Figure 1 , Figure 1 It is a flowchart of an embodiment of a camera calibration method provided in this application.

[0020] The camera calibration method of the present application is applied to a camera calibration device, wherein the camera calibration device of the present application can be a server, a terminal device, or a system in which a server and a terminal device cooperate with each other. Accordingly, the various parts included in the camera calibration device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.

[0021] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.

[0022] like Figure 1 As shown, the specific steps are as follows: Step S11: Acquire a first image captured by a first camera and a second image captured by a second camera.

[0023] In the embodiment of the present application, the multi-camera relay tracking system of the present application is formed by a plurality of cameras in relay, and adjacent cameras are installed at a preset distance and retain a certain overlap area. When the vehicle runs to the overlap area of ​​two cameras, the physical position of the same target observed by the two cameras relative to the world coordinate system can be calculated through camera calibration, and the target matching can be completed according to the position, thereby realizing cross-camera tracking.

[0024] Specifically, the first camera and the second camera are adjacent cameras, and the acquisition range of the first camera and the acquisition range of the second camera have an overlapping area. The first image acquired by the first camera and the second image acquired by the second camera both have image content in the overlapping area.

[0025] Step S12: Identify the same object in the first image and the second image.

[0026] In an embodiment of the present application, a camera calibration device identifies a target in an overlapping area of ​​a first image and identifies a target in an overlapping area of ​​a second image, and obtains the same target through target matching.

[0027] Specifically, the target matching method adopted in the present application can be a target detection algorithm, which extracts the feature vector of each target and compares the difference between the feature vectors of each target, and matches the two targets with the smallest difference in feature vectors as the same target.

[0028] In addition, the target matching method adopted in the present application may also be a matching method of the relative position relationship of the target.

[0029] Specifically, the camera calibration device estimates the range of the camera overlap area based on the installation distance between the cameras, and the targets detected by the cameras are accompanied by lane numbers.

[0030] When camera 1 and camera 2 are in the overlapping area and in the same lane, the number of targets detected is the same, which is m targets. The targets detected by camera 1 are id1_1, id1_2, ... id1_m; the targets detected by camera 2 are id2_1, id2_2, ... id2_m.

[0031] According to the relative position relationship, the target of camera 1 can be matched with the target of camera 2 one by one. The matching principle is the cost and minimum (distance) of the matching of these m targets. The matching targets of multiple lanes are recorded at the same time. When the matching targets meet a certain number, the camera external parameters are calculated.

[0032] Step S13: Acquire first target coordinates of the target in the first image in the reference coordinate system, and second target coordinates of the target in the second image in the reference coordinate system.

[0033] In an embodiment of the present application, the camera calibration device further obtains first target coordinates of the same target in the first image in the reference coordinate system, and second target coordinates of the same target in the second image in the reference coordinate system.

[0034] It should be noted that the reference coordinate system in the present application is a world coordinate system, which can be a world coordinate system based on the first camera or a world coordinate system based on the second camera. In other specific embodiments, the reference coordinate system can also be a world coordinate system based on other points.

[0035] The present application designs a reference coordinate system so that the target coordinates of the first camera and the second camera can be located in the same world coordinate system, which is convenient for evaluating the difference between the coordinates and is beneficial for calibrating the external parameters between the cameras.

[0036] The transformation parameters or transformation matrix required for the above-mentioned coordinate conversion are calculated through the external parameters of each camera itself, and the external parameters of the camera itself can be calibrated according to the mature calibration method on the market, or it can be calibrated by the camera external parameter calibration method provided in this application, which will be further explained in the subsequent calibration method.

[0037] Step S14: Calculate inter-camera extrinsic parameters between the first camera and the second camera using the first target coordinates and the second target coordinates.

[0038] In the embodiment of the present application, the camera calibration device provides a manual association target calculation extrinsic parameter solution and an automatic calculation of adjacent camera extrinsic parameter solution. The two solutions are described below respectively: Regarding the solution of calculating external parameters by manually associating targets, the camera calibration device converts the image coordinates into world coordinates through the conversion relationship between the image coordinate system and the camera coordinate system. To realize the cross-camera tracking function based on position matching, it is necessary to calculate the external parameters between each adjacent camera, namely the rotation angle yaw, the lateral translation tx, and the longitudinal translation ty.

[0039] The longitudinal translation amount ty is the installation distance between adjacent cameras. Generally, the cameras are installed at a fixed distance. This distance is assigned as the initial value of ty, the initial value of tx is 0, and the initial value of yaw is also 0.

[0040] Assume that the external parameters between camera 1 (first camera) and camera 2 (second camera) are calculated. With camera 1 as the reference, the target coordinates of camera 2 are converted to the coordinate system corresponding to camera 1 through tx, ty, and yaw. Construct a map with camera 1 as the reference world coordinate system. The targets detected by camera 1 are represented by blue dots and displayed on the map, and the targets detected by camera 2 are represented by red dots and displayed on the map.

[0041] When the target passes through the overlapping area of ​​camera 1 and camera 2, the positions of the targets detected by the two cameras on the map are observed, and the three parameters tx, ty, and yaw are adjusted so that the positions of the same target detected by the two cameras on the map overlap. At this time, these three parameters are the extrinsic parameters of camera 2 relative to camera 1. Similarly, the extrinsic parameters of camera 3 relative to camera 2 can be calculated.

[0042] It should be noted that when the camera calibration device adjusts the three parameters tx, ty, and yaw, it can refer to the coordinate difference on the map between the target detected by camera 1 and the target detected by camera 2. For example, the target detected by camera 1 and the target detected by camera 2 only differ in rotation angle, and there is no difference in translation position. When adjusting the parameters, only the rotation angle yaw needs to be adjusted. The method of adjusting parameters by referring to the coordinate difference is conducive to improving the calibration efficiency of external parameters between multiple cameras.

[0043] Regarding the automatic calculation of the extrinsic parameters of adjacent cameras, the camera calibration device calculates the extrinsic parameters by automatically matching the target, without manual point selection, which increases the intelligence of the program. The camera calibration device assumes that the coordinates of one of the matching targets of camera 1 and camera 2 are (x1_1, y1_1) and (x2_1, y2_1) respectively.

[0044]

[0045]

[0046] The camera calibration device can solve R and .

[0047] In the present application, a camera calibration device obtains a first image captured by a first camera and a second image captured by a second camera; identifies the same target in the first image and the second image; obtains the first target coordinates of the target in the first image in a reference coordinate system and the second target coordinates of the target in the second image in the reference coordinate system; and calculates the inter-camera extrinsic parameters between the first camera and the second camera using the first target coordinates and the second target coordinates. The above camera calibration method can solve the problem of solving the extrinsic parameters between multiple cameras in any road scene without relying on longitude and latitude, and realize cross-camera tracking of targets at a low cost.

[0048] Above Figure 1 The camera calibration method shown is based on the external parameter calibration of each camera. Therefore, this application also provides a single camera external parameter calibration solution. For details, please refer to Figure 2 , Figure 2 It is a flowchart of another embodiment of the camera calibration method provided in this application.

[0049] like Figure 2 As shown, the specific steps are as follows: Step S21: Acquire a lane line image from a first camera.

[0050] In the embodiment of the present application, the single-camera external parameter calibration solution is applicable to cameras in any scene, including but not limited to Figure 1 The first camera and the second camera in the camera calibration method shown.

[0051] Step S22: When the lane line in the lane line image is a curve, a number of pixel points are extracted from the first lane line and the second lane line respectively.

[0052] In the embodiment of the present application, if the lane lines in the lane line image are straight lines, the pixel coordinates of the first and last endpoints of each lane line are input. If the lane lines are curves, n pixel points (n>5) are evenly taken on each curve. The present application requires at least two lane lines to be input.

[0053] This application calculates the external parameters of the camera coordinate system relative to the world coordinate system, including pitch angle and yaw angle (the camera does not need to calibrate the yaw angle for curved scenes), given the camera's internal parameters and installation height.

[0054] The solution for solving the camera extrinsic parameters when the lane line is a straight line is as follows: If the lane line is a straight line, the point where the camera's optical center is projected onto the ground is the origin of the world coordinate system, the Y axis is the direction of the lane line, and the X axis is perpendicular to the lane line and parallel to the ground. The pitch and yaw angles of the camera relative to the world coordinate system can be calculated based on the principle of the vanishing point of parallel lines.

[0055] When the lane line is a straight line, the solution for solving the camera extrinsic parameters continues to refer to the following steps S23 to S29.

[0056] Step S23: Initialize the camera extrinsic parameters of the first camera.

[0057] In the embodiment of the present application, if the lane line is a curve, the point on the ground projected by the optical center of the camera is used as the origin of the world coordinate system, the world coordinate system X axis is parallel to the camera coordinate system X axis, and the world coordinate system Y axis is perpendicular to the world coordinate system X axis and parallel to the ground. The external parameter of the camera is the pitch angle ptich_angle of the camera relative to the ground.

[0058] Assume that the lane line 1 image coordinates are [(u1_0, v1_0), (u1_1, v1_1), (u1_2, v1_2)...(u1_n, v1_n)].

[0059] The image coordinates of lane line 2 are [(u2_0, v2_0), (u2_1, v2_1), (u2_2, v2_2)…(u2_n, v2_n)].

[0060] The camera calibration device converts the image coordinates into world coordinates through the camera's internal and external parameters. Taking (u1_0, v1_0) as an example, the camera pitch angle is assumed to be ptich_angle, the camera installation height is camera_height, the camera focal length is focus, the image pixel height is height, and the image pixel width is width. Calculate the angle real_pitch between the ray connecting the pixel point and the optical center and the ground: real_pitch=ptich_angle-atan((v1_0-height / 2) / focus) The camera calibration device first assigns an initial value to ptich_angle, and then calculates its optimal value.

[0061] Step S24: converting a number of pixel points into lane point coordinates of the world coordinate system according to the camera extrinsic parameters.

[0062] In the embodiment of the present application, the camera calibration device calculates the Y-axis coordinate y1_0 of the point: y1_0=camera_height*tan(real_pitch) Calculate the X-axis coordinate x1_0 of the point: dis=camera_height / cos(real_pitch) x1_0=(u1_0-width / 2)*dis / focus Among them, (x1_0, y1_0) is the world coordinate of the pixel point (u1_0, v1_0).

[0063] Similarly, convert all the lane pixel coordinates mentioned above to get the corresponding world coordinates: The world coordinates corresponding to lane 1 are [(x1_0, y1_0), (x1_1, y1_1), (x1_2, y1_2)…(x1_n, y1_n)].

[0064] The world coordinates corresponding to lane 2 are [(x2_0, y2_0), (x2_1, y2_1), (x2_2, y2_2)…(x2_n, y2_n)].

[0065] Step S25: Fitting a plurality of first straight lines according to adjacent lane points of the first lane line.

[0066] Step S26: Fitting a plurality of second straight lines according to adjacent lane points of the second lane line.

[0067] In an embodiment of the present application, the camera calibration device solves the straight line equation between adjacent points of the lane line world coordinates according to the two-point method, which is expressed by the slope k and the intercept b.

[0068] The equation of lane 1 is [(k1_0, b1_0), (k1_1, b1_1), (k1_2, b1_2)…(k1_n-1, b1_n-1)].

[0069] The straight line equation of lane 2 is [(k2_0, b2_0), (k2_1, b2_1), (k2_2, b2_2)…(k2_n-1, b2_n-1)].

[0070] Step S27: Calculate the distance between each group of corresponding first straight lines and second straight lines, and count the distance variances between a number of first straight lines and a number of second straight lines.

[0071] In an embodiment of the present application, the camera calibration device calculates the distance between each group of corresponding first straight lines and second straight lines, that is, the distance between (k1_0, b1_0) and (k2_0, b2_0), the distance between (k1_1, b1_1) and (k2_1, b2_1), and so on.

[0072] When the camera calibration device calculates the distance between the first straight line and the second straight line, the distance between all points on the first straight line and the second straight line can be traversed, and the minimum distance is used as the distance between the first straight line and the second straight line.

[0073] Specifically, the camera calibration device represents the lane lines as multiple straight lines, draws a perpendicular line to each point on lane line 1, calculates the intersection of the perpendicular line with lane line 2, calculates the distance between the perpendicular line and the intersection of lane 1 and lane 2 (d1, d2, d3, ..., dn), and calculates the variance of these n distances.

[0074] Furthermore, the camera calibration device needs to select a point on the first straight line, make a perpendicular line to the point, calculate the intersection of the perpendicular line and the second straight line, and use the distance between the point and the intersection as the distance between the first straight line and the second straight line.

[0075] Preferably, in order to improve the accuracy of the distance, the points selected by the camera calibration device should make the intersection point located on the line segment of the second straight line.

[0076] Step S28: Iteratively change the camera extrinsic parameters, and obtain the distance variance calculated each time the camera extrinsic parameters are changed.

[0077] Step S29: taking the camera extrinsic parameters corresponding to the minimum value of the distance variance as the camera extrinsic parameters for final calibration of the second camera.

[0078] In the embodiment of the present application, when the camera pitch angle is calculated accurately, the variance of the above n distances should be close to 0, because the actual adjacent lane lines should be equally spaced. Assuming the initial pitch angle is p1 = 50 degrees, p1 is increased by 0.1 degrees in each iteration, and the variance corresponding to each pitch angle is calculated until p1 = 90. The pitch angle p1 corresponding to the minimum variance is found to be the optimal pitch angle. The lane line calculated by the optimal pitch angle satisfies the principle of equidistant distance at any point in the world coordinate system.

[0079] The camera calibration method of the present application is a calibration scheme that uses only image information to complete cross-camera tracking, does not rely on longitude and latitude information, and is applicable to any road scene.

[0080] The camera calibration method of the present application is a method for solving camera extrinsic parameters using an arbitrary lane, and calculating the actual camera pitch angle by the lane equidistant principle.

[0081] The camera calibration method of the present application is a method for calculating the extrinsic parameters of adjacent cameras, and the extrinsic parameters between cameras are solved through vehicle matching.

[0082] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0083] In order to implement the above-mentioned camera calibration method, this application also proposes a camera calibration device, for details, please refer to Figure 3 , Figure 3It is a structural schematic diagram of an embodiment of a camera calibration device provided in this application.

[0084] The camera calibration device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .

[0085] The processor 41 , the memory 42 , and the input / output device 43 are respectively connected to the bus 44 . The memory 42 stores program data. The processor 41 is used to execute the program data to implement the camera calibration method described in the above embodiment.

[0086] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.

[0087] This application also provides a computer storage medium, please continue to refer to Figure 4 , Figure 4 6 is a schematic diagram of the structure of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the camera calibration method of the above embodiment.

[0088] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0089] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A camera calibration method, It is characterized in that The camera calibration method comprises: Acquire a first image captured by the first camera and a second image captured by the second camera; identifying a common object in the first image and the second image; Acquire first target coordinates of the target in the first image in a reference coordinate system, and second target coordinates of the target in the second image in the reference coordinate system; An inter-camera extrinsic parameter between the first camera and the second camera is calculated using the first target coordinates and the second target coordinates.

2. The camera calibration method according to claim 1, It is characterized in that The reference coordinate system is a world coordinate system based on the first camera or a world coordinate system based on the second camera.

3. The camera calibration method according to claim 2, It is characterized in that The camera calibration method further includes: Initialize camera external parameters; According to the initialized inter-camera extrinsic parameters, obtaining transformation parameters between a first world coordinate system of the first camera and a second world coordinate system of the second camera; The transformation parameters are used to transform the first target coordinates or the second target coordinates into the reference coordinate system.

4. The camera calibration method according to claim 3, It is characterized in that The external parameters between the cameras include rotation angle, lateral translation, and longitudinal translation; The calculating the inter-camera extrinsic parameters between the first camera and the second camera by using the first target coordinates and the second target coordinates includes: Calculating a coordinate difference between the first target coordinates and the second target coordinates; Updating the initialized camera extrinsic parameters according to the coordinate difference; According to the updated inter-camera extrinsic parameters, third target coordinates of the target in the second image in the reference coordinate system are acquired until the updated inter-camera extrinsic parameters make the target in the first image coincide with the target in the second image in the reference coordinate system.

5. The camera calibration method according to claim 1, It is characterized in that The external parameters between cameras include a rotation matrix and a translation matrix; the target includes a plurality of matching targets; The calculating the inter-camera extrinsic parameters between the first camera and the second camera by using the first target coordinates and the second target coordinates includes: Using the rotation matrix and the translation matrix, establish an equation between the first target coordinates and the second target coordinates; The equations of the plurality of matching targets are jointly solved to obtain the rotation matrix and the translation matrix.

6. The camera calibration method according to claim 5, It is characterized in that The identifying the same target in the first image and the second image comprises: According to the installation distance between the first camera and the second camera, calibrate the overlap area within the image acquisition range of the first camera, and calibrate the overlap area within the image acquisition range of the second camera; Detecting a plurality of first candidate targets in an overlapping area of ​​the first image, and detecting a plurality of second candidate targets in an overlapping area of ​​the second image; When the number of the first candidate target and the second candidate target reaches a preset number, the first candidate target is matched with the second candidate target to obtain a plurality of identical targets that are successfully matched.

7. The camera calibration method according to claim 1, It is characterized in that The camera calibration method further includes: Acquire a lane line image from the first camera; When the lane line in the lane line image is a curve, extracting a plurality of pixel points respectively on the first lane line and the second lane line; Initializing camera extrinsic parameters of the first camera; Converting the plurality of pixel points into lane point coordinates of a world coordinate system according to the camera extrinsic parameters; Fitting a plurality of first straight lines according to adjacent lane points of the first lane line; Fitting a plurality of second straight lines according to adjacent lane points of the second lane line; Calculating the distance between each group of corresponding first straight lines and second straight lines, and counting the distance variances between the plurality of first straight lines and the plurality of second straight lines; Iteratively changing the camera extrinsic parameters, and obtaining a distance variance calculated by each change of the camera extrinsic parameters; The camera extrinsic parameters corresponding to the minimum value of the distance variance are used as the camera extrinsic parameters for final calibration of the second camera.

8. The camera calibration method according to claim 7, It is characterized in that The calculating the distance between each group of corresponding first straight lines and second straight lines comprises: Obtain any candidate point on the first straight line; Determine whether an intersection point of a perpendicular line from the candidate point to the second straight line is located on a line segment between adjacent lane points of the second straight line; If yes, taking the distance from the candidate point to the second straight line as the distance between the first straight line and the second straight line; If not, continue to select other candidate points.

9. A camera calibration device, It is characterized in that The camera calibration device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the camera calibration method according to any one of claims 1 to 8.

10. A computer storage medium, It is characterized in that The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the camera calibration method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • An indoor visible light self-positioning system and method based on binocular technology

    CN109191529A

  • Camera external parameter calibration method without common field of view

    CN112308926A

  • Automatic calibration method, device and equipment for external parameters of all-round view camera based on lane line detection and computer storage medium

    CN112785655A

  • Camera calibration processing method and device, equipment and storage medium

    CN114445506A

  • Inland ship identification and distance measurement method, system, medium, equipment and terminal

    CN115147723A