Camera calibration method and related device

By placing the target calibration object in the center of the camera field of view and determining the camera parameters using scale and direction characteristics, the problems of low efficiency and low accuracy of the existing methods are solved, and efficient and accurate camera calibration is achieved.

CN120339408AActive Publication Date: 2025-07-18深圳睿像技术有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510320505.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-18
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

Existing camera calibration methods such as Zhang Zhengyou calibration method and camera motion-based calibration methods are inefficient and have low accuracy in complex scenarios. Especially in fixed camera calibration tasks, it is easy to have mismatch, making it difficult to accurately determine internal and external parameters.

Method used

By placing the target calibration object at the center of the camera's field of view, using the image center as the origin of the coordinate system, combining the scale and directional characteristics of the target calibration object, the first and second calibration parameters of the camera are determined to avoid the influence of distortion.

Benefits of technology

Improves the efficiency and accuracy of camera calibration, simplifies the calibration process, and is suitable for fixed camera calibration tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339408A_ABST
    Figure CN120339408A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a camera calibration method and a related device, and the method comprises the steps: obtaining a first image, shot by a target camera, of a target calibration object, determining a target position when it is judged that the center of the target calibration object is imaged at the center of the first image, and building a world coordinate system with the target position as the origin of the coordinate system; determining a first calibration parameter according to the first coordinate and the second coordinate; and determining a second calibration parameter according to the first scale feature and the first direction feature. A target calibration object is placed in the center of a view field of a target camera, a principal point coordinate is set as an image center, a first calibration parameter of the target camera is determined according to a first coordinate and a second coordinate, and a second calibration parameter of the target camera is determined according to a first scale feature and a first direction feature of the target calibration object. And the camera calibration efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of machine vision, and particularly relates to a camera calibration method and related device. Background Art

[0002] The calibration parameters of a camera are key parameters that describe the internal optical characteristics of the camera and the relationship with the external spatial position. It can accurately project an object in the three-dimensional world coordinate system onto the two-dimensional image plane, thereby reflecting the spatial position, shape of the object, and its performance in the image. Usually, camera calibration needs to be carried out before the measurement task starts, so as to perform accurate coordinate transformation in the subsequent image processing and calculation processes.

[0003] Currently, the more commonly used camera calibration method is Zhang Zhengyou calibration method. The Zhang Zhengyou calibration method uses a camera to take multiple photos of a checkerboard. Through the homography transformation of multiple images, the internal parameters of the camera are calculated, and then the external parameters of the camera are obtained using the PnP (Perspective-n-Point) method. However, the Zhang Zhengyou method is relatively complex and it is difficult to find a checkerboard of a suitable size when the field of view is large. There are also camera calibration methods based on camera motion, such as SFM (Structure from Motion). This calibration method matches the feature points in the camera views under two different perspectives, uses the epipolar geometry to perform Euclidean structure recovery, can obtain the fundamental matrix under the two views, and decompose the internal and external parameters of the camera. However, the camera calibration method based on camera motion is suitable for mobile platforms such as unmanned aerial vehicles whose poses can change freely, and it requires obvious textures in the shooting scene for feature point extraction. If there are many places with similar textures in the object to be measured, then it is easy to have false matches in the feature point matching link, resulting in inaccurate internal and external parameters of the camera calibration. At the same time, this calibration method is not applicable to most fixed camera calibration tasks. Summary of the Invention

[0004] The embodiments of this application provide a camera calibration method and related device. By placing the target calibration object at the center of the field of view of the target camera, setting the principal point coordinates as the image center, and not considering the distortion of this point, the first calibration parameters of the target camera are determined according to the first coordinate and the second coordinate, and the second calibration parameters of the target camera are determined according to the first scale feature and the first direction feature of the target calibration object, which is beneficial to improving the efficiency of camera calibration.

[0005] In a first aspect, the embodiments of this application provide a camera calibration method, and the method includes:

[0006] Obtain a first image of a target calibration object captured by a target camera, where the target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature;

[0007] Determine whether the center of the target calibration object is imaged at the center of the first image;

[0008] When it is determined that the center of the target calibration object is imaged at the center of the first image, determine the target position, and establish a world coordinate system with the target position as the origin of the coordinate system;

[0009] Determine the first coordinate of the target calibration object in the world coordinate system, and determine the second coordinate of the target camera in the world coordinate system;

[0010] Determine the first calibration parameter of the target camera according to the first coordinate and the second coordinate;

[0011] Determine the second calibration parameter of the target camera according to the first scale feature and the first direction feature.

[0012] In a possible example, the determining the target position includes:

[0013] Determine the first distance in the vertical direction between the target calibration object and the target camera;

[0014] Determine the first position of the target camera;

[0015] Determine the target position according to the first position and the first distance.

[0016] In a possible example, the determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate includes:

[0017] According to the first coordinate, determine the second distance in the X-axis direction and the third distance in the Z-axis direction from the target calibration object to the origin of the coordinate system of the world coordinate system;

[0018] According to the second coordinate, determine the first distance from the target camera to the origin of the coordinate system of the world coordinate system;

[0019] Determine the pitch angle of the target camera according to the first distance and the third distance;

[0020] Determine the yaw angle of the target camera according to the second distance and the third distance.

[0021] In a possible example, the determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature includes:

[0022] Determine the second scale feature and the second direction feature between the first sub-marker and the second sub-marker in the first image;

[0023] Determine the equivalent focal length of the target camera according to the first scale feature and the second scale feature;

[0024] Determine the roll angle of the target camera according to the first direction feature and the second direction feature.

[0025] In a possible example, the determining the equivalent focal length of the camera according to the first scale feature and the second scale feature includes:

[0026] Determine a fourth distance according to the first scale feature;

[0027] Determine a fifth distance according to the second scale feature;

[0028] Substitute the first distance, the second distance, the third distance, the fourth distance and the fifth distance into the equivalent focal length formula to calculate the equivalent focal length of the camera.

[0029] In a possible example, the determining whether the center of the target calibration object is imaged at the center of the first image includes:

[0030] Draw a graphic frame at the center of the first image;

[0031] Determine the first center coordinates of the center of the first sub-marker;

[0032] Determine the second center coordinates of the center of the second sub-marker;

[0033] Determine the third center coordinates of the center of the target calibration object according to the first center coordinates and the second center coordinates;

[0034] If it is determined that the point corresponding to the third center coordinates falls within the graphic frame, it is determined that the center of the target calibration object is imaged at the center of the first image;

[0035] If it is determined that the point corresponding to the third center coordinates does not fall within the graphic frame, it is determined that the center of the target calibration object is not imaged at the center of the first image.

[0036] In a possible example, the first sub-marker and the second sub-marker are circles, the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is equal to a preset distance, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically or horizontally.

[0037] Second aspect, an embodiment of the present application provides a camera calibration device, the device includes an acquisition unit, a judgment unit, and a determination unit; wherein,

[0038] The acquisition unit is configured to acquire a first image of a target calibration object captured by a target camera, the target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature;

[0039] The judgment unit is configured to judge whether the center of the target calibration object is imaged at the center of the first image;

[0040] The judgment unit is configured to, when it is judged that the center of the target calibration object is imaged at the center of the first image, determine a target position, and establish a world coordinate system with the target position as the origin of the coordinate system;

[0041] The determination unit is configured to determine a first coordinate of the target calibration object in the world coordinate system, and determine a second coordinate of the target camera in the world coordinate system;

[0042] The determination unit is configured to determine a first calibration parameter of the target camera according to the first coordinate and the second coordinate;

[0043] The determination unit is configured to determine a second calibration parameter of the target camera according to the first scale feature and the first direction feature.

[0044] A third aspect of the present application provides an electronic device, including: a processor and a memory; and one or more programs, the one or more programs are stored in the memory and are configured to be executed by the processor, and the programs include instructions for performing some or all of the steps described in the first aspect.

[0045] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program enables a computer to execute instructions for performing some or all of the steps described in the first aspect of the embodiments of the present application.

[0046] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application. This computer program product can be a software installation package.

[0047] It can be seen that in the embodiment of the present application, the first image of the target calibration object captured by the target camera can be obtained first. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature. Then, it is determined whether the target calibration object is imaged at the center of the first image. Next, when it is determined that the center of the target calibration object is imaged at the center of the first image, the target position is determined, and a world coordinate system is established with the target position as the coordinate system origin. Further, the first coordinate of the target calibration object in the world coordinate system is determined, and the second coordinate of the target camera in the world coordinate system is determined. Furthermore, according to the first coordinate and the second coordinate, the first calibration parameter of the target camera is determined. Finally, according to the first scale feature and the first direction feature, the second calibration parameter of the target camera is determined. By placing the target calibration object at the center of the field of view of the target camera, setting the principal point coordinate as the image center, and not considering the distortion of this point, the first calibration parameter of the target camera is determined according to the first coordinate and the second coordinate, and the second calibration parameter of the target camera is determined according to the first scale feature and the first direction feature of the target calibration object, which is beneficial to improving the efficiency of camera calibration. Description of the Drawings

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 It is a schematic diagram of the architecture of a camera calibration system provided by an embodiment of the present application;

[0050] Figure 2 It is a schematic flowchart of a camera calibration method provided by an embodiment of the present application;

[0051] Figure 3 It is a schematic diagram of a target calibration object provided by an embodiment of the present application;

[0052] Figure 4 It is a schematic diagram of another target calibration object provided by an embodiment of the present application;

[0053] Figure 5 It is a schematic diagram of yet another target calibration object provided by an embodiment of the present application;

[0054] Figure 6 It is a schematic diagram of still another target calibration object provided by an embodiment of the present application;

[0055] Figure 7A schematic diagram of the positional relationship among a target camera, a world coordinate system, and a target calibration object provided by an embodiment of the present application;

[0056] Figure 8 A schematic diagram of a target calibration object imaged in a first image provided by an embodiment of the present application;

[0057] Figure 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application;

[0058] Figure 10 A block diagram of the functional units of a camera calibration device provided by an embodiment of the present application. Detailed implementation manners

[0059] To enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0060] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0061] Referring to "embodiment" in this article means that a specific feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0062] The "and / or" in the embodiments of the present application describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone; A and B exist simultaneously; B exists alone. Among them, A and B may be singular or plural.

[0063] In the embodiments of the present application, the symbol " / " may indicate that the associated objects before and after are in an "or" relationship. Additionally, the symbol " / " may also represent a division sign, that is, performing a division operation. For example, A / B may represent A divided by B.

[0064] The "at least one (item)" or its similar expressions in the embodiments of the present application refer to any combination of these items, including any combination of a single item or multiple items, meaning one or more, and multiple means two or more. For example, at least one (item) of a, b, or c may represent the following seven cases: a, b, c, a and b, a and c, b and c, a, b, and c. Each of a, b, and c may be an element or a set containing one or more elements.

[0065] The "equal to" in the embodiments of the present application can be used in conjunction with "greater than", applicable to the technical solutions adopted when it is greater than, and can also be used in conjunction with "less than", applicable to the technical solutions adopted when it is less than. When "equal to" is used in conjunction with "greater than", it is not used in conjunction with "less than"; when "equal to" is used in conjunction with "less than", it is not used in conjunction with "greater than".

[0066] To better understand the solutions of the embodiments of the present application, the electronic devices, related concepts, and background that the embodiments of the present application may involve will be introduced below.

[0067] The electronic device according to the embodiment of the present application is a device with wireless communication functions, which can be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal device, in-vehicle terminal device, industrial control terminal device, UE unit, UE station, mobile station, remote station, remote terminal device, mobile device, UE terminal device, wireless communication device, UE agent or UE device, etc. The terminal device can be fixed or mobile. It should be noted that the terminal device can support at least one wireless communication technology, such as LTE, new radio (NR), wideband code division multiple access (WCDMA), etc. For example, the terminal device can be a mobile phone, tablet (pad), desktop computer, laptop computer, all-in-one computer, in-vehicle terminal, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, cellular phone, cordless phone, session initiation protocol (SIP) phone, wireless local loop (WLL) station, personal digital assistant (PDA), handheld device with wireless communication functions, electronic device or other processing devices connected to a wireless modem, wearable device, terminal device in a future mobile communication network or terminal device in a future evolved public land mobile network (PLMN), etc. The electronic device can be a processing device in a camera calibration system.

[0068] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the architecture of a camera calibration system provided by the embodiment of the present application. As Figure 1As shown in the figure, the camera calibration system 1 includes a processing device 10, a target camera 20, and a target calibration object 30. The processing device 10 is connected to the target camera 20.

[0069] Among them, the target camera 20 is used to capture an image of the target calibration object and transmit the captured image to the processing device 10.

[0070] Among them, the processing device 10 can be a server, a processor, and is not limited herein.

[0071] Among them, the target calibration object 30 may formally include but is not limited to scene natural features, light-emitting light source markers, reflective markers, flat plates with regular patterns, etc. The scene natural features can be lane lines, railway tracks, etc. The target calibration object 30 includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature.

[0072] Among them, the camera calibration system 1 may include a memory. The memory is connected to the processing device 10, and the memory is used to store the first calibration parameter and the second calibration parameter determined by the processing device 10.

[0073] In a possible example, the processing device 10 may first obtain a first image of the target calibration object 30 captured by the target camera 20. The target calibration object 30 includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature. Then, the processing device 10 determines whether the target calibration object 30 is imaged at the center of the first image. Then, when the processing device 10 determines that the center of the target calibration object 30 is imaged at the center of the first image, it determines the target position and establishes a world coordinate system with the target position as the coordinate system origin. Further, the processing device 10 determines the first coordinate of the target calibration object 30 in the world coordinate system and determines the second coordinate of the target camera 20 in the world coordinate system. Further still, the processing device 10 determines the first calibration parameter of the target camera 20 according to the first coordinate and the second coordinate. Finally, the processing device 10 determines the second calibration parameter of the target camera 20 according to the first scale feature and the first direction feature. By placing the target calibration object 30 at the center of the field of view of the target camera 20, setting the principal point coordinates as the image center, and not considering the distortion of this point, determining the first calibration parameter of the target camera 20 according to the first coordinate and the second coordinate, and determining the second calibration parameter of the target camera 20 according to the first scale feature and the first direction feature of the target calibration object 30 is beneficial to improving the efficiency of camera calibration.

[0074] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a camera calibration method provided by an embodiment of the present application. The method includes:

[0075] Step S201: Obtain a first image of a target calibration object captured by a target camera. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature.

[0076] Among them, the target calibration object can be manually placed at the center of the field of view of the target camera. If the target calibration object is actually at the center of the field of view of the target camera, then the imaging point of the center of the target calibration object should be located at the center of the captured first image.

[0077] Among them, the scale feature includes but is not limited to the distance between points, the distance between a point and a line, the distance between lines, the scale of a line, the size of a shape, the distance between the centroids of shapes, etc., which are not limited here. Among them, points include but are not limited to corner points, centroids, mass centers, centers, etc., lines include but are not limited to straight lines, curves, dotted lines, etc., and shapes include but are not limited to circles, ellipses, polygons, irregular shapes, etc. Exemplarily, the first sub-marker and the second sub-marker are circles, and the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is equal to a preset distance, and the preset distance can be set manually or defaulted by the system, which is not limited here.

[0078] Among them, the direction feature includes but is not limited to the horizontal direction, the vertical direction, or other directions with a determined angle. For example: the first direction feature is that the first sub-marker and the second sub-marker are arranged in the vertical direction or in the horizontal direction.

[0079] Among them, when the first sub-marker and the second sub-marker are circles, the diameter of the first sub-marker is equal to a first preset threshold, and the diameter of the second sub-marker is equal to a second preset threshold.

[0080] Among them, the first preset value and the second preset value can be set manually or defaulted by the system, which is not limited here.

[0081] Among them, the first preset threshold and the second preset threshold are equal or not equal.

[0082] Among them, the first sub-marker and the second sub-marker may not have an overlapping area, or the first sub-marker and the second sub-marker may have an overlapping area, which is not limited here.

[0083] Please refer to Figure 3 , Figure 3 which is a schematic diagram of a target calibration object provided by an embodiment of the present application. As Figure 3As shown, the target calibration object includes a first sub-marker and a second sub-marker. The first sub-marker is a circle, and the second sub-marker is also a circle. There is no overlapping area between the first sub-marker and the second sub-marker. The diameter of the first sub-marker is D1, and the diameter of the second sub-marker is D2. The first sub-marker and the second sub-marker are arranged vertically, and the distance between the centers of the first sub-marker and the second sub-marker is a preset distance l. At this time, the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is the preset distance l, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically.

[0084] Please refer to Figure 4 , Figure 4 which is a schematic diagram of another target calibration object provided by an embodiment of the present application. As Figure 4 shown, the target calibration object includes a first sub-marker and a second sub-marker. The first sub-marker is a circle, and the second sub-marker is also a circle. There is no overlapping area between the first sub-marker and the second sub-marker. The diameter of the first sub-marker is D1, and the diameter of the second sub-marker is D2. The first sub-marker and the second sub-marker are arranged horizontally, and the distance between the centers of the first sub-marker and the second sub-marker is a preset distance l. At this time, the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is the preset distance l, and the first direction feature is that the first sub-marker and the second sub-marker are arranged horizontally.

[0085] Please refer to Figure 5 , Figure 5 which is a schematic diagram of yet another target calibration object provided by an embodiment of the present application. As Figure 5 shown, the target calibration object includes a first sub-marker and a second sub-marker. The first sub-marker is a rectangle, and the second sub-marker is also a rectangle. There is no overlapping area between the first sub-marker and the second sub-marker. The length of the first sub-marker is M1 and the width is N1, and the length of the second sub-marker is M2 and the width is N2. The first sub-marker and the second sub-marker are arranged vertically, and the distance between the centers of the first sub-marker and the second sub-marker is a preset distance l. At this time, the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is the preset distance l, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically.

[0086] Please refer to Figure 6 , Figure 6 which is a schematic diagram of still another target calibration object provided by an embodiment of the present application. As Figure 6As shown, the target calibration object includes a first sub-marker and a second sub-marker. The first sub-marker is a circle, and the second sub-marker is also a circle. There is an overlapping area between the first sub-marker and the second sub-marker. The diameter of the first sub-marker is D3, and the diameter of the second sub-marker is D4. The first sub-marker and the second sub-marker are arranged vertically. The distance between the centers of the first sub-marker and the second sub-marker is a preset distance l. At this time, the first scale feature is that the distance between the centers of the first sub-marker and the second sub-marker is the preset distance l, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically.

[0087] Step S202, determine whether the center of the target calibration object is imaged at the center of the first image.

[0088] Among them, considering that the prerequisite for determining the subsequent calibration parameters is that the principal point coordinates are located at the image center of the target camera and the distortion of this point is not considered, thus the features of the calibration object in the camera image can be recognized in real time by running the pre-designed image processing software, and it is determined whether the imaging point of the center of the calibration object is at the image center.

[0089] Step S203, when it is determined that the center of the target calibration object is imaged at the center of the first image, determine the target position, and establish a world coordinate system with the target position as the origin of the coordinate system.

[0090] Among them, the target calibration object is in the plane where the X-axis and Z-axis of the world coordinate system are located.

[0091] Step S204, determine the first coordinate of the target calibration object in the world coordinate system, and determine the second coordinate of the target camera in the world coordinate system.

[0092] Step S205, determine the first calibration parameter of the target camera according to the first coordinate and the second coordinate.

[0093] Among them, the first calibration parameter includes the pitch angle and yaw angle of the target camera, and the first calibration parameter is calculated by using the triangular geometric relationship formed by the target calibration object in the field of view of the target camera.

[0094] Step S206, determine the second calibration parameter of the target camera according to the first scale feature and the first direction feature.

[0095] Among them, the second calibration parameter includes the equivalent focal length and roll angle of the target camera.

[0096] It can be seen that in the embodiment of the present application, the first image of the target calibration object captured by the target camera can be obtained first. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature. Then, it is judged whether the target calibration object is imaged at the center of the first image. Next, when it is judged that the center of the target calibration object is imaged at the center of the first image, the target position is determined, and a world coordinate system is established with the target position as the origin of the coordinate system. Further, the first coordinate of the target calibration object in the world coordinate system is determined, and the second coordinate of the target camera in the world coordinate system is determined. Still further, according to the first coordinate and the second coordinate, the first calibration parameter of the target camera is determined. Finally, according to the first scale feature and the first direction feature, the second calibration parameter of the target camera is determined. By placing the target calibration object at the center of the field of view of the target camera, setting the principal point coordinate as the center of the image, and not considering the distortion of this point, the first calibration parameter of the target camera is determined according to the first coordinate and the second coordinate, and the second calibration parameter of the target camera is determined according to the first scale feature and the first direction feature of the target calibration object, which is beneficial to improving the efficiency of camera calibration.

[0097] In a possible example, in terms of determining the target position, the above method may include the following steps: determining a first distance in the vertical direction between the target calibration object and the target camera; determining a first position of the target camera; and determining the target position according to the first position and the first distance.

[0098] Wherein, the origin of the coordinate system of the world coordinate system can be set directly below the target camera, and the distance between the origin of the coordinate system and the target camera is equal to the first distance, and a world coordinate system is established such that the target calibration object is in the plane formed by the X-axis and the Z-axis of the world coordinate system, that is, the XOZ plane.

[0099] Wherein, directly below the first position, that is, in the vertical direction, and at a position spaced by the first distance is the target position.

[0100] Exemplarily, please refer to Figure 7 , Figure 7 which is a schematic diagram of the positional relationship among a target camera, a world coordinate system, and a target calibration object provided by an embodiment of the present application. As Figure 7 shown, the first distance between the target camera and the target calibration object in the vertical direction is d y , the origin O of the coordinate system of the world coordinate system is directly below the target camera, and the distance between the origin O of the coordinate system and the target camera is equal to the first distance d y , and the target calibration object is in the XOZ plane of the world coordinate system.

[0101] It can be seen that in this example, by placing the target calibration object at the center of the field of view of the target camera, establishing the world coordinate system directly below the target camera, and ensuring that the target calibration object lies in the XOZ plane of the world coordinate system, it is convenient to calculate the first calibration parameter based on the triangular geometric relationship formed by the target calibration object in the field of view of the target camera, which helps improve the efficiency of camera parameter calibration.

[0102] In a possible example, in terms of determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate, the above method may include the following steps: determining, according to the first coordinate, the second distance in the X-axis direction and the third distance in the Z-axis direction from the target calibration object to the origin of the coordinate system of the world coordinate system; determining, according to the second coordinate, the first distance from the target camera to the origin of the coordinate system of the world coordinate system; determining the pitch angle of the target camera according to the first distance and the third distance; and determining the yaw angle of the target camera according to the second distance and the third distance.

[0103] Among them, the yaw angle represents the angle by which the target camera rotates around its vertical axis, and the pitch angle represents the angle by which the target camera rotates around its transverse axis.

[0104] Among them, the second distance is the distance from the target calibration object to the X-axis of the world coordinate system, the third distance is the distance from the target calibration object to the Z-axis of the world coordinate system, and the first distance is the distance from the target camera to the origin of the coordinate system of the world coordinate system.

[0105] Among them, the formula for the pitch angle of the target camera to be calibrated is as follows:

[0106] α = atan(d y / d z ),

[0107] Among them, α represents the pitch angle of the target camera, d y represents the distance from the target camera to the origin of the coordinate system of the world coordinate system, that is, the first distance, and d z represents the distance from the target calibration object to the Z-axis of the world coordinate system, that is, the third distance.

[0108] Among them, the formula for the yaw angle of the target camera to be calibrated is as follows:

[0109] β = atan(d x / d z ),

[0110] Among them, β represents the yaw angle of the target camera, and d x represents the distance from the target calibration object to the X-axis of the world coordinate system, that is, the second distance.

[0111] Please refer to Figure 7, Figure 7 A target camera, a target calibration object, and a world coordinate system are shown, and the distance between the target camera and the world coordinate system is d. y The distance between the target calibration object and the X-axis of the world coordinate system is d. x The distance between the target calibration object and the Z-axis of the world coordinate system is d. z The pitch angle is α, and the yaw angle is β.

[0112] It can be seen that in this example, the first calibration parameter is calculated through the triangular geometric relationship formed by the target calibration object in the field of view of the target camera, which is beneficial to improving the efficiency of camera parameter calibration.

[0113] In a possible example, the determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature includes: determining the second scale feature and the second direction feature between the first sub-marker and the second sub-marker in the first image; determining the equivalent focal length of the target camera according to the first scale feature and the second scale feature; and determining the roll angle of the target camera according to the first direction feature and the second direction feature.

[0114] Wherein, the second scale feature is the scale feature between the first sub-marker and the second sub-marker in the first image, and the first scale feature and the second scale feature are of the same scale feature type. For example, when both the first sub-marker and the second sub-marker are circles, and the first scale feature is the feature describing the distance between the centers of the first sub-marker and the second sub-marker, then the second scale feature should also be the feature describing the distance between the centers of the first sub-marker and the second sub-marker imaged in the first image.

[0115] Wherein, the second direction feature is the direction feature between the first sub-marker and the second sub-marker imaged in the first image, the first direction feature is the feature describing the arrangement direction of the first sub-marker and the second sub-marker, and the second direction feature is also the feature describing the arrangement direction of the first sub-marker and the second sub-marker imaged in the first image.

[0116] Wherein, the second calibration parameter includes the equivalent focal length and the roll angle of the target camera. The equivalent focal length of the target camera includes the equivalent focal length in the X-axis direction of the image plane and the equivalent focal length in the Y-axis direction of the image plane. The roll angle is used to describe the attitude of the target camera relative to the world coordinate system.

[0117] Exemplarily, if there is a feature in the vertical direction between the first sub-marker and the second sub-marker, and the included angle between the directional feature between the first sub-marker and the second sub-marker imaged in the first image and the vertical direction is γ, then the roll angle of the target camera is γ. If there is a feature in the horizontal direction between the first sub-marker and the second sub-marker, and the included angle between the directional feature between the first sub-marker and the second sub-marker imaged in the first image and the horizontal direction is δ, then the roll angle of the target camera is δ.

[0118] Please refer to Figure 8 , Figure 8 which is a schematic diagram of a target calibration object imaged in a first image provided by an embodiment of the present application. The first sub-marker and the second sub-marker are circles. The second scale feature is the distance l' between the centers of the first sub-marker and the second sub-marker imaged in the first image. The first scale feature is the distance l between the centers of the first sub-marker and the second sub-marker. The first directional feature is that the first sub-marker and the second sub-marker are arranged in the vertical direction. If the center coordinates of the first sub-marker are C1(x1, y1) and the center coordinates of the second sub-marker are C2(x2, y2), then Substitute l' and l into the equivalent focal length formula to calculate the equivalent focal length; if the included angle between the second directional feature and the vertical direction is γ, γ = atan((x1 - x2) / (y1 - y2)), then the roll angle of the target camera is γ = atan((x1 - x2) / (y1 - y2)).

[0119] It can be seen that in this example, the equivalent focal length and roll angle of the target camera can be calculated based on the scale feature and directional feature between the first sub-marker and the second sub-marker, which is beneficial to improving the efficiency of camera parameter calibration.

[0120] In a possible example, in the aspect of determining the equivalent focal length of the camera according to the first scale feature and the second scale feature, the above method may include the following steps: determining a fourth distance according to the first scale feature; determining a fifth distance according to the second scale feature; substituting the first distance, the second distance, the third distance, the fourth distance, and the fifth distance into the equivalent focal length formula to calculate the equivalent focal length of the camera.

[0121] Among them, the fourth distance represents the feature of the physical scale between the first sub-marker and the second sub-marker, and the fifth distance represents the feature of the physical scale between the first sub-marker and the second sub-marker imaged in the first image; for example: the fourth distance is the distance between the centers of the first sub-marker and the second sub-marker, and the fifth distance is the distance between the centers of the first sub-marker and the second sub-marker imaged in the first image.

[0122] For example, if there is a feature with a physical scale of l' between the first sub-marker and the second sub-marker, and there is a feature with a physical scale of [original scale value] between the first sub-marker and the second sub-marker imaged in the first image, then the formula for the equivalent focal length of the target camera is as follows:

[0123]

[0124] where F x represents the equivalent focal length in the X-axis direction of the image plane, and F y is the equivalent focal length in the Y-axis direction of the image plane.

[0125] It can be seen that in this example, the equivalent focal length of the target camera can be calculated based on the scale feature and direction feature between the first sub-marker and the second sub-marker, which is beneficial to improving the efficiency of camera parameter calibration.

[0126] In a possible example, in terms of determining whether the center of the target calibration object is imaged at the center of the first image, the above method may include the following steps: draw a graphic frame at the center of the first image; determine the first center coordinate of the center of the first sub-marker; determine the second center coordinate of the center of the second sub-marker; determine the third center coordinate of the center of the target calibration object according to the first center coordinate and the second center coordinate; if it is determined that the point corresponding to the third center coordinate falls within the graphic frame, it is determined that the center of the target calibration object is imaged at the center of the first image; if it is determined that the point corresponding to the third center coordinate does not fall within the graphic frame, it is determined that the center of the target calibration object is not imaged at the center of the first image.

[0127] Among them, the shape of the graphic frame is not limited. For example, the graphic frame can be a rectangular frame or a circular frame. The area of the graphic frame is sufficient to accommodate a single pixel point, that is, it can accommodate the imaging point of the center of the target calibration object.

[0128] Among them, when both the first sub-marker and the second sub-marker are regular shapes, the coordinates of the center of the first sub-marker and the coordinates of the center of the second sub-marker can be determined first to obtain the first center coordinate and the second center coordinate, and further calculate the coordinates of the center of the target calibration object based on the first center coordinate and the second center coordinate to obtain the third center coordinate; for example, if the first center coordinate of the first sub-marker imaged in the first image is determined to be C1(x1, y1), and the second center coordinate of the second sub-marker is C2(x2, y2), then the third center coordinate of the center of the target calibration object is calculated as

[0129] Please refer to Figure 8 , Figure 8The first sub-marker, the second sub-marker and the graphic frame in the first image are shown. The graphic frame is a rectangular frame, and the center of the target calibration object in the first image falls into the rectangular frame, indicating that the target calibration object is at the center of the field of view of the target camera at this time.

[0130] Optionally, when both the first sub-marker and the second sub-marker are irregularly shaped, the first image can be converted into a grayscale image, the grayscale image can be binarized to obtain a binary image, each non-zero pixel of the first sub-marker in the binary image is traversed, the sum of the products of its coordinates and the grayscale value of the pixel is calculated, the sum of the grayscale values of all non-zero pixels is calculated, and the first centroid coordinates of the centroid of the first sub-marker are obtained. Similarly, the second centroid coordinates of the centroid of the second sub-marker are obtained, and the third center coordinates of the center of the target calibration object are calculated based on the first centroid coordinates and the second centroid coordinates. Specifically, the first weight of the first centroid coordinates and the second weight of the second centroid coordinates can be determined, and the third center coordinates are calculated based on the first weight, the second weight, the first centroid coordinates, and the second centroid coordinates; for example, when the first weight and the second weight are both 0.5, the first centroid coordinates are (x3, y3), and the second centroid coordinates are (x4, y4), then the calculated third center coordinates are

[0131] Optionally, the edge detection algorithm can be used to extract the edge information in the first image to generate an edge image, the edge image is binarized to obtain a binary image, the contour extraction algorithm is used to extract the contours of the binary image, the first contour of the first sub-marker and the second contour of the second sub-marker are obtained, the minimum circumscribed rectangle or ellipse fitting is calculated for the extracted first contour and the second contour respectively, the center points of the first contour and the second contour are calculated respectively based on the results of the minimum circumscribed rectangle or ellipse fitting, and finally the coordinates of the center point of the target calibration object are calculated based on the center points of the first contour and the second contour through averaging, weighting or geometric relationships.

[0132] It can be seen that in this example, it can be judged whether the center of the target calibration object is imaged at the center of the first image, which is beneficial to improving the accuracy of camera parameter calibration.

[0133] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 9 shown, the electronic device includes a processor, a memory, a communication interface, and one or more programs. Among them, the above one or more programs are stored in the above memory, and the above one or more programs are configured with instructions for the above processor to execute the following steps:

[0134] Obtain a first image of a target calibration object captured by a target camera, where the target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature;

[0135] Determine whether the center of the target calibration object is imaged at the center of the first image;

[0136] When it is determined that the center of the target calibration object is imaged at the center of the first image, determine a target position and establish a world coordinate system with the target position as the origin of the coordinate system;

[0137] Determine a first coordinate of the target calibration object in the world coordinate system and determine a second coordinate of the target camera in the world coordinate system;

[0138] Determine a first calibration parameter of the target camera according to the first coordinate and the second coordinate;

[0139] Determine a second calibration parameter of the target camera according to the first scale feature and the first direction feature.

[0140] It can be seen that in the embodiments of the present application, the electronic device can first obtain a first image of a target calibration object captured by a target camera. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature. Then, it is determined whether the target calibration object is imaged at the center of the first image. Next, when it is determined that the center of the target calibration object is imaged at the center of the first image, a target position is determined and a world coordinate system is established with the target position as the origin of the coordinate system. Further, a first coordinate of the target calibration object in the world coordinate system is determined, and a second coordinate of the target camera in the world coordinate system is determined. Still further, a first calibration parameter of the target camera is determined according to the first coordinate and the second coordinate. Finally, a second calibration parameter of the target camera is determined according to the first scale feature and the first direction feature. By placing the target calibration object at the center of the field of view of the target camera, setting the principal point coordinate as the image center, determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate, and determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature of the target calibration object, it is beneficial to improve the efficiency of camera calibration.

[0141] In a possible example, in terms of determining the target position, the above program includes instructions for performing the following steps:

[0142] Determine a first distance in the vertical direction between the target calibration object and the target camera;

[0143] Determine a first position of the target camera;

[0144] Determine the target position according to the first position and the first distance.

[0145] In a possible example, in terms of determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate, the above program includes instructions for performing the following steps:

[0146] According to the first coordinate, determine the second distance of the target calibration object from the origin of the coordinate system of the world coordinate system in the X-axis direction and the third distance in the Z-axis direction;

[0147] According to the second coordinate, determine the first distance of the target camera from the origin of the coordinate system of the world coordinate system;

[0148] According to the first distance and the third distance, determine the pitch angle of the target camera;

[0149] According to the second distance and the third distance, determine the yaw angle of the target camera.

[0150] In a possible example, in terms of determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature, the above program includes instructions for performing the following steps:

[0151] Determine the second scale feature and the second direction feature between the first sub-marker and the second sub-marker in the first image;

[0152] According to the first scale feature and the second scale feature, determine the equivalent focal length of the target camera;

[0153] According to the first direction feature and the second direction feature, determine the roll angle of the target camera.

[0154] In a possible example, in terms of determining the equivalent focal length of the camera according to the first scale feature and the second scale feature, the above program further includes instructions for performing the following steps:

[0155] According to the first scale feature, determine the fourth distance;

[0156] According to the second scale feature, determine the fifth distance;

[0157] Substitute the first distance, the second distance, the third distance, the fourth distance, and the fifth distance into the equivalent focal length formula to calculate the equivalent focal length of the camera.

[0158] In a possible example, in terms of determining whether the center of the target calibration object is imaged at the center of the first image, the above program further includes instructions for performing the following steps:

[0159] Draw a graphic frame at the center of the first image;

[0160] Determine the first center coordinates of the center of the first sub-marker;

[0161] Determine the second center coordinates of the center of the second sub-marker;

[0162] According to the first center coordinates and the second center coordinates, determine the third center coordinates of the center of the target calibration object;

[0163] If it is determined that the point corresponding to the third center coordinates falls within the graphic frame, it is determined that the center of the target calibration object is imaged at the center of the first image;

[0164] If it is determined that the point corresponding to the third center coordinates does not fall within the graphic frame, it is determined that the center of the target calibration object is not imaged at the center of the first image.

[0165] In a possible example, the first sub-marker and the second sub-marker are circles, the first scale feature is that the distance between the center of the first sub-marker and the center of the second sub-marker is equal to a preset distance, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically or horizontally.

[0166] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments provided in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0167] Embodiments of the present application can divide functional units of an electronic device according to the above method examples. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.

[0168] In the case of dividing each functional module corresponding to each function, Figure 10 a block diagram of the composition of functional units of a camera calibration device is given, as Figure 10 shown. The device includes an acquisition unit 1001, a judgment unit 1002, and a determination unit 1003; wherein,

[0169] The acquisition unit 1001 is configured to acquire a first image of a target calibration object captured by a target camera. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature;

[0170] The judgment unit 1002 is configured to judge whether the center of the target calibration object is imaged at the center of the first image;

[0171] The judgment unit 1002 is configured to, when it is judged that the center of the target calibration object is imaged at the center of the first image, determine a target position, and establish a world coordinate system with the target position as the origin of the coordinate system;

[0172] The determination unit 1003 is configured to determine a first coordinate of the target calibration object in the world coordinate system, and determine a second coordinate of the target camera in the world coordinate system;

[0173] The determination unit 1003 is configured to determine a first calibration parameter of the target camera according to the first coordinate and the second coordinate;

[0174] The determination unit 1003 is configured to determine a second calibration parameter of the target camera according to the first scale feature and the first direction feature.

[0175] It can be seen that in the embodiment of the present application, the camera calibration device can first obtain a first image of a target calibration object captured by a target camera. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature. Then, it is determined whether the target calibration object is imaged at the center of the first image. Next, when it is determined that the center of the target calibration object is imaged at the center of the first image, the target position is determined, and a world coordinate system is established with the target position as the origin of the coordinate system. Further, the first coordinate of the target calibration object in the world coordinate system is determined, and the second coordinate of the target camera in the world coordinate system is determined. Still further, according to the first coordinate and the second coordinate, the first calibration parameter of the target camera is determined. Finally, according to the first scale feature and the first direction feature, the second calibration parameter of the target camera is determined. By placing the target calibration object at the center of the field of view of the target camera, setting the principal point coordinate as the center of the image, determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate, and determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature of the target calibration object, it is beneficial to improve the efficiency of camera calibration.

[0176] In a possible example, in terms of determining the target position, the determining unit 1003 is specifically configured to:

[0177] Determine a first distance in the vertical direction between the target calibration object and the target camera;

[0178] Determine a first position of the target camera;

[0179] According to the first position and the first distance, determine the target position.

[0180] In a possible example, in terms of determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate, the determining unit 1003 is specifically configured to:

[0181] According to the first coordinate, determine a second distance in the X-axis direction and a third distance in the Z-axis direction from the target calibration object to the origin of the coordinate system of the world coordinate system;

[0182] According to the second coordinate, determine the first distance from the target camera to the origin of the coordinate system of the world coordinate system;

[0183] According to the first distance and the third distance, determine the pitch angle of the target camera;

[0184] According to the second distance and the third distance, determine the yaw angle of the target camera.

[0185] In a possible example, in terms of determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature, the determining unit 1003 is specifically configured to:

[0186] Determine the second scale feature and the second direction feature between the first sub-marker and the second sub-marker in the first image;

[0187] Determine the equivalent focal length of the target camera according to the first scale feature and the second scale feature;

[0188] Determine the roll angle of the target camera according to the first direction feature and the second direction feature.

[0189] In a possible example, in terms of determining the equivalent focal length of the camera according to the first scale feature and the second scale feature, the determining unit 1003 is further specifically configured to:

[0190] Determine a fourth distance according to the first scale feature;

[0191] Determine a fifth distance according to the second scale feature;

[0192] Substitute the first distance, the second distance, the third distance, the fourth distance, and the fifth distance into the equivalent focal length formula to calculate the equivalent focal length of the camera.

[0193] In a possible example, in terms of determining whether the center of the target calibration object is imaged at the center of the first image, the determining unit 1003 is further specifically configured to:

[0194] Draw a graphic frame at the center of the first image;

[0195] Determine the first center coordinates of the center of the first sub-marker;

[0196] Determine the second center coordinates of the center of the second sub-marker;

[0197] Determine the third center coordinates of the center of the target calibration object according to the first center coordinates and the second center coordinates;

[0198] If it is determined that the point corresponding to the third center coordinates falls within the graphic frame, it is determined that the center of the target calibration object is imaged at the center of the first image;

[0199] If it is determined that the point corresponding to the third center coordinates does not fall within the graphic frame, it is determined that the center of the target calibration object is not imaged at the center of the first image.

[0200] In a possible example, the first sub-marker and the second sub-marker are circles, the first scale feature is that the distance between the center of the first sub-marker and the center of the second sub-marker is equal to a preset distance, and the first direction feature is that the first sub-marker and the second sub-marker are arranged vertically or horizontally.

[0201] It should be noted that all relevant contents of each step involved in the above method embodiments can be cited in the function descriptions of the corresponding functional modules, and will not be elaborated here.

[0202] The electronic device provided in this embodiment is used to execute the above camera calibration method, so the same effects as the above implementation method can be achieved.

[0203] In the case of adopting an integrated unit, the electronic device may include a processing module, a storage module, and a communication module. Among them, the processing module can be used to control and manage the operations of the electronic device. For example, it can be used to support the electronic device to execute the steps performed by the above functional units. The storage module can be used to support the electronic device to execute storing program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.

[0204] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in combination with the disclosure of the present application. The processor can also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of a digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0205] The embodiment of the present application further provides a computer storage medium. The computer storage medium stores a computer program for electronic data exchange, and the computer program enables the computer to execute some or all of the steps of any method recorded in the above method embodiments. The above computer includes an electronic device.

[0206] The embodiment of the present application further provides a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable the computer to execute some or all of the steps of any method recorded in the above method embodiments. The computer program product can be a software installation package, and the above computer includes a control platform.

[0207] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0208] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0209] In several embodiments provided by this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.

[0210] The units described as separate components above may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0211] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0212] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of this application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0213] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories, random access memories, magnetic disks, or optical discs, etc.

[0214] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A camera calibration method, characterized in that, Including: Obtain a first image of a target calibration object captured by a target camera, where the target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature; Judge whether the center of the target calibration object is imaged at the center of the first image; When it is determined that the center of the target calibration object is imaged at the center of the first image, determine the target position, and establish a world coordinate system with the target position as the origin of the coordinate system; Determine the first coordinate of the target calibration object in the world coordinate system, and determine the second coordinate of the target camera in the world coordinate system; Determine the first calibration parameter of the target camera according to the first coordinate and the second coordinate; Determine the second calibration parameter of the target camera according to the first scale feature and the first direction feature.

2. The method according to claim 1, characterized in that The determining the target position includes: Determine a first distance in the vertical direction between the target calibration object and the target camera; Determine the first position of the target camera; Determine the target position according to the first position and the first distance.

3. The method according to claim 2, wherein The determining the first calibration parameter of the target camera according to the first coordinate and the second coordinate includes: According to the first coordinate, determine a second distance in the X-axis direction and a third distance in the Z-axis direction from the target calibration object to the origin of the coordinate system of the world coordinate system; According to the second coordinate, determine the first distance from the target camera to the origin of the coordinate system of the world coordinate system; Determine the pitch angle of the target camera according to the first distance and the third distance; Determine the yaw angle of the target camera according to the second distance and the third distance.

4. The method according to claim 3, wherein The determining the second calibration parameter of the target camera according to the first scale feature and the first direction feature includes: Determine a second scale feature and a second direction feature between the first sub-marker and the second sub-marker in the first image; Determine the equivalent focal length of the target camera according to the first scale feature and the second scale feature; Determine the roll angle of the target camera according to the first direction feature and the second direction feature.

5. The method according to claim 4, wherein The determining the equivalent focal length of the camera according to the first scale feature and the second scale feature includes: Determine a fourth distance according to the first scale feature; Determine a fifth distance according to the second scale feature; Substitute the first distance, the second distance, the third distance, the fourth distance and the fifth distance into the equivalent focal length formula to calculate the equivalent focal length of the camera.

6. The method according to claim 1, wherein The judging whether the center of the target calibration object is imaged at the center of the first image includes: Draw a graphic frame at the center of the first image; Determine the first center coordinate of the center of the first sub-marker; Determine the second center coordinate of the center of the second sub-marker; Determine the third center coordinate of the center of the target calibration object according to the first center coordinate and the second center coordinate; If it is determined that the point corresponding to the third center coordinate falls within the graphic frame, it is determined that the center of the target calibration object is imaged at the center of the first image; If it is determined that the point corresponding to the third center coordinate does not fall within the graphic frame, it is determined that the center of the target calibration object is not imaged at the center of the first image.

7. The method according to any one of claims 1-6, characterized in that, The first sub-marker and the second sub-marker are circles. The first scale feature is that the distance between the center of the first sub-marker and the center of the second sub-marker is equal to a preset distance. The first direction feature is that the first sub-marker and the second sub-marker are arranged vertically or horizontally.

8. A camera calibration device, characterized in that, The camera calibration device includes an acquisition unit, a judgment unit, and a determination unit; wherein, The acquisition unit is configured to acquire a first image of a target calibration object captured by a target camera. The target calibration object includes a first sub-marker and a second sub-marker, and the first sub-marker and the second sub-marker have a first scale feature and a first direction feature; The judgment unit is configured to judge whether the center of the target calibration object is imaged at the center of the first image; The judgment unit is configured to, when it is determined that the center of the target calibration object is imaged at the center of the first image, determine a target position and establish a world coordinate system with the target position as the origin of the coordinate system; The determination unit is configured to determine a first coordinate of the target calibration object in the world coordinate system and determine a second coordinate of the target camera in the world coordinate system; The determination unit is configured to determine a first calibration parameter of the target camera according to the first coordinate and the second coordinate; The determination unit is configured to determine a second calibration parameter of the target camera according to the first scale feature and the first direction feature.

9. An electronic device, characterized in that, Comprising a processor and a memory, the memory is configured to store one or more programs and is configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program for electronic data exchange is stored, wherein the computer program causes a computer to execute the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Camera calibrating device and method

    CN108022267A

  • Calibration method and calibration system for camera external parameters of vehicle-mounted camera system

    CN109859278A

  • Camera external parameter calibration method and device and electronic equipment

    CN110322513A

  • Three-dimensional space dimension measurement method based on fixed monocular camera

    CN112907647A

  • Camera calibration method and device

    CN115713564A