Camera calibration method and device
By displaying the actual viewing angle and reference viewing angle of the camera in the shooting interface, and adjusting the pitch angle using the installation height and horizontal distance, the complexity and inefficiency of the traditional camera calibration method are solved, and the effect of simplifying and improving calibration efficiency is achieved.
Patent Information
- Application Number
- CN202510485000.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-15
AI Technical Summary
Traditional camera calibration methods need to be carried out in specific sites and have high requirements for professional skills and auxiliary tools, resulting in complex and inefficient calibration processes.
By displaying the actual viewing angle and reference viewing angle of the target camera in the shooting interface, the installation height of the target camera, the first preset horizontal distance and the second preset horizontal distance, the pitch angle of the camera is adjusted so that the actual viewing angle line coincides with the reference viewing angle line.
No professional and technical personnel or specific calibration sites are required, which simplifies the camera calibration process and improves calibration efficiency.
Smart Images

Figure CN120495422A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of sensor calibration technology, and in particular relates to a camera calibration method and device. Background Art
[0002] An advanced driver assistance system (ADAS) is an electronic system integrated into a vehicle. It is designed to sense the vehicle's surroundings through various sensors (including cameras) installed on the vehicle, and to provide information to the driver, issue warnings, or automatically intervene in the vehicle's control when necessary, in order to improve the safety and comfort of vehicle driving. The installation angle of the camera in ADAS (such as the pitch angle) is the key to achieving precise control of vehicle distance. In practical applications, in order to ensure that the actual installation angle of the camera meets the safe driving requirements of ADAS, the camera usually needs to be calibrated. However, traditional camera calibration methods usually need to be carried out on a specific calibration site, and the requirements for the calibration site are relatively stringent; in addition, there are high requirements for the professional skills of the calibrator, and other auxiliary tools are needed to complete the calibration, resulting in a complicated camera calibration process and low calibration efficiency. Summary of the Invention
[0003] In view of this, the embodiments of the present application provide a camera calibration method and device to solve the technical problems of the traditional camera calibration method, such as the complex calibration process and low calibration efficiency.
[0004] In a first aspect, an embodiment of the present application provides a camera calibration method, comprising:
[0005] Displaying a shooting interface corresponding to a target camera, and displaying an actual viewing angle line of the target camera in the shooting interface;
[0006] Based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance, a reference viewing angle line is displayed in the shooting interface, so that the actual viewing angle line coincides with the reference viewing angle line by adjusting the pitch angle of the target camera;
[0007] Among them, the first preset horizontal distance is used to represent the horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second preset horizontal distance is used to represent the horizontal distance between the virtual ground calibration line within the field of view angle and the target camera.
[0008] In an optional implementation of the first aspect, displaying a reference viewing angle line in the shooting interface based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance includes:
[0009] Determining the height of a target point on the virtual calibration pole based on the installation height of the target camera, a first preset horizontal distance, and a second preset horizontal distance; the target point is a position on the virtual calibration pole where a line connecting the target camera and the virtual ground calibration line intersects;
[0010] A reference viewing angle line is displayed in the shooting interface according to the height of the target point.
[0011] In an optional implementation of the first aspect, determining the height of the target point on the virtual calibration pole based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance includes:
[0012] determining an expected pitch angle of the target camera according to the installation height and the second preset horizontal distance;
[0013] The height of the target point is determined according to the expected pitch angle and the first preset horizontal distance.
[0014] In an optional implementation of the first aspect, determining the expected pitch angle of the target camera according to the installation height and the second preset horizontal distance includes:
[0015] According to the installation height and the second preset horizontal distance, the expected pitch angle of the target camera is calculated using the following formula:
[0016] β except =arctan(H / D2);
[0017] Among them, β except is the expected pitch angle of the target camera, H is the installation height, and D2 is the second preset horizontal distance.
[0018] In an optional implementation of the first aspect, determining the height of the target point according to the expected pitch angle and the first preset horizontal distance includes:
[0019] The height of the target point is calculated according to the expected pitch angle and the first preset horizontal distance using the following formula:
[0020] EexpectedRH=H-tan(β exceptt )×D1;
[0021] Among them, EexpectedRH is the height of the target point, β except is the expected pitch angle, and D1 is the first preset horizontal distance.
[0022] In an optional implementation of the first aspect, after displaying the reference viewing angle line in the shooting interface, the method further includes:
[0023] Displaying the highest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum positive horizontal offset;
[0024] According to the installation height, the first preset horizontal distance and the maximum negative horizontal offset, the lowest viewing angle line of the target camera is displayed in the shooting interface.
[0025] In an optional implementation of the first aspect, displaying the highest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum positive horizontal offset includes:
[0026] Determining a maximum pitch angle of the target camera according to the installation height and the maximum positive horizontal offset;
[0027] Determining a third horizontal distance according to the maximum pitch angle of the target camera and the first preset horizontal distance; the third horizontal distance is used to represent the maximum horizontal distance between the virtual ground calibration line and the target camera;
[0028] According to the third horizontal distance, the highest viewing angle line of the target camera is displayed in the shooting interface.
[0029] In an optional implementation of the first aspect, displaying the lowest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum negative horizontal offset includes:
[0030] Determining a minimum pitch angle of the target camera according to the installation height and the maximum negative horizontal offset;
[0031] Determining a fourth horizontal distance according to the minimum pitch angle of the target camera and the first preset horizontal distance; the fourth horizontal distance is used to represent the minimum horizontal distance between the virtual ground calibration line and the target camera;
[0032] According to the fourth horizontal distance, the lowest viewing angle line of the target camera is displayed in the shooting interface.
[0033] In an optional implementation of the first aspect, the method further includes:
[0034] A scale ruler is displayed between the highest viewing angle line and the lowest viewing angle line according to the distance between the highest viewing angle line and the lowest viewing angle line, the preset number of scales, and the unit of the installation height; the scale ruler is used to assist in adjusting the pitch angle of the target camera.
[0035] In a second aspect, an embodiment of the present application provides a camera calibration device, comprising:
[0036] A first display unit is used to display a shooting interface corresponding to the target camera and to display an actual viewing angle line of the target camera in the shooting interface;
[0037] a second display unit, configured to display a reference viewing angle line in the shooting interface based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance, so that the actual viewing angle line coincides with the reference viewing angle line by adjusting the pitch angle of the target camera;
[0038] Among them, the first preset horizontal distance is used to represent the horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second preset horizontal distance is used to represent the horizontal distance between the virtual ground calibration line within the field of view angle and the target camera.
[0039] In a third aspect, an embodiment of the present application provides another camera calibration device, comprising a memory and a computer program stored in the memory and executable on a processor, wherein when the processor executes the computer program, the method described in any optional implementation of the first aspect is implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the camera calibration method as described in any optional implementation of the first aspect above.
[0041] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a camera calibration device, the camera calibration device implements the camera calibration method described in any optional implementation of the first aspect.
[0042] The camera calibration method, device, computer-readable storage medium, and computer program product provided by the embodiments of the present application have the following beneficial effects:
[0043] The camera calibration method provided in the embodiment of the present application can automatically display the reference viewing angle line in the shooting interface based on the installation height of the target camera, the first horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second horizontal distance between the virtual ground calibration line within the field of view angle and the target camera. By adjusting the pitch angle of the target camera, the actual viewing angle line can be made to coincide with the reference viewing angle line, thereby eliminating the need for professional technicians to perform camera calibration with the aid of auxiliary tools at a specific calibration site, simplifying the camera calibration process and improving the camera calibration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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 embodiments or descriptions of the prior art. 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 any creative work.
[0045] Figure 1 A schematic flowchart of a camera calibration method provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the display interface of a camera calibration device provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of an application scenario of a camera calibration method provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of a specific implementation flow of step 1.1 in a camera calibration method provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of another shooting interface provided in an embodiment of the present application;
[0050] Figure 6 A schematic flowchart of a camera calibration method provided in another embodiment of the present application;
[0051] Figure 7 A schematic diagram of another shooting interface provided in an embodiment of the present application;
[0052] Figure 8 This is a schematic flowchart of S601 in a camera calibration method provided in another embodiment of the present application;
[0053] Figure 9 This is a schematic flowchart of S602 in a camera calibration method provided in another embodiment of the present application;
[0054] Figure 10 A schematic flowchart of a camera calibration method provided in yet another embodiment of the present application;
[0055] Figure 11 A schematic diagram of a shooting interface provided in yet another embodiment of the present application;
[0056] Figure 12 A schematic structural diagram of a camera calibration device provided in an embodiment of the present application;
[0057] Figure 13 A structural diagram of a camera calibration device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0058] The following embodiments are only used to more clearly illustrate the technical solutions of the present application and are therefore only used as examples and are not intended to limit the scope of protection of the present application.
[0059] In the description of the embodiments of the present application, the technical terms "include", "comprise", "have" and any variations thereof mean "including but not limited to", unless otherwise specifically emphasized. In the description of the embodiments of the present application, unless otherwise specified, the technical term "multiple" refers to two or more than two, and the technical terms "at least one" and "one or more" refer to one, two or more. The technical terms "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. The technical term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships, such as A and / or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0060] The present embodiment first provides a camera calibration method, which is performed by a camera calibration device. In practical applications, the camera calibration device can be connected to a target camera to be calibrated. Based on this, the camera calibration device can calibrate the target camera by executing the camera calibration method provided in the embodiment of the present application.
[0061] In some embodiments, the target camera may be a forward-facing camera of the vehicle. The forward-facing camera of the vehicle refers to a camera facing the same direction as the vehicle's travel. It is understandable that since the actual field of view angle range of the vehicle's forward-facing camera (i.e., the actual shooting range) is crucial to the safe driving of the vehicle, the vehicle's forward-facing camera needs to be calibrated so that the actual field of view angle range of the vehicle's forward-facing camera meets the expected requirements. Based on this, the camera calibration device may be a built-in module of the vehicle control system, or it may be other electronic devices independent of the vehicle control system, such as a mobile phone or tablet computer.
[0062] In other embodiments, the target camera may also be a forward-facing camera of a self-moving device (such as a robot). The forward-facing camera of a self-moving device refers to a camera that faces the same direction as the moving direction of the self-moving device. It is understandable that since the actual field of view angle range of the forward-facing camera of the self-moving device is crucial for obstacle avoidance or autonomous navigation of the self-moving device, the forward-facing camera of the self-moving device needs to be calibrated so that the actual field of view angle range of the forward-facing camera of the self-moving device meets the expected requirements. Based on this, the camera calibration device can be a built-in module of the self-moving device, or it can be an electronic device independent of the self-moving device, such as a mobile phone or tablet computer.
[0063] The following takes the target camera as an ADAS camera as an example to describe in detail the camera calibration method provided in the embodiment of the present application.
[0064] For example, see Figure 1 , is a schematic flow chart of a camera calibration method provided in an embodiment of the present application. Figure 1 As shown, the camera calibration method may include S101 to S102, which are described in detail as follows:
[0065] S101, displaying a shooting interface corresponding to a target camera, and displaying an actual viewing angle line of the target camera in the shooting interface.
[0066] Among them, the shooting interface corresponding to the target camera can refer to a display interface used to display the image captured by the target camera in real time.
[0067] The actual viewing angle line of the target camera may refer to a line formed by the projection point of the optical axis of the target camera in the shooting interface through the horizontal extension, that is, the actual viewing angle line of the target camera is parallel to the horizontal edge of the shooting interface. For example, refer to Figure 2 , is a schematic diagram of a display interface of a camera calibration device provided in an embodiment of the present application. Figure 2 As shown in (a), assuming that point G is the projection point of the optical axis of the target camera in the shooting interface, the line 211 formed by the horizontal extension of point G is the actual viewing angle line of the target camera.
[0068] In a specific implementation, the camera calibration device can display the shooting interface corresponding to the target camera upon receiving the camera calibration instruction, and display the actual viewing angle of the target camera in the shooting interface. The camera calibration instruction is used to instruct the camera calibration device to start executing the camera calibration process, which includes: Figure 1 S101 to S102 shown.
[0069] For example, the camera calibration instruction can be manually triggered by the user. For example, the camera calibration device can be provided with a camera calibration button for the user to trigger the camera calibration instruction. Based on this, the camera calibration device can determine that the camera calibration instruction has been received when it detects that the camera calibration button has been triggered, and display the shooting interface corresponding to the target camera. In actual application, the camera calibration button can be a physical button provided on the camera calibration device, or it can be a virtual control configured in the main interface of the camera calibration device. The embodiment of the present application does not limit the type of camera calibration button.
[0070] For example, see Figure 2 (b) is a schematic diagram of the main interface of a camera calibration device provided in an embodiment of the present application. Figure 2 As shown in (b) of FIG, the main interface 22 of the camera calibration device may be configured with a camera calibration button 221. Based on this, the camera calibration device may display the following when detecting that the camera calibration button 221 is clicked: Figure 2 The shooting interface 21 shown in (a) in FIG.
[0071] S102, based on the installation height of the target camera, the first preset horizontal distance and the second preset horizontal distance, displaying a reference viewing angle line in the shooting interface so that the actual viewing angle line coincides with the reference viewing angle line by adjusting the pitch angle of the target camera.
[0072] The installation height of the target camera may refer to the vertical distance from the target camera to the ground. For example, see Figure 3 , is a schematic diagram of an application scenario of a camera calibration method provided in an embodiment of the present application. Figure 3 As shown, taking the target camera as the forward-facing camera of the vehicle as an example, the installation height of the target camera 31 may refer to the length of the vertical line segment AB from point A where the target camera 31 is located to the ground.
[0073] In an optional implementation, the installation height of the target camera can be input into the camera calibration device by the user before the camera calibration device starts executing the camera calibration process (i.e., before the camera calibration device receives the camera calibration instruction, i.e., before the user clicks the camera calibration button 221). Based on this, for example, please continue to refer to Figure 2 In (b), the main interface 22 of the camera calibration device can also be configured with an installation height editing control 222 of the target camera, and the user can enter the installation height editing control 222 by clicking the installation height editing control 222. Figure 2 The installation height editing interface 23 of the target camera shown in (c) is shown. Figure 2 As shown in (c) in the figure, the target camera's installation height editing interface 23 may include input prompt information 231, a height unit switching component 232, and a height value input box 233. The height unit switching component 232 may include at least two height unit options, such as centimeters (cm) and inches (inches). Based on this, the user can select the corresponding height unit in the target camera's installation height editing interface 23 and enter the pre-measured target camera's installation height in the height value input box 233. The camera calibration device can determine the target camera's installation height based on the value entered by the user in the height value input box 233 and the selected height unit, and store the target camera's installation height entered by the user. For example, assuming that the user selects the centimeter (cm) height unit in the target camera's installation height editing interface 23 and enters the value 204 in the height value input box 233, the camera calibration device can store 204cm as the target camera's installation height.
[0074] In another optional implementation, the installation height of the target camera can be input into the camera calibration device by the user after the camera calibration device starts executing the camera calibration process (i.e., after the camera calibration device receives the camera calibration instruction). Based on this, the camera calibration device can first display the following after receiving the camera calibration instruction: Figure 2 In the target camera installation height editing interface 23 shown in (c), after the user enters the target camera installation height in the target camera installation height editing interface 23, the camera calibration device can store the target camera installation height entered by the user and display the target camera installation height as shown in FIG. Figure 2 The shooting interface 21 shown in (a) in the figure is shown, and the actual viewing angle line 211 of the target camera is displayed in the shooting interface 21.
[0075] The first preset horizontal distance is used to represent the horizontal distance between the virtual calibration rod and the target camera within the field of view of the target camera, that is, the length of the shortest line segment on the ground mapped between any point on the virtual calibration rod and the target camera. The virtual calibration rod is perpendicular to the ground. For example, please refer to Figure 3 The first preset horizontal distance may refer to the length of a line segment BC on the ground mapped between any point (e.g., point E) on the virtual calibration pole 32 and the target camera 31. The value of the first preset horizontal distance may be set according to actual needs. For example, the first preset horizontal distance may be 5 meters (m).
[0076] The second preset horizontal distance is used to represent the horizontal distance between the virtual ground calibration line and the target camera within the field of view of the target camera. The virtual ground calibration line is perpendicular to the driving direction of the vehicle. For example, please continue to refer to Figure 3 The second preset horizontal distance may refer to the length of the shortest line segment BD between the point on the ground mapped by the target camera 31 (i.e., point B) and the virtual ground demarcation line 33. The value of the second preset horizontal distance may be set according to actual needs. For example, the second preset horizontal distance may be 20 m.
[0077] It should be noted that the above-mentioned virtual calibration poles and virtual ground calibration lines are assumed by the camera calibration device when executing the camera calibration process, and do not actually need to be set within the field of view angle of the target camera. That is, the camera calibration method provided in the embodiment of the present application does not require the actual setting of calibration poles and ground calibration lines in the calibration site. The camera calibration device can realize automatic calibration of the camera based on the camera calibration method provided in the embodiment of the present application. Not only does it have no requirements for the calibration site, but it also simplifies the camera calibration process and improves the camera calibration efficiency.
[0078] Optionally, S102 may specifically include steps 1.1 to 1.2, which are described in detail as follows:
[0079] Step 1.1: Determine the height of the target point on the virtual calibration pole based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance.
[0080] The target point may refer to the position on the virtual calibration pole where the line connecting the target camera and the virtual ground calibration line intersects. The height of the target point may refer to the vertical distance from the target point to the ground. For example, please refer to Figure 3 Assuming that the line AD connecting point A where the target camera 31 is located and the ground calibration line falls on point F on the virtual calibration pole 32, the length of the line segment FC is the height of the target point.
[0081] In a specific implementation, step 1.1 can be performed as follows Figure 4 The implementation of S1021 to S1022 shown is described in detail as follows:
[0082] S1021: Determine an expected pitch angle of the target camera according to the installation height of the target camera and a second preset horizontal distance.
[0083] The expected pitch angle of the target camera refers to the expected angle between the optical axis of the target camera and the ground.
[0084] Specifically, the camera calibration device can calculate the expected pitch angle of the target camera according to the installation height of the target camera and the second preset horizontal distance using the following formula (1):
[0085] β except =arctan(H / D2);
[0086] Among them, β except is the expected pitch angle of the target camera, H is the installation height of the target camera, and D2 is the second preset horizontal distance.
[0087] S1022: Determine the height of the target point according to the expected pitch angle and the first preset horizontal distance.
[0088] Specifically, the camera calibration device can calculate the height of the target point according to the expected pitch angle of the target camera and the first preset horizontal distance using the following formula (2):
[0089] EexpectedRH=H-tan(β except )×D1; formula (2)
[0090] Wherein, EexpectedRH is the height of the target point, and D1 is the first preset horizontal distance.
[0091] In practical applications, the camera calibration device can substitute the above formula (1) into the above formula (2), and simplify the formula obtained after substitution, and obtain the final calculation formula for the height of the target point: EexpectedRH = (D2-D1) × (H / D2), and calculate the height of the target point based on the final formula.
[0092] It should be noted that when the camera calibration device calculates the height of the target point, it is necessary to unify the units of each parameter in the above formula, for example, convert the units of each parameter into centimeters.
[0093] In step 1.2, a reference viewing angle line is displayed on the shooting interface based on the height of the target point.
[0094] The reference viewing angle line may refer to an expected viewing angle line of a target camera that meets the requirements of a corresponding usage scenario.
[0095] In actual applications, the camera calibration device can determine the mapping point of the target point in the shooting interface based on the height of the target point, the internal parameters of the target camera, and the external parameters of the target camera. The line formed by the horizontal extension of the mapping point is the reference viewing angle line. It should be noted that since the method for determining the mapping point of objects in the actual scene in the camera's shooting interface is existing technology, the specific method for determining the above-mentioned mapping point can be referred to the description in the relevant technology and will not be repeated here.
[0096] For example, see Figure 5 , is a schematic diagram of another shooting interface provided by an embodiment of the present application. Figure 5 As shown in (a), assuming that the mapping point of the target point in the shooting interface is point R, the line 212 formed by the horizontal extension of point R is the reference viewing angle line, that is, the reference viewing angle line is also parallel to the horizontal edge of the shooting interface.
[0097] In one optional implementation, after the camera calibration device displays the reference viewing angle in the capture interface, it can automatically adjust the pitch angle of the target camera so that the actual viewing angle coincides with the reference viewing angle, thereby calibrating the target camera. This approach can reduce the manual process of camera calibration and improve the degree of automation of camera calibration.
[0098] In another optional implementation, after the camera calibration device displays the reference viewing angle line in the shooting interface, the user can adjust the elevation angle of the target camera so that the actual viewing angle line coincides with the reference viewing angle line, thereby achieving calibration of the target camera.
[0099] For example, please refer to Figure 5 ,like Figure 5 As shown in (b) of FIG, the camera calibration device or the user can adjust the pitch angle of the target camera to move the actual viewing angle line 211 toward the reference viewing angle line 212. When the actual viewing angle line 211 coincides with the reference viewing angle line 212, the pitch angle adjustment of the target camera is stopped to complete the calibration of the target camera. After the target camera calibration is completed, the user can fix the target camera for subsequent use.
[0100] From the above, it can be seen that the camera calibration method provided in the embodiment of the present application can automatically display the reference viewing angle line in the shooting interface based on the installation height of the target camera, the first horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second horizontal distance between the virtual ground calibration line within the field of view angle and the target camera. By adjusting the pitch angle of the target camera, the actual viewing angle line can be made to coincide with the reference viewing angle line, thereby eliminating the need for professional technicians to perform camera calibration with the help of auxiliary tools at a specific calibration site, simplifying the camera calibration process and improving the camera calibration efficiency.
[0101] Optionally, in order to improve the accuracy of camera calibration and reduce the probability of miscalibration, another embodiment of the present application further provides a camera calibration method. Figure 6 , is a schematic flow chart of a camera calibration method provided in another embodiment of the present application. The camera calibration method provided in this embodiment is relative to Figure 1 The corresponding camera calibration method also includes Figure 6 S601 to S602 shown are described in detail as follows:
[0102] S601: Display the highest viewing angle line of the target camera in the shooting interface according to the installation height of the target camera, the first preset horizontal distance, and the maximum positive horizontal offset.
[0103] The maximum positive horizontal offset refers to the maximum positive offset distance allowed for the virtual ground calibration line, that is, the maximum distance the virtual ground calibration line is allowed to deviate away from the target camera. For example, please continue to refer to Figure 3 The maximum positive horizontal offset may refer to the length of the line segment DH between point D where the virtual ground calibration line is located and point H where the virtual ground calibration line is allowed to be at its farthest position.
[0104] In a specific implementation, S601 may include: Figure 8 S6011 to S6013 shown are described in detail as follows:
[0105] S6011: Determine a maximum pitch angle of the target camera based on the installation height of the target camera and the maximum positive horizontal offset.
[0106] Specifically, the camera calibration device can calculate the maximum pitch angle of the target camera according to the installation height and the maximum positive horizontal offset of the target camera using the following formula (3):
[0107] β max =arctan(H / D max ); formula (3)
[0108] Among them, βmax is the maximum pitch angle of the target camera, H is the installation height of the target camera, D max is the maximum positive horizontal offset.
[0109] S6012: Determine a third horizontal distance according to the maximum pitch angle of the target camera and the first preset horizontal distance.
[0110] The third horizontal distance is used to represent the maximum horizontal distance between the virtual ground calibration line and the target camera. For example, please continue to refer to Figure 3 The third horizontal distance may be the length of a line segment BH on the ground mapped between the line AH connecting the farthest position H allowed for the virtual ground calibration line and the target camera 31 .
[0111] Specifically, the camera calibration device can calculate the third horizontal distance according to the maximum pitch angle of the target camera and the first preset horizontal distance using the following formula (4):
[0112] Top=H-tan(β max )×D1; formula (4)
[0113] Among them, Top is the third horizontal distance, β max is the maximum pitch angle of the target camera, and D1 is the first preset horizontal distance.
[0114] S6013: Display the highest viewing angle line of the target camera in the shooting interface according to the third horizontal distance.
[0115] The camera calibration device can determine the projection line of the virtual ground calibration line at the third horizontal distance in the shooting interface as the highest viewing angle line of the target camera. In specific implementation, it can first be determined that the line connecting the target camera and the virtual ground calibration line at the third horizontal distance intersects at the highest point on the virtual calibration pole, and the mapping point of the highest point in the shooting interface is determined. The line formed by the horizontal extension of the mapping point is the highest viewing angle line. For example, please continue to refer to Figure 3 Assume that the line AH connecting the target camera point A and the virtual ground calibration line at the third horizontal distance (i.e., the farthest position H allowed for the virtual ground calibration line) intersects at the highest point on the virtual calibration pole 32 at point W. The mapping point position of point W in the shooting interface is as follows: Figure 7 As shown in (a) of FIG, the line 213 formed by the horizontal extension of point S is the highest viewing angle line.
[0116] S602: Displaying the lowest viewing angle line of the target camera in the shooting interface according to the installation height of the target camera, the first preset horizontal distance, and the maximum negative horizontal offset.
[0117] The maximum negative horizontal offset refers to the maximum negative offset distance allowed for the virtual ground calibration line, that is, the maximum distance the virtual ground calibration line is allowed to deviate toward the target camera. For example, please continue to refer to Figure 3 The maximum negative horizontal offset may refer to the length of the line segment DK between point D where the virtual ground calibration line is located and point K, the closest position allowed for the virtual ground calibration line.
[0118] In a specific implementation, S602 may include: Figure 9 S6021 to S6023 shown are described in detail as follows:
[0119] S6021: Determine the minimum pitch angle of the target camera based on the installation height of the target camera and the maximum negative horizontal offset.
[0120] Specifically, the camera calibration device can calculate the minimum pitch angle of the target camera according to the installation height of the target camera and the preset maximum negative horizontal offset using the following formula (5):
[0121] β min =arctan(H / D min ); formula (5)
[0122] Among them, β min is the minimum pitch angle of the target camera, H is the installation height of the target camera, D min The preset maximum negative horizontal offset.
[0123] S6022: Determine a fourth horizontal distance according to the minimum pitch angle of the target camera and the first preset horizontal distance.
[0124] The fourth horizontal distance is used to represent the minimum horizontal distance between the virtual ground calibration line and the target camera. For example, please continue to refer to Figure 3 The fourth horizontal distance may be the length of a line segment BK mapped on the ground between the line AK connecting the nearest position K allowed for the virtual ground calibration line and the target camera 31 .
[0125] Specifically, the camera calibration device can calculate the fourth horizontal distance according to the minimum pitch angle of the target camera and the first preset horizontal distance using the following formula (6):
[0126] Bottom=H-tan(β min )×D1; formula (6)
[0127] Among them, Bottom is the fourth horizontal distance, β min is the minimum pitch angle of the target camera, and D1 is the first preset horizontal distance.
[0128] S6023: Display the lowest viewing angle line of the target camera in the shooting interface according to the fourth horizontal distance.
[0129] The camera calibration device can determine the projection line of the virtual ground calibration line at the fourth horizontal distance in the shooting interface as the lowest viewing angle line of the target camera. In specific implementation, it can first be determined that the line connecting the target camera and the virtual ground calibration line at the fourth horizontal distance intersects at the lowest point on the virtual calibration pole, and the mapping point of the lowest point in the shooting interface is determined. The line formed by the horizontal extension of the mapping point is the lowest viewing angle line. For example, please continue to refer to Figure 3 , assuming that the line AH connecting the target camera point A and the virtual ground calibration line at the fourth horizontal distance (i.e., the farthest position K allowed for the virtual ground calibration line) intersects at the lowest point on the virtual calibration pole 32 is point Z, the mapping point position of point Z in the shooting interface is as follows Figure 7 As shown in (a) of FIG, the line 213 formed by the horizontal extension of point J is the lowest viewing angle line.
[0130] It should be noted that the embodiment of the present application does not limit the execution order of S601 and S602.
[0131] In an optional implementation, after the camera calibration device displays the highest and lowest viewing angles in the shooting interface, the camera calibration device may automatically determine whether the reference viewing angle is between the highest and lowest viewing angles. Optionally, if the reference viewing angle is between the highest and lowest viewing angles, the camera calibration device may automatically adjust the pitch angle of the target camera so that the actual viewing angle in the shooting interface coincides with the reference viewing angle, thereby achieving calibration of the target camera.
[0132] In another optional implementation, after the camera calibration device displays the highest and lowest viewing angles in the shooting interface, the user can determine whether the reference viewing angle is between the highest and lowest viewing angles. Optionally, if the reference viewing angle is between the highest and lowest viewing angles, the user can adjust the pitch angle of the target camera so that the actual viewing angle in the shooting interface coincides with the reference viewing angle, thereby achieving calibration of the target camera.
[0133] For example, please refer to Figure 7 ,like Figure 7 As shown in (a) of FIG, assuming that the reference viewing angle line 212 is between the highest viewing angle line 213 and the lowest viewing angle line 214, the camera calibration device or the user can adjust the pitch angle of the target camera to move the actual viewing angle line 211 toward the reference viewing angle line 212, as shown in FIG. Figure 7As shown in (b), when the actual viewing angle line 211 coincides with the reference viewing angle line 212, the adjustment of the pitch angle of the target camera is stopped to complete the calibration of the target camera.
[0134] It can be seen from the above that the camera calibration method provided in this embodiment can reduce the probability of miscalibration of the target camera by limiting the position range of the reference viewing angle line in the shooting interface.
[0135] It is understandable that, in some cases, directly adjusting the pitch angle of the target camera up and down may not make the actual viewing angle line in the shooting interface completely coincide with the reference viewing angle line. Based on this, in order to improve the accuracy of camera calibration, in other embodiments, after the highest viewing angle line and the lowest viewing angle line are displayed in the shooting interface, the camera calibration method may further include the following steps: Figure 10 The S603 shown is described in detail as follows:
[0136] S603 : Displaying a scale ruler between the highest viewing angle line and the lowest viewing angle line according to the distance between the highest viewing angle line and the lowest viewing angle line, the preset number of scales, and the unit of the installation height.
[0137] The scale ruler may be a digital scale ruler for assisting in adjusting the pitch angle of the target camera.
[0138] The preset number of scales is a positive integer. The preset number of scales can be set according to actual needs. The number of scales corresponding to different height units can be the same or different.
[0139] For example, assuming that the unit of the installation height selected by the user when inputting the installation height is centimeters, the distance between the highest viewing angle line and the lowest viewing angle line is r1 centimeters, and the number of scales corresponding to the centimeter unit is s1, then the camera calibration device can generate a scale every r1 / s1 centimeters between the highest viewing angle line and the lowest viewing angle line, thereby generating s1 scales, and the s1 scales constitute the scale ruler. Figure 11 As shown, the scale extension direction of the scale ruler 215 is parallel to the vertical side of the shooting interface.
[0140] It can be understood that since the actual viewing angle line and the reference viewing angle line are both parallel to the horizontal side of the shooting interface, and the scale extension direction of the scale ruler is parallel to the vertical side of the shooting interface, the actual viewing angle line and the reference viewing angle line are both perpendicular to the scale extension direction of the scale ruler and fall at different positions on the scale ruler respectively.
[0141] In an optional implementation, after the camera calibration device displays a scale ruler between the highest viewing angle line and the lowest viewing angle line, it can determine a first adjustment amount of the pitch angle of the target camera based on a first scale value where the actual viewing angle line falls on the scale ruler and a second scale value where the reference viewing angle line falls on the scale ruler, and adjust the pitch angle of the target camera by the first adjustment amount toward the direction of the reference viewing angle line.
[0142] Specifically, the camera calibration device can determine the difference between the second scale value and the first scale value as the viewing angle adjustment amount, and based on the internal parameters and external parameters of the target camera, convert the viewing angle adjustment amount into a first adjustment amount of the pitch angle of the target camera, and adjust the pitch angle of the target camera toward the reference viewing angle by the first adjustment amount. For example, Figure 11 As shown in (a), if the reference viewing angle line 212 is located above the actual viewing angle line 211, the camera calibration device can adjust the pitch angle of the target camera upward by a first adjustment amount so that the actual viewing angle line 211 completely coincides with the reference viewing angle line 212 (e.g., Figure 11 As shown in (b) in the figure), this can improve the accuracy of camera calibration.
[0143] Furthermore, when verifying a calibrated target camera, the calibrator can stop the vehicle with the target camera on an open, flat surface and place a ground calibration line perpendicular to the vehicle's direction of travel at a second preset horizontal distance in front of the vehicle. The calibrator then checks to see if the line mapped to the ground calibration line in the capture interface coincides with the reference viewpoint line. If so, the target camera has been accurately calibrated.
[0144] From the above, it can be seen that the camera calibration method provided in the embodiment of the present application can assist the camera calibration device to accurately determine the first adjustment amount of the pitch angle of the target camera by displaying a vertical scale in the shooting interface. By adjusting the pitch angle of the target camera based on the first adjustment amount, the actual viewing angle line in the shooting interface can be completely coincided with the reference viewing angle line, thereby achieving accurate calibration of the target camera, that is, improving the accuracy of camera calibration.
[0145] It can be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0146] Based on the camera calibration method provided in the above embodiment, the present application further provides an embodiment of a camera calibration device for implementing the above method embodiment. Figure 12, is a structural diagram of a camera calibration device provided in an embodiment of the present application. For ease of explanation, only the parts related to this embodiment are shown. Figure 12 As shown, the camera calibration device 120 may include: a first display unit 1201 and a second display unit 1202.
[0147] The first display unit 1201 is used to display a shooting interface corresponding to the target camera, and to display an actual viewing angle line of the target camera in the shooting interface.
[0148] The second display unit 1202 is used to display a reference viewing angle line in the shooting interface based on the installation height of the target camera, the first preset horizontal distance and the second preset horizontal distance, so that the actual viewing angle line coincides with the reference viewing angle line by adjusting the pitch angle of the target camera.
[0149] Among them, the first preset horizontal distance is used to represent the horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second preset horizontal distance is used to represent the horizontal distance between the virtual ground calibration line within the field of view angle and the target camera.
[0150] Optionally, the second display unit 1202 may include a first determination unit and a reference unit.
[0151] The second display unit 1202 is used to determine the height of the target point on the virtual calibration pole based on the installation height of the target camera, the first preset horizontal distance and the second preset horizontal distance; the target point is the position on the virtual calibration pole where the line connecting the target camera and the virtual ground calibration line intersects.
[0152] The reference unit is used to display a reference viewing angle line in the shooting interface according to the height of the target point.
[0153] Optionally, the first determining unit is specifically configured to:
[0154] determining an expected pitch angle of the target camera according to the installation height and the second preset horizontal distance;
[0155] The height of the target point is determined according to the expected pitch angle and the first preset horizontal distance.
[0156] Optionally, the first determining unit is further configured to:
[0157] According to the installation height and the second preset horizontal distance, the expected pitch angle of the target camera is calculated using the following formula:
[0158] β except=arctan(H / D2);
[0159] Among them, β except is the expected pitch angle of the target camera, H is the installation height, and D2 is the second preset horizontal distance.
[0160] Optionally, the first determining unit is further configured to:
[0161] The height of the target point is calculated according to the expected pitch angle and the first preset horizontal distance using the following formula:
[0162] EexpectedRH=H-tan(β exceptt )×D1;
[0163] Among them, EexpectedRH is the height of the target point, β except is the expected pitch angle, and D1 is the first preset horizontal distance.
[0164] Optionally, the camera calibration device 120 further includes a third display unit and a fourth display unit.
[0165] The third display unit is used to display the highest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance and the maximum positive horizontal offset.
[0166] The fourth display unit is used to display the lowest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance and the maximum negative horizontal offset.
[0167] Optionally, the third display unit is specifically used to:
[0168] Determining a maximum pitch angle of the target camera according to the installation height and the maximum positive horizontal offset;
[0169] Determining a third horizontal distance according to the maximum pitch angle of the target camera and the first preset horizontal distance; the third horizontal distance is used to represent the maximum horizontal distance between the virtual ground calibration line and the target camera;
[0170] According to the third horizontal distance, the highest viewing angle line of the target camera is displayed in the shooting interface.
[0171] Optionally, the fourth display unit is specifically used to:
[0172] Determining a minimum pitch angle of the target camera according to the installation height and the maximum negative horizontal offset;
[0173] Determining a fourth horizontal distance according to the minimum pitch angle of the target camera and the first preset horizontal distance; the fourth horizontal distance is used to represent the minimum horizontal distance between the virtual ground calibration line and the target camera;
[0174] According to the fourth horizontal distance, the lowest viewing angle line of the target camera is displayed in the shooting interface.
[0175] Optionally, the camera calibration device 120 further includes a fifth display unit.
[0176] The fifth display unit is used to display a scale ruler between the highest viewing angle line and the lowest viewing angle line according to the distance between the highest viewing angle line and the lowest viewing angle line, the preset number of scales and the unit of the installation height; the scale ruler is used to assist in adjusting the pitch angle of the target camera.
[0177] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the camera calibration device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of this application. The specific working process of each unit in the above-mentioned camera calibration device can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0178] See also Figure 13 , Figure 13 This is a structural diagram of a camera calibration device provided by another embodiment of the present application. Figure 13 As shown, the camera calibration device 13 provided in this embodiment may include: a processor 130, a memory 131, and a computer program 132 stored in the memory 131 and executable on the processor 130, such as a program corresponding to the camera calibration method. When the processor 130 executes the computer program 132, the steps in the above-mentioned camera calibration method embodiment are implemented, such as Figure 1 Alternatively, when the processor 130 executes the computer program 132, the functions of each module / unit in the above-mentioned camera calibration device embodiment are realized, for example Figure 12 The functions of units 1201-1202 are shown.
[0179] Exemplarily, the computer program 132 may be divided into one or more modules / units, one or more modules / units being stored in the memory 131 and executed by the processor 130 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 132 in the camera calibration device 13. For example, the computer program 132 may be divided into a first display unit and a second display unit. The specific functions of each unit may be described in detail in the following sections. Figure 12 The relevant descriptions in the corresponding embodiments are not repeated here.
[0180] Those skilled in the art will understand that Figure 13 The camera calibration device 13 is merely an example and does not limit the camera calibration device 13 . The camera calibration device 13 may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0181] The processor 130 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0182] The memory 131 can be an internal storage unit of the camera calibration device 13, such as a hard disk or memory of the camera calibration device 13. The memory 131 can also be an external storage device of the camera calibration device 13, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card equipped on the camera calibration device 13. Furthermore, the memory 131 can also include both an internal storage unit of the camera calibration device 13 and an external storage device. The memory 131 is used to store computer programs and other programs and data required by the camera calibration device. The memory 131 can also be used to temporarily store data that has been output or is to be output.
[0183] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, each step of the camera calibration method in the above method embodiment is implemented.
[0184] An embodiment of the present application provides a computer program product. When the computer program product runs on a camera calibration device, the camera calibration device implements the steps in the above-mentioned various method embodiments.
[0185] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0186] It should be noted that, unless otherwise specified, all technical terms used in the embodiments of this application have the same meanings as those commonly understood by those skilled in the art in the technical field of this application. The technical terms used in the embodiments of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0187] The phrase "embodiment" mentioned in the description of the embodiments of the present application means that the specific features, structures, or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive with other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0188] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0189] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A camera calibration method, characterized in that: include: Displaying a shooting interface corresponding to a target camera, and displaying an actual viewing angle line of the target camera in the shooting interface; Based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance, a reference viewing angle line is displayed in the shooting interface, so that the actual viewing angle line coincides with the reference viewing angle line by adjusting the pitch angle of the target camera; Among them, the first preset horizontal distance is used to represent the horizontal distance between the virtual calibration pole within the field of view angle of the target camera and the target camera, and the second preset horizontal distance is used to represent the horizontal distance between the virtual ground calibration line within the field of view angle and the target camera.
2. The method according to claim 1, characterized in that Displaying a reference viewing angle line in the shooting interface based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance includes: Determining the height of a target point on the virtual calibration pole based on the installation height of the target camera, a first preset horizontal distance, and a second preset horizontal distance; the target point is a position on the virtual calibration pole where a line connecting the target camera and the virtual ground calibration line intersects; A reference viewing angle line is displayed in the shooting interface according to the height of the target point.
3. The method according to claim 2, characterized in that Determining the height of the target point on the virtual calibration pole based on the installation height of the target camera, the first preset horizontal distance, and the second preset horizontal distance includes: determining an expected pitch angle of the target camera according to the installation height and the second preset horizontal distance; The height of the target point is determined according to the expected pitch angle and the first preset horizontal distance.
4. The method according to claim 3, characterized in that Determining an expected pitch angle of the target camera according to the installation height and the second preset horizontal distance includes: According to the installation height and the second preset horizontal distance, the expected pitch angle of the target camera is calculated using the following formula: β except =arctan(H / D2); Among them, β except is the expected pitch angle of the target camera, H is the installation height, and D2 is the second preset horizontal distance.
5. The method according to claim 3, characterized in that Determining the height of the target point according to the expected pitch angle and the first preset horizontal distance includes: The height of the target point is calculated according to the expected pitch angle and the first preset horizontal distance using the following formula: EexpectedRH=H-tan(β exceptt )×D1; Among them, EexpectedRH is the height of the target point, β except is the expected pitch angle, and D1 is the first preset horizontal distance.
6. The method according to any one of claims 1 to 5, characterized in that After the reference viewing angle line is displayed in the shooting interface, the method further includes: Displaying the highest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum positive horizontal offset; According to the installation height, the first preset horizontal distance and the maximum negative horizontal offset, the lowest viewing angle line of the target camera is displayed in the shooting interface.
7. The method according to claim 6, characterized in that Displaying the highest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum positive horizontal offset includes: Determining a maximum pitch angle of the target camera according to the installation height and the maximum positive horizontal offset; Determining a third horizontal distance according to the maximum pitch angle of the target camera and the first preset horizontal distance; the third horizontal distance is used to represent the maximum horizontal distance between the virtual ground calibration line and the target camera; According to the third horizontal distance, the highest viewing angle line of the target camera is displayed in the shooting interface.
8. The method according to claim 6, characterized in that Displaying the lowest viewing angle line of the target camera in the shooting interface according to the installation height, the first preset horizontal distance, and the maximum negative horizontal offset includes: Determining a minimum pitch angle of the target camera according to the installation height and the maximum negative horizontal offset; Determining a fourth horizontal distance according to the minimum pitch angle of the target camera and the first preset horizontal distance; the fourth horizontal distance is used to represent the minimum horizontal distance between the virtual ground calibration line and the target camera; According to the fourth horizontal distance, the lowest viewing angle line of the target camera is displayed in the shooting interface.
9. The method according to any one of claims 6 to 8, characterized in that: Also includes: A scale ruler is displayed between the highest viewing angle line and the lowest viewing angle line according to the distance between the highest viewing angle line and the lowest viewing angle line, the preset number of scales, and the unit of the installation height; the scale ruler is used to assist in adjusting the pitch angle of the target camera.
10. A camera calibration device, characterized in that: The method comprises a memory and a computer program stored in the memory and executable on a processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the computer program.