Calibration plate generation method, camera calibration method, device, equipment and calibration plate
By determining the calibration board area and cell size based on the camera's shooting range and focal length, and generating coded graphic records of physical coordinates, the problem of inaccurate marker point extraction in multi-camera calibration is solved, improving the accuracy of multi-camera calibration and the calibration effect of systems with large differences in imaging field of view.
Patent Information
- Application Number
- CN202310195535.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-02-22
AI Technical Summary
In multi-camera calibration, cameras with different shooting ranges cannot accurately extract the coordinates of the calibration board marker points, resulting in poor calibration accuracy or even making calibration impossible.
The size of the calibration board and the calibration board area corresponding to each camera are determined based on the shooting range of multiple cameras to be calibrated. The cell size is determined based on the focal length and the number of marker points. Encoded graphic records of physical coordinates are generated to generate a calibration board suitable for multiple cameras.
It improves the accuracy of multi-camera calibration, enables the calibration of multi-camera systems with large differences in imaging field of view, ensures that the number of marker points captured by each camera meets the calibration requirements, and accurately calculates the mapping relationship between the image coordinate system and the physical coordinate system.
Smart Images

Figure CN116188599B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of camera calibration, in particular to a calibration board generation method, a camera calibration method, a device, equipment and a calibration board. BACKGROUND
[0002] Camera calibration is a basic link of machine vision applications such as visual measurement and three-dimensional reconstruction, and the accuracy and precision of the calibration result directly determine whether the vision system can work normally. Camera calibration refers to the process of using a camera to shoot a calibration board image, using the three-dimensional physical coordinates of the known marker points in the calibration board and the corresponding image coordinates on the image to solve the mapping relationship between the three-dimensional physical coordinate system and the image coordinate system.
[0003] In some scenarios, a single camera cannot meet the shooting requirements, and multiple camera arrays need to be used for shooting. In this way, multiple camera calibration is needed. In the related art, a large-sized calibration board is usually used, and multiple cameras are arranged at different positions above the calibration board, and multiple camera calibration is completed by shooting different positions of the calibration board.
[0004] However, because the shooting ranges of the multiple cameras are different, the marker point coordinates of the calibration board cannot be accurately extracted by the camera with a large shooting range, and the camera with a small shooting range cannot obtain enough marker points, resulting in poor accuracy of multiple camera calibration, or even no calibration can be performed. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a calibration board generation method, a camera calibration method, a device, equipment and a calibration board to improve the accuracy of multiple camera calibration and realize the calibration of a multiple camera system with a large imaging field of view difference. The specific technical solutions are as follows:
[0006] In a first aspect, the embodiments of the present application provide a calibration board generation method, which comprises:
[0007] Based on the shooting ranges of multiple cameras to be calibrated, the size of the calibration board and the calibration board area corresponding to each camera to be calibrated are determined;
[0008] For each calibration board area, the size of the unit cell included in the calibration board area is determined according to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, wherein the marker point is the corner point of the unit cell;
[0009] Based on the physical coordinates of the marker points, the encoding pattern corresponding to the marker points is determined, wherein the encoding pattern is used to record the physical coordinates;
[0010] According to the size of the calibration board, the calibration board area, the cell size and the encoding pattern, a calibration board corresponding to the plurality of cameras to be calibrated is generated.
[0011] Optionally, the cell is a rectangle.
[0012] The step of determining the cell size included in the calibration board area according to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration comprises:
[0013] The length and width of the cell included in the calibration board area are determined according to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, so that the number of marker points photographed by the camera to be calibrated when photographing the calibration board area is not less than the number of marker points required for camera calibration, and the size of the encoding pattern placed in the cell satisfies the decoding condition.
[0014] Optionally, the step of determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point comprises:
[0015] The physical coordinates of the marker point in the calibration board are determined.
[0016] The encoding pattern is obtained by encoding according to the physical coordinates of the marker point in the calibration board.
[0017] Optionally, the step of determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point comprises:
[0018] The index coordinates of the marker point in the calibration board area to which it belongs are determined, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board area, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board area.
[0019] The encoding pattern is obtained by encoding according to the index coordinates and the physical distance between adjacent marker points included in the calibration board area.
[0020] Optionally, the step of generating the calibration board corresponding to the plurality of cameras to be calibrated according to the size of the calibration board, the calibration board area, the cell size and the encoding pattern comprises:
[0021] According to the size of the calibration board, the calibration board area and the cell size corresponding to each calibration board area, a calibration board including a plurality of cells is generated.
[0022] The encoding pattern is filled into the cell to which the corresponding marker point belongs.
[0023] In a second aspect, the embodiments of the present application provide a camera calibration method, which comprises:
[0024] acquiring a calibration board image captured by each camera to be calibrated for a calibration board region corresponding to the camera to be calibrated in the calibration board, wherein the calibration board comprises a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each camera to be calibrated are determined based on the shooting range of the camera to be calibrated, and the size of a unit cell included in each calibration board region is determined according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration, the marker point being a corner point of the unit cell;
[0025] extracting the image coordinates of each marker point in each calibration board image;
[0026] decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image;
[0027] for each camera to be calibrated, calculating the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the camera to be calibrated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the camera to be calibrated.
[0028] Optionally, the coded pattern is obtained by encoding according to the physical coordinates of the marker point in the calibration board;
[0029] The step of decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises:
[0030] decoding each coded pattern in the calibration board image to obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board.
[0031] Optionally, the coded pattern is obtained by encoding according to the index coordinates of the marker point in the calibration board region to which the marker point belongs and the physical distance between adjacent marker points included in the calibration board region, the first coordinate component of the index coordinates being used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates being used to identify the column number of the marker point in the plurality of marker points included in the calibration board region;
[0032] The step of decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises:
[0033] decoding each coded pattern in the calibration board image to obtain index coordinates of a marked point corresponding to the coded pattern in a calibration board region to which the coded pattern belongs and a physical distance between adjacent marked points included in the calibration board region;
[0034] calculating a horizontal coordinate difference value and a vertical coordinate difference value between a coordinate origin of a region coordinate system of the calibration board region corresponding to the calibration board image and a coordinate origin of a calibration board coordinate system;
[0035] taking a sum of a first coordinate component of the index coordinates of the marked point and a multiplication value of the physical distance and the horizontal coordinate difference value as a horizontal coordinate in a physical coordinate of the marked point and taking a sum of a second coordinate component of the index coordinates of the marked point and a multiplication value of the physical distance and the vertical coordinate difference value as a vertical coordinate in the physical coordinate of the marked point.
[0036] In a third aspect, an embodiment of the present application provides a calibration board generation apparatus, and the apparatus comprises:
[0037] a calibration board size and region determination module configured to determine a size of a calibration board and a calibration board region corresponding to each camera to be calibrated based on shooting ranges of the cameras to be calibrated;
[0038] a cell size determination module configured to determine a cell size included in each calibration board region according to a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marked points required for camera calibration, wherein the marked points are corner points of the cell;
[0039] a coded pattern determination module configured to determine a coded pattern corresponding to the marked point based on a physical coordinate of the marked point, wherein the coded pattern is used to record the physical coordinate;
[0040] a calibration board generation module configured to generate calibration boards corresponding to the cameras to be calibrated according to the size of the calibration board, the calibration board regions, the cell sizes and the coded patterns.
[0041] Optionally, the cell is a rectangle.
[0042] The cell size determination module comprises:
[0043] a side length determination sub-module configured to determine a length and a width of the cell included in each calibration board region according to a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marked points required for camera calibration, so that a number of marked points photographed by the camera to be calibrated when the camera to be calibrated shoots the calibration board region is not less than the number of marked points required for camera calibration, and a size of a coded pattern placed in the cell satisfies a decoding condition.
[0044] The encoding pattern determination module comprises:
[0045] The physical coordinate determination submodule is configured to determine the physical coordinates of the marker points in the calibration board.
[0046] The first encoding pattern acquisition submodule is configured to encode according to the physical coordinates of the marker points in the calibration board to obtain an encoding pattern.
[0047] The encoding pattern determination module comprises:
[0048] The index coordinate determination submodule is configured to determine the index coordinates of the marker points in the calibration board region to which the marker points belong, wherein a first coordinate component of the index coordinates is used to identify the row number of the marker points in the calibration board region, and a second coordinate component of the index coordinates is used to identify the column number of the marker points in the calibration board region.
[0049] The second encoding pattern acquisition submodule is configured to encode according to the index coordinates and the physical distance between adjacent marker points included in the calibration board region to obtain an encoding pattern.
[0050] The calibration board generation module comprises:
[0051] The calibration board generation submodule is configured to generate a calibration board comprising a plurality of cells according to the size of the calibration board, the calibration board regions, and the cell size corresponding to each calibration board region.
[0052] The cell filling submodule is configured to fill the encoding pattern into the cell to which the marker points belong.
[0053] In a fourth aspect, an embodiment of the present application provides a camera calibration device, and the device comprises:
[0054] The calibration board image acquisition module is configured to acquire a calibration board image captured by each to-be-calibrated camera for a calibration board region corresponding to the to-be-calibrated camera in the calibration board, wherein the calibration board comprises a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera are determined based on the shooting range of the to-be-calibrated camera, the cell size included in each calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, and the marker points are corner points of the cells.
[0055] The image coordinate extraction module is configured to extract, for each calibration board image, the image coordinates of each marker point in the calibration board image.
[0056] a physical coordinate determining module, configured to decode each coded pattern in the calibration board image, and determine the physical coordinates of each marker point in the calibration board image;
[0057] a mapping relationship calculating module, configured to, for each to-be-calibrated camera, calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera.
[0058] Optionally, the coded pattern is coded according to the physical coordinates of the marker point in the calibration board.
[0059] The physical coordinate determining module comprises:
[0060] a physical coordinate obtaining sub-module, configured to decode each coded pattern in the calibration board image, and obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board.
[0061] The coded pattern is coded according to the index coordinates of the marker point in the calibration board region to which the marker point belongs and the physical spacing between adjacent marker points included in the calibration board region, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region.
[0062] The physical coordinate determining module comprises:
[0063] a decoding sub-module, configured to decode each coded pattern in the calibration board image, and obtain the index coordinates of the marker point corresponding to the coded pattern in the calibration board region to which the marker point belongs and the physical spacing between adjacent marker points included in the calibration board region.
[0064] an origin difference calculating sub-module, configured to calculate the horizontal coordinate difference and the vertical coordinate difference between the coordinate origin of the region coordinate system of the calibration board region corresponding to the calibration board image and the coordinate origin of the calibration board coordinate system.
[0065] a physical coordinate calculating sub-module, configured to take the sum of the first coordinate component of the index coordinates of the marker point, the multiplication of the physical spacing and the horizontal coordinate difference as the horizontal coordinate of the physical coordinates of the marker point, and take the sum of the second coordinate component of the index coordinates of the marker point, the multiplication of the physical spacing and the vertical coordinate difference as the vertical coordinate of the physical coordinates of the marker point.
[0066] In a fifth aspect, an embodiment of the present application provides a calibration board, which is generated based on the method of any one of the first aspect.
[0067] In a sixth aspect, an electronic device is provided, comprising:
[0068] a memory for storing a computer program;
[0069] a processor for executing the computer program stored in the memory to implement the method of any one of the first aspect or the second aspect.
[0070] In a seventh aspect, a computer readable storage medium is provided, the computer readable storage medium stores a computer program, the computer program is executed by a processor to implement the method of any one of the first aspect or the second aspect.
[0071] The embodiments of the present application have the following beneficial effects:
[0072] The calibration plate generation method, camera calibration method, device, equipment and calibration plate provided by the embodiments of the present application can determine the size of the calibration plate and the calibration plate area corresponding to each to-be-calibrated camera based on the shooting ranges of the plurality of to-be-calibrated cameras; for each calibration plate area, the size of the unit cell included in the calibration plate area is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration plate area and the number of marker points required for camera calibration, wherein the marker point is the corner point of the unit cell; the encoding pattern corresponding to the marker point is determined based on the physical coordinates of the marker point, wherein the encoding pattern is used to record the physical coordinates; and the calibration plate corresponding to the plurality of to-be-calibrated cameras is generated according to the size of the calibration plate, the calibration plate area, the size of the unit cell and the encoding pattern. Since the size of the calibration plate and the calibration plate area corresponding to each to-be-calibrated camera are determined based on the shooting ranges of the plurality of to-be-calibrated cameras, and the size of the unit cell included in the calibration plate area is determined based on the focal length of the to-be-calibrated camera corresponding to the calibration plate area and the number of marker points required for camera calibration, the number of marker points included in the calibration plate image shot by each to-be-calibrated camera can meet the requirements of camera calibration when the to-be-calibrated camera is calibrated, the encoding pattern can be accurately decoded, and the accuracy of the mapping relationship between the image coordinate system and the physical coordinate system can be improved, and the accuracy of multi-camera calibration can be improved and the calibration of the multi-camera system with large imaging field of view difference can be implemented.
[0073] Of course, implementing any product or method of the present application does not necessarily require achieving all the advantages described above at the same time. BRIEF DESCRIPTION OF DRAWINGS
[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.
[0075] Figure 1 A flowchart of a method for generating a calibration board according to an embodiment of the present application is shown in FIG. 1.
[0076] Figure 2 A schematic diagram of a calibration board region corresponding to a multi-camera according to an embodiment of the present application is shown in FIG. 2.
[0077] Figure 3 A schematic diagram of a calibration board region according to an embodiment of the present application is shown in FIG. 3.
[0078] Figure 4 A flowchart of a method for encoding based on physical coordinates according to an embodiment shown in FIG. 4. Figure 1
[0079] A flowchart of a method for encoding based on index coordinates and physical distances according to an embodiment shown in FIG. 5. Figure 5 Figure 1 A flowchart of a method for filling a cell according to an embodiment shown in FIG. 6.
[0080] Figure 6 Figure 1 A schematic diagram of a calibration board according to an embodiment of the present application is shown in FIG. 7.
[0081] Figure 7 A flowchart of a camera calibration method according to an embodiment of the present application is shown in FIG. 8.
[0082] Figure 8 A flowchart of a method for determining physical coordinates of a marker point according to an embodiment shown in FIG. 9.
[0083] Figure 9 A schematic diagram of a calibration board generation device according to an embodiment of the present application is shown in FIG. 10. Figure 8
[0084] A schematic diagram of a camera calibration device according to an embodiment of the present application is shown in FIG. 11. Figure 10
[0085] A schematic diagram of an electronic device according to an embodiment of the present application is shown in FIG. 12. Figure 11 DETAILED DESCRIPTION
[0086] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application. Figure 12 DETAILED DESCRIPTION
[0087] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.
[0088] To improve the accuracy of multi-camera calibration and realize the calibration of a multi-camera system with a large difference in imaging field of view, an embodiment of the present application provides a calibration board generation method, a camera calibration method, a device, an apparatus, and a calibration board. First, the calibration board generation method provided by the embodiment of the present application is introduced. The calibration board generation method provided by the embodiment of the present application can be applied to any electronic device that needs to generate a calibration board, which is not specifically limited here.
[0089] As shown in Figure 1 A calibration board generation method, the method comprising:
[0090] S101, determining the size of a calibration board and a calibration board area corresponding to each to-be-calibrated camera based on the shooting range of the plurality of to-be-calibrated cameras;
[0091] S102, for each calibration board area, determining the size of a unit cell included in the calibration board area according to the focal length of the to-be-calibrated camera corresponding to the calibration board area and the number of marker points required for camera calibration;
[0092] Wherein, the marker point is the corner point of the unit cell;
[0093] S103, determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point;
[0094] Wherein, the encoding pattern is used to record the physical coordinates;
[0095] S104, generating the calibration board corresponding to the plurality of to-be-calibrated cameras according to the size of the calibration board, the calibration board area, the size of the unit cell, and the encoding pattern.
[0096] As can be seen, in the solution provided in this application embodiment, the electronic device can determine the size of the calibration board and the calibration board area corresponding to each camera to be calibrated based on the shooting range of multiple cameras to be calibrated; for each calibration board area, the cell size included in the calibration board area is determined according to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, wherein the marker point is the corner point of the cell; based on the physical coordinates of the marker point, the corresponding encoding pattern is determined, wherein the encoding pattern is used to record the physical coordinates; and the calibration board corresponding to the multiple cameras to be calibrated is generated according to the size of the calibration board, the calibration board area, the cell size, and the encoding pattern. Since the size of the calibration board and the calibration board area corresponding to each camera to be calibrated are determined based on the shooting range of multiple cameras to be calibrated, and the cell size included in the calibration board area is determined based on the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, the number of marker points included in the calibration board image captured by each camera to be calibrated can meet the requirements of camera calibration when calibrating the camera to be calibrated. This allows for accurate decoding of the coded graphics, thereby improving the accuracy of calculating the mapping relationship between the image coordinate system and the physical coordinate system. It can also improve the accuracy of multi-camera calibration and enable the calibration of multi-camera systems with large differences in imaging field of view.
[0097] When photographing a large object or when multiple angles of the object are required, a multi-camera array is necessary. A multi-camera array uses multiple cameras positioned at different locations in space to capture images of the object from different perspectives. To obtain the mapping between the camera's physical coordinate system and the image coordinate system, a calibration board is typically used to calibrate the camera.
[0098] When using multiple cameras for shooting, it is necessary to calibrate all cameras. However, the shooting ranges of these multiple cameras often differ. To calibrate multiple cameras using the same calibration board, a calibration board applicable to all cameras needs to be generated. In the solution of this application embodiment, the electronic device can determine the size of the calibration board and the calibration board area corresponding to each camera based on the shooting ranges of the multiple cameras, i.e., execute step S101.
[0099] For example, such as Figure 2 As shown, there are four cameras to be calibrated, designated as cameras 201-204, and the positions of each camera are shown in the figure. Since the four cameras have different shooting ranges, the electronic equipment can determine the size of the calibration board and the corresponding calibration board area for each camera based on their shooting ranges. Figure 2The calibration board regions 205-208 are respectively determined based on the shooting ranges of the cameras 201-204 to be calibrated.
[0100] In order to accurately calibrate the cameras to be calibrated, when the cameras to be calibrated shoot the calibration board regions, a sufficient number of marker points need to be included in the calibration board images, which can be the corner points of the cells. At the same time, the size of the cells in the calibration board regions cannot be too small, which will result in an unclear image and failure to calibrate the cameras to be calibrated.
[0101] Therefore, the electronic device can determine the size of the cells included in each calibration board region according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration, i.e., perform step S102, wherein the marker points are the corner points of the cells. For example, the number of marker points required for camera calibration can be 9. In this way, the number of marker points shot by the camera to be calibrated when shooting the calibration board region can be not less than the number of marker points required for camera calibration, which can meet the calibration requirements.
[0102] Specifically, the smaller the focal length of the camera to be calibrated, the larger the size of the cells included in the calibration board region corresponding to the camera to be calibrated. Each calibration board region can be covered with cells of the size corresponding to the calibration board region, and Figure 2 The fact that each calibration board region includes one cell is only for the purpose of illustrating that the sizes of the cells included in different calibration board regions are different, and does not mean that the calibration board region only has one cell.
[0103] For example, as shown in FIG. 2, Figure 2 The electronic device can determine the sizes of the cells 209-212 included in the calibration board regions 205-208, respectively, according to the focal lengths of the cameras 201-204 to be calibrated and the number of marker points required for camera calibration, respectively.
[0104] In order to determine the mapping relationship between the physical coordinate system corresponding to the camera to be calibrated and the image coordinate system, the electronic device can obtain the physical coordinates and image coordinates of the marker points in the calibration board image shot by the camera to be calibrated. The image coordinates can be directly obtained by extracting the coordinates of the marker points in the calibration board image, and the physical coordinates can be obtained by decoding the coded patterns in the calibration board image. Therefore, the electronic device can determine the coded pattern corresponding to the marker point based on the physical coordinates of the marker point, i.e., perform step S103, wherein the coded pattern is used to record the physical coordinates.
[0105] For example, as shown in FIG. 3, Figure 3 Figure 3 For the chessboard type calibration board, the encoding pattern 301 can be determined based on the physical coordinates of the marker points 302-305, and the encoding pattern 301 is used to record the physical coordinates. In this way, the physical coordinates of the marker points 302-305 can be obtained by decoding the encoding pattern 301.
[0106] After the size of the calibration board, the calibration board area, the cell size, and the encoding pattern are determined, the electronic device can generate a calibration board corresponding to each of the plurality of cameras to be calibrated according to the size of the calibration board, the calibration board area, the cell size, and the encoding pattern, that is, perform step S104. In this way, one calibration board can be used to calibrate a plurality of cameras to be calibrated, and the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with a large difference in imaging field of view can be implemented.
[0107] As can be seen, in the embodiments of the present application, since the size of the calibration board and the calibration board area corresponding to each camera to be calibrated are determined based on the shooting range of the plurality of cameras to be calibrated, and the cell size included in the calibration board area is determined based on the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, the number of marker points included in the calibration board image shot by each camera to be calibrated can meet the requirements of camera calibration when the camera to be calibrated is calibrated, the encoding pattern can be accurately decoded, and the accuracy of the mapping relationship between the image coordinate system and the physical coordinate system can be improved, the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with a large difference in imaging field of view can be implemented.
[0108] As an implementation manner of the embodiments of the present application, the above-mentioned cell can be a rectangle, for example, the cell can be a rectangle or a square, and the above-mentioned step of determining the cell size included in the calibration board area according to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration can include:
[0109] According to the focal length of the camera to be calibrated corresponding to the calibration board area and the number of marker points required for camera calibration, the length and width of the cell included in the calibration board area are determined, so that the number of marker points shot by the camera to be calibrated when shooting the calibration board area is not less than the number of marker points required for camera calibration, and the size of the encoding pattern placed in the cell satisfies the decoding condition.
[0110] Since the electronic device can decode the coded patterns in the calibration board image obtained by the camera to be calibrated capturing the calibration board area, and extract the coordinates of the marker points in the calibration board image, the number of marker points captured by the camera to be calibrated capturing the calibration board area is not less than the number of marker points required for camera calibration. This ensures that the number of marker points is sufficient, thereby enabling the electronic device to accurately calculate the mapping relationship between the physical coordinate system and the image coordinate system corresponding to the camera to be calibrated.
[0111] Furthermore, the size of the coded graphic captured by the camera to be calibrated and placed within the cell must meet the decoding requirements; that is, while ensuring a sufficient number of marker points, the cell size cannot be too small. If the cell size is too small, the captured coded graphic within the cell will lack clarity, making decoding impossible. Therefore, when the cell is square, the electronic device can determine the side length of the cells within the calibration board area based on the focal length of the camera to be calibrated corresponding to that area and the number of marker points required for camera calibration. When the cell is rectangular, the electronic device can determine the length and width of the cells within the calibration board area based on the focal length of the camera to be calibrated corresponding to that area and the number of marker points required for camera calibration.
[0112] For example, such as Figure 2 Since the focal lengths of cameras 202 and 203 to be calibrated are smaller than those of cameras 201 and 204 to be calibrated, the smaller the focal length of the camera to be calibrated, the larger its shooting range. Therefore, the cell 210 included in the calibration plate area 206 corresponding to camera 202 and the cell 211 included in the calibration plate area 207 corresponding to camera 203 are larger in size.
[0113] If, during camera calibration, the image captured by the camera to be calibrated includes the calibration board area corresponding to other cameras, the electronic device can process the image captured by the camera to be calibrated and select the ROI (Region of Interest) in the image, which is the cell included in the calibration board area corresponding to that camera. This allows for the calibration of multi-camera systems with significantly different imaging fields of view.
[0114] It can be seen that, in the embodiment of the present application, the electronic device can determine the length and width of the unit cell included in the calibration board region according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, so that the number of marker points photographed by the to-be-calibrated camera when photographing the calibration board region is not less than the number of marker points required for camera calibration, and the size of the coded pattern placed in the unit cell satisfies the decoding condition. Since the electronic device can decode the coded pattern in the calibration board image obtained by the to-be-calibrated camera photographing the calibration board region, and extract the coordinates of the marker points in the calibration board image. In order to make the number of marker points photographed by the to-be-calibrated camera when photographing the calibration board region not less than the number of marker points required for camera calibration, and the size of the coded pattern placed in the unit cell satisfies the decoding condition. The electronic device can determine the length and width of the unit cell included in the calibration board region according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration. In this way, the number of marker points can be sufficient, thereby enabling the electronic device to accurately calculate the mapping relationship between the physical coordinate system corresponding to the to-be-calibrated camera and the image coordinate system, and ensuring that the electronic device can successfully decode, thereby improving the accuracy of multi-camera calibration and enabling the calibration of multi-camera systems with large imaging field of view differences.
[0115] As an implementation manner of the embodiment of the present application, as shown in Figure 4 The step of determining the coded pattern corresponding to the marker point based on the physical coordinates of the marker point can include:
[0116] S401, determining the physical coordinates of the marker point in the calibration board;
[0117] Since camera calibration is to determine the mapping relationship between the physical coordinate system corresponding to the to-be-calibrated camera and the image coordinate system, the electronic device can determine the physical coordinates of the marker point in the physical coordinate system.
[0118] For example, the electronic device can set an angle point in the calibration board as the origin of the physical coordinate system, and set two edges of the calibration board passing through the angle point as the X axis and the Y axis of the physical coordinate system. In this way, the electronic device can determine the physical coordinates of the marker point in the calibration board.
[0119] S402, encoding according to the physical coordinates of the marker point in the calibration board to obtain a coded pattern.
[0120] In order to enable the electronic device to obtain the physical coordinates of the marker point, after determining the physical coordinates of the marker point, the electronic device can encode according to the physical coordinates of the marker point in the calibration board, and further obtain a coded pattern.
[0121] For example, the coded pattern can be a QR (Quick Response) code, a DM (Data Matrix) code, or the like, which is not limited herein.
[0122] It can be seen that in the embodiments of the present application, the electronic device can determine the physical coordinates of the marker points in the calibration board, and encode according to the physical coordinates of the marker points in the calibration board to obtain a coded pattern. Since camera calibration is to determine the mapping relationship between the physical coordinate system corresponding to the camera to be calibrated and the image coordinate system, the electronic device can determine the physical coordinates of the marker points in the physical coordinate system, and then encode according to the physical coordinates of the marker points in the calibration board to obtain a coded pattern. In this way, the accuracy of obtaining the physical coordinates of the marker points can be improved, and the accuracy of multi-camera calibration and the calibration of a multi-camera system with large imaging field of view difference can be improved.
[0123] As an implementation manner of the embodiments of the present application, as shown in Figure 5 the above step of determining the coded pattern corresponding to the marker point based on the physical coordinates of the marker point can include:
[0124] S501, determining the index coordinates of the marker point in the calibration board region to which the marker point belongs;
[0125] The first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region.
[0126] Since the index coordinates can be used to identify the position of the marker point in the plurality of marker points included in the calibration board region, the electronic device can determine the index coordinates of the marker point in the calibration board region to which the marker point belongs. Specifically, the first coordinate component of the index coordinates can be used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region.
[0127] For example, as shown in Figure 3 , Figure 3 the calibration board region can be represented as follows: if the corner point at the upper left corner of the calibration board region is the coordinate origin, the horizontal edge passing through the corner point is the X axis, and the vertical edge passing through the corner point is the Y axis. Then the index coordinates of the marker point 302 can be (1, 1), and the index coordinates of the marker point 305 can be (2, 2).
[0128] S502, encoding according to the index coordinates and the physical distance between adjacent marker points included in the calibration board region to obtain a coded pattern.
[0129] Since the index coordinate can be used to identify the row sequence number and the column sequence number of the mark point in the plurality of mark points included in the mark plate region to which the mark point belongs, and the mark point is a corner point of a cell. Therefore, the product of the row sequence number and the physical distance between the adjacent mark points included in the mark plate region can be the horizontal coordinate in the physical coordinate of the mark point, and the product of the column sequence number and the physical distance between the adjacent mark points included in the mark plate region can be the vertical coordinate in the physical coordinate of the mark point.
[0130] It can be seen that the electronic device can calculate the physical coordinate of the mark point according to the index coordinate of the mark point and the physical distance between the adjacent mark points included in the mark plate region, and therefore the electronic device can encode according to the index coordinate and the physical distance between the adjacent mark points included in the mark plate region to obtain an encoded graph.
[0131] Taking an example in the receiving step S501, if the physical distance between the adjacent mark points included in the mark plate region is 5, then the electronic device can encode according to the index coordinate of each mark point in the mark plate region and the physical distance 5 between the adjacent mark points included in the mark plate region, and further obtain an encoded graph. Figure 3 Taking an example in the receiving step S501, if the physical distance between the adjacent mark points included in the mark plate region is 5, then the electronic device can encode according to the index coordinate of each mark point in the mark plate region and the physical distance 5 between the adjacent mark points included in the mark plate region, and further obtain an encoded graph.
[0132] It can be seen that in the embodiments of the present application, the electronic device can determine the index coordinate of the mark point in the mark plate region to which the mark point belongs, wherein the first coordinate component of the index coordinate is used to identify the row sequence number of the mark point in the plurality of mark points included in the mark plate region, and the second coordinate component of the index coordinate is used to identify the column sequence number of the mark point in the plurality of mark points included in the mark plate region; and encode according to the index coordinate and the physical distance between the adjacent mark points included in the mark plate region to obtain an encoded graph. Since the index coordinate can be used to identify the position of the mark point in the plurality of mark points included in the mark plate region, and the product of the row sequence number and the physical distance between the adjacent mark points included in the mark plate region can be the horizontal coordinate in the physical coordinate of the mark point, and the product of the column sequence number and the physical distance between the adjacent mark points included in the mark plate region can be the vertical coordinate in the physical coordinate of the mark point. Therefore, the electronic device can encode according to the index coordinate and the physical distance between the adjacent mark points included in the mark plate region, and further obtain an encoded graph. In this way, the electronic device can accurately calculate the physical coordinate of the mark point based on the decoding result of the encoded graph, and further improve the accuracy of multi-camera calibration and realize the calibration of a multi-camera system with large imaging field of view difference.
[0133] As an implementation manner of the embodiments of the present application, as shown in Figure 6As shown, the steps described above for generating calibration boards corresponding to the plurality of cameras to be calibrated based on the size of the calibration board, the calibration board area, the cell size, and the coded pattern may include:
[0134] S601, Generate a calibration board including multiple cells based on the size of the calibration board, the calibration board area, and the cell size corresponding to each calibration board area;
[0135] Once the dimensions of the calibration board, the calibration board area, and the cell size corresponding to each calibration board area are determined, the electronic device can generate a calibration board containing multiple cells based on the dimensions of the calibration board, the calibration board area, and the cell size corresponding to each calibration board area. The size of the cells included in each calibration board area is the cell size corresponding to that calibration board area.
[0136] S602, fill the coded graphic into the cell containing the corresponding marker point.
[0137] For each calibration plate area, since the size of each cell is generated based on the focal length of the camera to be calibrated corresponding to that area and the number of marker points required for camera calibration, after generating a calibration plate with multiple cells, the electronic device can fill the corresponding cell with the coded graphic. In this way, the size of the coded graphic meets the decoding conditions, and when the camera to be calibrated captures images of that calibration plate area, the number of marker points captured is sufficient to successfully calculate the mapping relationship between the image coordinate system and the physical coordinate system of the camera to be calibrated.
[0138] For example, such as Figure 7 As shown, Figure 7 A calibration board image generated for an electronic device. Figure 7 The calibration board shown is based on Figure 2 The calibration board shown indicates that, specifically, the electronic device can be obtained from it. Figure 2 Based on the calibration board shown, a calibration board with multiple cells is generated, and then the coded graphics are filled into the cells corresponding to the marker points. Figure 7 The calibration plate areas 701-704 in the figure are respectively for... Figure 2 The above operations were performed on calibration plate areas 205-208.
[0139] It should be noted that, Figure 7 The dashed box in the figure is only used to represent the calibration plate area and does not exist in the actual calibration plate.
[0140] It can be seen that in the embodiment of the present application, the electronic device can generate a calibration board including a plurality of cells according to the size of the calibration board, the calibration board area, and the size of the cell corresponding to each calibration board area; and fill the coded pattern into the cell to which the corresponding marker point belongs. Since the size of the cell is generated based on the focal length of the to-be-calibrated camera corresponding to the calibration board area and the number of marker points required for camera calibration, after the calibration board including a plurality of cells is generated, the electronic device can fill the coded pattern into the cell to which the corresponding marker point belongs. In this way, it can be ensured that the size of the coded pattern meets the decoding condition, that is, it can be successfully decoded, and when the to-be-calibrated camera captures the calibration board area, the number of captured marker points is sufficient, and the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera can be successfully calculated, which can improve the accuracy of multi-camera calibration and realize the calibration of a multi-camera system with large imaging field of view difference.
[0141] The embodiment of the present application also provides a camera calibration method, which will be introduced below.
[0142] As shown in Figure 8 A camera calibration method, the method comprising:
[0143] S801, acquiring a calibration board image captured by each to-be-calibrated camera for a calibration board area corresponding to the to-be-calibrated camera in the calibration board;
[0144] The calibration board includes a plurality of calibration board areas, the size of the calibration board and the calibration board area corresponding to each to-be-calibrated camera are determined based on the shooting range of the to-be-calibrated camera, the size of the cell included in each calibration board area is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board area and the number of marker points required for camera calibration, and the marker point is a corner point of the cell.
[0145] S802, for each calibration board image, extracting the image coordinates of each marker point in the calibration board image;
[0146] S803, decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image;
[0147] S804, for each to-be-calibrated camera, calculating the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera.
[0148] It can be seen that in the scheme provided by the embodiments of the present application, the electronic device can obtain the calibration board image photographed by each to-be-calibrated camera for the calibration board region corresponding to the to-be-calibrated camera in the calibration board, wherein the calibration board includes a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera are determined based on the photographing range of the to-be-calibrated camera, and the size of the unit cell included in each calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, the marker point being the corner point of the unit cell; for each calibration board image, the image coordinates of each marker point in the calibration board image are extracted; each coded pattern in the calibration board image is decoded to determine the physical coordinates of each marker point in the calibration board image; for each to-be-calibrated camera, the mapping relationship between the image coordinate system corresponding to the to-be-calibrated camera and the physical coordinate system is calculated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. Since the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera can be determined based on the photographing range of the to-be-calibrated camera, and the size of the unit cell included in each calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration. Therefore, the electronic device can accurately decode each calibration board image, determine the physical coordinates of each marker point, extract the image coordinates of each marker point in the calibration board image, and then calculate the mapping relationship between the image coordinate system corresponding to each to-be-calibrated camera and the physical coordinate system based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. In this way, the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with large imaging field of view difference can be realized.
[0149] Since the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera can be determined based on the photographing range of the to-be-calibrated camera, the calibration board image photographed by each to-be-calibrated camera for the calibration board region corresponding to the to-be-calibrated camera in the calibration board only includes the calibration board region corresponding to the to-be-calibrated camera.
[0150] Since the size of the unit cell included in the calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, a sufficient number of marker points are included in the calibration board image photographed by each to-be-calibrated camera, and the mapping relationship between the physical coordinate system corresponding to each to-be-calibrated camera and the image coordinate system can be calculated. The electronic device can obtain the calibration board image photographed by each to-be-calibrated camera for the calibration board region corresponding to the to-be-calibrated camera in the calibration board, that is, step S801 is performed.
[0151] For example, the number of cameras to be calibrated is 4, which are cameras 1-4 to be calibrated, and the corresponding calibration board regions of the cameras 1-4 to be calibrated are calibration board regions 1-4. Then the electronic device can obtain the calibration board images captured by each camera to be calibrated for the calibration board region corresponding to the camera to be calibrated in the calibration board, and the calibration board images captured by the cameras 1-4 to be calibrated are images of the calibration board regions 1-4, respectively.
[0152] Since the mapping relationship to be calculated is the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the camera to be calibrated, the mapping relationship between the image coordinate system and the physical coordinate system can be calculated based on the image coordinates and the physical coordinates of the marker points. Therefore, the electronic device can extract the image coordinates of each marker point in each calibration board image, that is, perform step S802.
[0153] For example, the electronic device can use a feature point extraction algorithm to extract the image coordinates of each marker point in each calibration board image.
[0154] Since the coded pattern is encoded based on the physical coordinates of each marker point in the calibration board image, the coded image can be used to record the physical coordinates of the marker points. Therefore, the electronic device can decode each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image, that is, perform step S803.
[0155] Since the relationship between the image coordinates and the physical coordinates of the marker points can reflect the mapping relationship between the image coordinate system and the physical coordinate system, the electronic device can calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each camera to be calibrated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the camera to be calibrated, that is, perform step S804. Further, the calibration of the multi-camera is completed.
[0156] It can be seen that, in the embodiments of the present application, since the size of the calibration board and the calibration board region corresponding to each camera to be calibrated can be determined based on the shooting range of the camera to be calibrated, and the size of each unit cell included in each calibration board region is determined according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration. Therefore, the electronic device can accurately decode each calibration board image, determine the physical coordinates of each marker point, extract the image coordinates of each marker point in the calibration board image, and further calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each camera to be calibrated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the camera to be calibrated. In this way, the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with large imaging field of view difference can be realized.
[0157] As an implementation form of the embodiment of the present application, the above-mentioned coded pattern can be obtained by encoding according to the physical coordinates of the marker point in the calibration board;
[0158] The step of decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image can include:
[0159] Decoding each coded pattern in the calibration board image to obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board.
[0160] Since the coded pattern can be obtained by encoding according to the physical coordinates of the marker point in the calibration board, the electronic device can decode each coded pattern in the calibration board image, and further obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board.
[0161] In this way, the electronic device can calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each camera to be calibrated based on the physical coordinates and image coordinates of the marker points included in the calibration board image photographed by the camera to be calibrated.
[0162] As can be seen, in the embodiment of the present application, the electronic device can decode each coded pattern in the calibration board image to obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board. Since the coded pattern can be obtained by encoding according to the physical coordinates of the marker point in the calibration board, the electronic device can decode each coded pattern in the calibration board image, and further obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board. The electronic device can accurately determine the physical coordinates of the marker point, and thus can improve the accuracy of multi-camera calibration and implement calibration of a multi-camera system with large imaging field of view difference.
[0163] As an implementation form of the embodiment of the present application, the above-mentioned coded pattern can be obtained by encoding according to the index coordinates of the marker point in the calibration board region to which the marker point belongs and the physical distance between adjacent marker points included in the calibration board region, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region.
[0164] As shown in Figure 9 The step of decoding each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image can include:
[0165] S901, decode each coded pattern in the calibration board image to obtain the index coordinates of the marker point corresponding to the coded pattern in its respective calibration board area and the physical distance between adjacent marker points included in the calibration board area;
[0166] Since the coded pattern can be obtained by encoding the index coordinates of the corresponding marker point and the physical distance between adjacent marker points within the calibration board area, and the physical coordinates of the marker point corresponding to the coded pattern can be calculated based on these coordinates, the electronic device can decode each coded pattern in the calibration board image to obtain the index coordinates of the marker point corresponding to the coded pattern within its respective calibration board area and the physical distance between adjacent marker points within that area.
[0167] S902, calculate the difference in abscissa and ordinate between the origin of the coordinate system of the region corresponding to the calibration plate image and the origin of the coordinate system of the calibration plate.
[0168] Since the index coordinates record the index coordinates of the marker point corresponding to the coded graphic in its respective calibration plate area, the coordinates calculated based on the index coordinates are the coordinates of the marker point in the regional coordinate system of the calibration plate area.
[0169] To unify the coordinates of the marker points in the regional coordinate system corresponding to each calibration plate region, the differences in the x-coordinate and y-coordinate between the origin of the regional coordinate system of the calibration plate region corresponding to the calibration plate image and the origin of the calibration plate coordinate system can be calculated. Then, the x-coordinate and y-coordinate in the regional coordinate system can be summed with the differences in the x-coordinate and y-coordinate, respectively, mapping the marker points in each regional coordinate system to the unified calibration plate coordinate system, thus treating the coordinates in the calibration plate coordinate system as physical coordinates.
[0170] For example, such as Figure 2 As shown, the top-left corner of the calibration plate area is taken as the origin of the calibration plate coordinate system, and the top-left corner of each calibration plate area is taken as the origin of the regional coordinate system of that calibration plate area. For region 1, since the origin of the calibration plate coordinate system coincides with the origin of the regional coordinate system of region 1, the difference in both the x-coordinate and y-coordinate between the origin of the regional coordinate system of region 1 and the origin of the calibration plate coordinate system is 0.
[0171] For the differences in the x-coordinate and y-coordinate between the origin of the regional coordinate system and the origin of the calibration plate coordinate system in other regions, the values are determined by... Figure 2The side length of the calibration board region of the marked annotation is visible. For region 2, the above-mentioned horizontal coordinate difference and vertical coordinate difference are x1 and 0 respectively; for region 3, the above-mentioned horizontal coordinate difference and vertical coordinate difference are 0 and y1 respectively; for region 4, the above-mentioned horizontal coordinate difference and vertical coordinate difference are x2 and y1 respectively.
[0172] S903, taking the sum of the first coordinate component of the index coordinate of the marked point and the multiplication of the physical distance and the horizontal coordinate difference as the horizontal coordinate in the physical coordinate of the marked point, and taking the sum of the second coordinate component of the index coordinate of the marked point and the multiplication of the physical distance and the vertical coordinate difference as the vertical coordinate in the physical coordinate of the marked point.
[0173] The index coordinate of the marked point includes a first coordinate component and a second coordinate component, the first coordinate component can be used to identify the row sequence number of the marked point in the plurality of marked points included in the calibration board region, and the second coordinate component can be used to identify the column sequence number of the marked point in the plurality of marked points included in the calibration board region.
[0174] Since the physical distance represents the distance between adjacent marked points included in the calibration board region in the physical coordinate system, for the case that the shape of the unit cell is rectangular, since the marked point is the corner point of the unit cell, the horizontal physical distance is the length of the unit cell, and the vertical physical distance is the width of the unit cell, therefore the multiplication of the first coordinate component of the marked point and the physical distance between adjacent marked points included in the calibration board region to which the marked point belongs represents the horizontal coordinate of the marked point in the calibration board region to which the marked point belongs. Similarly, the multiplication of the second coordinate component of the marked point and the physical distance between adjacent marked points included in the calibration board region to which the marked point belongs represents the vertical coordinate of the marked point in the calibration board region to which the marked point belongs.
[0175] The sum of the first coordinate component of the index coordinate of the marked point and the multiplication of the physical distance and the horizontal coordinate difference, i.e. the sum of the horizontal coordinate of the marked point in the region coordinate system and the horizontal coordinate difference, can be used to represent the horizontal coordinate in the physical coordinate of the marked point. Similarly, the sum of the second coordinate component of the index coordinate of the marked point and the multiplication of the physical distance and the vertical coordinate difference is the vertical coordinate in the physical coordinate of the marked point.
[0176] Taking the marked point in region 4 as an example in the example in step S902, if the shape of the unit cell is a square, the first coordinate component and the second coordinate component in the index coordinate of the marked point are 3 and 2 respectively, and the physical distance between adjacent marked points included in region 4 is 4. Then the first coordinate component and the second coordinate component in the index coordinate can be multiplied by the physical distance respectively to obtain the coordinate (12, 8) of the marked point in the region coordinate system of region 4.
[0177] Since the differences in the x-coordinate and y-coordinate between the origin coordinates of the region coordinate system corresponding to region 4 and the origin coordinates of the calibration plate coordinate system are x2 and y1 respectively, the x-coordinate and y-coordinate of the marker point in the region coordinate system of region 4 can be summed with x2 and y1 respectively. If the values of x2 and y1 are 30 and 20 respectively, then the physical coordinates of the marker point can be obtained as (42, 28).
[0178] As can be seen, in this embodiment of the application, the electronic device can decode each coded pattern in the calibration board image to obtain the index coordinates of the marker point corresponding to the coded pattern in its respective calibration board region and the physical distance between adjacent marker points included in the calibration board region; calculate the difference between the horizontal coordinate and the vertical coordinate between the origin of the regional coordinate system of the calibration board region corresponding to the calibration board image and the origin of the calibration board coordinate system; take the sum of the product of the first coordinate component of the index coordinate of the marker point and the physical distance and the difference of the horizontal coordinate as the horizontal coordinate of the marker point, and take the sum of the product of the second coordinate component of the index coordinate of the marker point and the physical distance and the difference of the vertical coordinate as the vertical coordinate of the marker point. Since the index coordinates record the index coordinates of the marker point corresponding to the coded image within its respective calibration board region, the coordinates calculated based on these index coordinates and the physical distance are the coordinates of the marker point in the regional coordinate system of that calibration board region. To unify the coordinates of marker points in the regional coordinate systems corresponding to different calibration board regions, the differences in the x-coordinate and y-coordinate between the origin of the regional coordinate system of the calibration board region corresponding to the calibration board image and the origin of the calibration board coordinate system can be calculated. In this way, the x-coordinate and y-coordinate in the regional coordinate system can be summed with the differences in the x-coordinate and y-coordinate, respectively, mapping the marker points in each regional coordinate system to a unified calibration board coordinate system. Treating the coordinates in the calibration board coordinate system as physical coordinates ensures the accuracy of the marker points' physical coordinates, thereby improving the accuracy of multi-camera calibration and enabling the calibration of multi-camera systems with significant differences in imaging field of view.
[0179] Corresponding to the above-described calibration board generation method, this application also provides a calibration board generation apparatus. The calibration board generation apparatus provided in this application embodiment is described below.
[0180] like Figure 10 As shown, a calibration board generation apparatus includes:
[0181] The calibration board size and area determination module 1001 is used to determine the size of the calibration board and the calibration board area corresponding to each camera based on the shooting range of multiple cameras to be calibrated.
[0182] The cell size determination module 1002 is configured to determine, for each calibration board region, a cell size included in the calibration board region according to a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marker points required for camera calibration, wherein the marker points are corner points of the cell.
[0183] The code pattern determination module 1003 is configured to determine a code pattern corresponding to the marker point based on a physical coordinate of the marker point, wherein the code pattern is used to record the physical coordinate.
[0184] The calibration board generation module 1004 is configured to generate the calibration board corresponding to the plurality of cameras to be calibrated according to the size of the calibration board, the calibration board region, the cell size and the code pattern.
[0185] It can be seen that in the scheme provided by the embodiments of the present application, the electronic device can determine the size of the calibration board and the calibration board region corresponding to each camera to be calibrated based on the shooting range of the plurality of cameras to be calibrated, determine, for each calibration board region, a cell size included in the calibration board region according to a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marker points required for camera calibration, wherein the marker points are corner points of the cell, determine a code pattern corresponding to the marker point based on a physical coordinate of the marker point, wherein the code pattern is used to record the physical coordinate, and generate the calibration board corresponding to the plurality of cameras to be calibrated according to the size of the calibration board, the calibration board region, the cell size and the code pattern. Since the size of the calibration board and the calibration board region corresponding to each camera to be calibrated are determined based on the shooting range of the plurality of cameras to be calibrated, and the cell size included in the calibration board region is determined based on a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marker points required for camera calibration, the number of marker points included in the calibration board image shot by each camera to be calibrated can meet the requirement for camera calibration when the camera to be calibrated is calibrated, the code pattern can be accurately decoded, and thus the accuracy of the mapping relationship between the image coordinate system and the physical coordinate system can be improved, and the accuracy of multi-camera calibration can be improved and the calibration of a multi-camera system with large imaging field of view difference can be implemented.
[0186] As an implementation manner of the embodiments of the present application, the above-mentioned cell can be a rectangle.
[0187] The cell size determination module 1002 can include:
[0188] The length and width of the unit cell included in the calibration board region are determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, so that the number of marker points photographed by the to-be-calibrated camera when the to-be-calibrated camera photographs the calibration board region is not less than the number of marker points required for camera calibration, and the size of the coded pattern placed in the unit cell satisfies the decoding condition.
[0189] As an implementation of the embodiment of the present application, the coded pattern determination module 1003 can include:
[0190] The physical coordinate determination submodule is configured to determine the physical coordinates of the marker points in the calibration board.
[0191] The first coded pattern acquisition submodule is configured to encode according to the physical coordinates of the marker points in the calibration board to obtain a coded pattern.
[0192] As an implementation of the embodiment of the present application, the coded pattern determination module 1003 can include:
[0193] The index coordinate determination submodule is configured to determine the index coordinates of the marker points in the calibration board region to which the marker points belong, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker points in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker points in the calibration board region.
[0194] The second coded pattern acquisition submodule is configured to encode according to the index coordinates and the physical distance between adjacent marker points included in the calibration board region to obtain a coded pattern.
[0195] As an implementation of the embodiment of the present application, the calibration board generation module 1004 can include:
[0196] The calibration board generation submodule is configured to generate a calibration board including a plurality of unit cells according to the size of the calibration board, the calibration board regions, and the unit cell size corresponding to each calibration board region.
[0197] The unit cell filling submodule is configured to fill the coded pattern into the unit cell to which the marker point belongs.
[0198] Corresponding to the camera calibration method, the embodiment of the present application further provides a camera calibration device, and the camera calibration device provided by the embodiment of the present application will be introduced below.
[0199] As shown in Figure 11 A camera calibration device, the device includes:
[0200] The calibration board image acquisition module 1101 is configured to acquire a calibration board image captured by each to-be-calibrated camera for a calibration board region corresponding to the to-be-calibrated camera in a calibration board, wherein the calibration board includes a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera are determined based on the shooting range of the to-be-calibrated camera, and the size of each calibration board region includes a unit cell determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, the marker point being a corner point of the unit cell;
[0201] The image coordinate extraction module 1102 is configured to extract, for each calibration board image, the image coordinates of each marker point in the calibration board image.
[0202] The physical coordinate determination module 1103 is configured to decode each coded pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image.
[0203] The mapping relationship calculation module 1104 is configured to calculate, for each to-be-calibrated camera, the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera.
[0204] It can be seen that in the scheme provided in the embodiments of the present application, the electronic device can obtain the image of the calibration board photographed by each to-be-calibrated camera for the calibration board region corresponding to the to-be-calibrated camera in the calibration board, wherein the calibration board includes a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera are determined based on the photographing range of the to-be-calibrated camera, and the size of each calibration board region included is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, and the marker point is the corner point of the cell. For each calibration board image, the image coordinates of each marker point in the calibration board image are extracted. Each coded pattern in the calibration board image is decoded to determine the physical coordinates of each marker point in the calibration board image. For each to-be-calibrated camera, the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera is calculated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. Since the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera can be determined based on the photographing range of the to-be-calibrated camera, and the size of each calibration board region included is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration. Therefore, the electronic device can accurately decode each calibration board image, determine the physical coordinates of each marker point, extract the image coordinates of each marker point in the calibration board image, and then calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each to-be-calibrated camera based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. In this way, the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with large imaging field of view difference can be realized.
[0205] As an implementation manner of the embodiments of the present application, the above-mentioned coded pattern can be obtained by encoding according to the physical coordinates of the marker points in the calibration board;
[0206] The above-mentioned physical coordinate determination module 1103 can include:
[0207] The physical coordinate acquisition sub-module is configured to decode each coded pattern in the calibration board image to obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board.
[0208] As an implementation manner of the embodiments of the present application, the above-mentioned coded pattern can be obtained by encoding according to the index coordinates of the marker points in the calibration board region to which the marker points belong and the physical distance between the adjacent marker points included in the calibration board region, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region.
[0209] The physical coordinate determination module 1103 can include:
[0210] The decoding sub-module is configured to decode each coded pattern in the calibration board image to obtain index coordinates of a marked point corresponding to the coded pattern in a calibration board region to which the coded pattern belongs and a physical distance between adjacent marked points included in the calibration board region.
[0211] The origin difference calculation sub-module is configured to calculate a horizontal coordinate difference and a vertical coordinate difference between a coordinate origin of a region coordinate system of the calibration board region corresponding to the calibration board image and a coordinate origin of the calibration board coordinate system.
[0212] The physical coordinate calculation sub-module is configured to take a sum of a first coordinate component of the index coordinates of the marked point, a multiplication value of the physical distance and the horizontal coordinate difference as a horizontal coordinate in the physical coordinates of the marked point, and take a sum of a second coordinate component of the index coordinates of the marked point, a multiplication value of the physical distance and the vertical coordinate difference as a vertical coordinate in the physical coordinates of the marked point.
[0213] Embodiments of the present application further provide a calibration board, which can be generated based on the calibration board generation method of any of the above embodiments.
[0214] Embodiments of the present application further provide an electronic device, such as a camera, as shown in the accompanying drawings, comprising: Figure 12
[0215] The memory 1201 is configured to store a computer program.
[0216] The processor 1202 is configured to execute the program stored in the memory 1201 to implement the calibration board generation method steps or the camera calibration method steps of any of the above embodiments.
[0217] The electronic device can further include a communication bus and / or a communication interface, and the processor 1202, the communication interface and the memory 1201 can communicate with each other through the communication bus.
[0218] It can be seen that in the scheme provided by the embodiments of the present application, the electronic device can determine the size of the calibration board and the calibration board area corresponding to each to-be-calibrated camera based on the shooting ranges of the plurality of to-be-calibrated cameras; for each calibration board area, the size of the unit cell included in the calibration board area is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board area and the number of marker points required for camera calibration, wherein the marker points are the corner points of the unit cell; the encoding pattern corresponding to the marker point is determined based on the physical coordinates of the marker point, wherein the encoding pattern is used to record the physical coordinates; and the calibration board corresponding to the plurality of to-be-calibrated cameras is generated according to the size of the calibration board, the calibration board area, the size of the unit cell, and the encoding pattern. Since the size of the calibration board and the calibration board area corresponding to each to-be-calibrated camera are determined based on the shooting ranges of the plurality of to-be-calibrated cameras, and the size of the unit cell included in the calibration board area is determined based on the focal length of the to-be-calibrated camera corresponding to the calibration board area and the number of marker points required for camera calibration, when calibrating the to-be-calibrated cameras, the number of marker points included in the calibration board image shot by each to-be-calibrated camera can meet the requirements of camera calibration, the encoding pattern can be accurately decoded, and thus the accuracy of the mapping relationship between the image coordinate system and the physical coordinate system can be improved, and the accuracy of multi-camera calibration can be improved and the calibration of a multi-camera system with large imaging field of view difference can be implemented.
[0219] Alternatively, the electronic device can acquire a calibration board image captured by each to-be-calibrated camera for a calibration board region corresponding to the to-be-calibrated camera in the calibration board, where the calibration board includes a plurality of calibration board regions, the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera are determined based on the shooting range of the to-be-calibrated camera, and the size of each calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, the marker points being corner points of the unit cells; for each calibration board image, the image coordinates of each marker point in the calibration board image are extracted; each coded pattern in the calibration board image is decoded to determine the physical coordinates of each marker point in the calibration board image; and for each to-be-calibrated camera, the mapping relationship between the image coordinate system and the physical coordinate system corresponding to the to-be-calibrated camera is calculated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. Since the size of the calibration board and the calibration board region corresponding to each to-be-calibrated camera can be determined based on the shooting range of the to-be-calibrated camera, and the size of each calibration board region is determined according to the focal length of the to-be-calibrated camera corresponding to the calibration board region and the number of marker points required for camera calibration, the electronic device can accurately decode each calibration board image, determine the physical coordinates of each marker point, extract the image coordinates of each marker point in the calibration board image, and then calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each to-be-calibrated camera based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the to-be-calibrated camera. In this way, the accuracy of multi-camera calibration can be improved, and the calibration of a multi-camera system with large imaging field of view difference can be implemented.
[0220] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0221] The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0222] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0223] The processor described above can be a general processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0224] In another embodiment provided by the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above-mentioned calibration board generation method or camera calibration method.
[0225] In another embodiment provided by the present application, a computer program product containing instructions is provided, and when the computer program product is executed on a computer, the computer is caused to execute any of the above-mentioned calibration board generation method or camera calibration method.
[0226] In the above-mentioned embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a Solid State Disk (SSD) and the like.
[0227] It is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0228] Various embodiments are described herein with reference to particular applications. Those of ordinary skill in the art will understand that the embodiments described are merely illustrative of the principles of the present application and that various modifications can be implemented without departing from the spirit of the application. For example, the principles of the present application can be applied to other types of devices, systems, and methods. Moreover, while the present application has been described with reference to particular means, materials, and embodiments, the present application is not intended to be limited to the particulars disclosed; rather, the present application extends to all functionally equivalent structures, methods, and uses such as are within the scope of the appended claims. Those skilled in the relevant art will also recognize the interchangeability of means, materials, and actions and the various functions performed by them. Any delays associated with the present application are minimal and do not significantly affect the overall operation of the device, system, or method.
[0229] The preferred embodiments of the present application are described above in detail with reference to specific illustrative applications, in which various embodiments of the application are described. Although the application has been described with reference to these preferred embodiments, it will be understood by those skilled in the art that various changes in form and details can be made therein without departing from the spirit and scope of the application. Therefore, the present application should not be limited by the preferred embodiments described above, but should be given the full scope defined by the appended claims.
Claims
1. A calibration plate generation method characterized by, The method comprises: determining the size of the calibration board and the calibration board region corresponding to each camera to be calibrated based on the shooting range of the plurality of cameras to be calibrated; for each calibration board region, determining the length and width of the unit cell included in the calibration board region according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration, wherein the marker points are the corner points of the unit cell, and the unit cell is a rectangle; determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point, wherein the encoding pattern is used to record the physical coordinates; generating a calibration board comprising a plurality of unit cells according to the size of the calibration board, the calibration board region, and the length and width of the unit cell corresponding to each calibration board region; filling the encoding pattern into the unit cell to which the marker point belongs.
2. The method of claim 1, wherein, The number of marker points photographed by the camera to be calibrated when the camera to be calibrated shoots the calibration board region corresponding to the camera to be calibrated is not less than the number of marker points required for camera calibration, and the size of the encoding pattern placed in the unit cell satisfies the decoding condition.
3. The method of claim 1, wherein, The step of determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point comprises: determining the physical coordinates of the marker point in the calibration board; encoding according to the physical coordinates of the marker point in the calibration board to obtain the encoding pattern.
4. The method of claim 1, wherein, The step of determining the encoding pattern corresponding to the marker point based on the physical coordinates of the marker point comprises: determining the index coordinates of the marker point in the calibration board region to which the marker point belongs, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region; encoding according to the index coordinates and the physical distance between adjacent marker points included in the calibration board region to obtain the encoding pattern.
5. A camera calibration method characterized by, The method comprises: obtaining the calibration board image photographed by each camera to be calibrated for the calibration board region corresponding to the camera to be calibrated in the calibration board, wherein the calibration board comprises a plurality of calibration board regions, the calibration board is generated according to the size of the calibration board, the calibration board region, and the length and width of the unit cell corresponding to each calibration board region, the unit cell is a rectangle, the size of the calibration board and the calibration board region corresponding to each camera to be calibrated is determined based on the shooting range of the camera to be calibrated, the length and width of the unit cell included in each calibration board region is determined according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration, and the unit cell is filled with the encoding pattern corresponding to the included marker points, and the marker points are the corner points of the unit cell; for each calibration board image, extracting the image coordinates of each marker point in the calibration board image; decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image; For each camera to be calibrated, a mapping relationship between an image coordinate system corresponding to the camera to be calibrated and a physical coordinate system is calculated based on image coordinates and physical coordinates of a plurality of marker points included in a corresponding calibration board image of the camera to be calibrated.
6. The method of claim 5, wherein, The encoding pattern is encoded according to the physical coordinates of the marker points in the calibration board. The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises:
7. The method of claim 5, wherein, The encoding pattern is encoded according to the index coordinates of the marker points in the calibration board region to which the marker points belong and the physical spacing between adjacent marker points included in the calibration board region, a first coordinate component of the index coordinates being used to identify a row number of the marker points in the calibration board region, and a second coordinate component of the index coordinates being used to identify a column number of the marker points in the calibration board region. The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises:
8. A calibration plate generation apparatus characterized by comprising: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The step of decoding each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image comprises: The apparatus comprises: A calibration board size and region determination module configured to determine a size of a calibration board and a calibration board region corresponding to each camera to be calibrated based on a shooting range of the plurality of cameras to be calibrated; A cell size determination module configured to determine a cell size included in each calibration board region based on a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marker points required for camera calibration, wherein the marker points are corner points of the cell; An encoding pattern determination module configured to determine an encoding pattern corresponding to the marker points based on physical coordinates of the marker points, wherein the encoding pattern is used to record the physical coordinates; A calibration board generation module configured to generate a calibration board corresponding to the plurality of cameras to be calibrated based on the size of the calibration board, the calibration board region, the cell size, and the encoding pattern; The cell size determination module comprises: A side length determination submodule configured to determine a length and a width of a cell included in each calibration board region based on a focal length of a camera to be calibrated corresponding to the calibration board region and a number of marker points required for camera calibration, wherein the cell is a rectangle; The calibration board generation module comprises: A calibration board generation submodule is configured to generate a calibration board comprising a plurality of cells according to the size of the calibration board, the calibration board regions, and the length and width of each cell corresponding to a calibration board region; A cell filling submodule is configured to fill the encoding pattern into the cell to which the marker point belongs.
9. The apparatus of claim 8, wherein, The number of marker points photographed by the camera to be calibrated when the camera to be calibrated photographs the calibration board region corresponding to the camera to be calibrated is not less than the number of marker points required for camera calibration, and the size of the encoding pattern placed in the cell satisfies the decoding condition; The encoding pattern determination module comprises: A physical coordinate determination submodule is configured to determine the physical coordinates of the marker points in the calibration board; A first encoding pattern acquisition submodule is configured to encode according to the physical coordinates of the marker points in the calibration board to obtain an encoding pattern; The encoding pattern determination module comprises: An index coordinate determination submodule is configured to determine the index coordinates of the marker points in the calibration board region to which the marker points belong, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region; A second encoding pattern acquisition submodule is configured to encode according to the index coordinates and the physical distance between adjacent marker points included in the calibration board region to obtain an encoding pattern.
10. A camera calibration apparatus characterized by comprising: The apparatus comprises: A calibration board image acquisition module is configured to acquire a calibration board image photographed by each camera to be calibrated for a calibration board region corresponding to the camera to be calibrated in a calibration board, wherein the calibration board comprises a plurality of calibration board regions, the calibration board is generated according to the size of the calibration board, the calibration board regions, and the length and width of each cell corresponding to a calibration board region, the cell is a rectangle, the size of the calibration board and the calibration board region corresponding to each camera to be calibrated is determined based on the photographing range of the camera to be calibrated, the length and width of the cell included in each calibration board region is determined according to the focal length of the camera to be calibrated corresponding to the calibration board region and the number of marker points required for camera calibration, the cell is filled with an encoding pattern corresponding to the included marker points, and the marker point is a corner point of the cell; An image coordinate extraction module is configured to extract the image coordinates of each marker point in each calibration board image; A physical coordinate determination module is configured to decode each encoding pattern in the calibration board image to determine the physical coordinates of each marker point in the calibration board image; A mapping relationship calculation module is configured to calculate the mapping relationship between the image coordinate system and the physical coordinate system corresponding to each camera to be calibrated based on the image coordinates and the physical coordinates of the plurality of marker points included in the calibration board image corresponding to the camera to be calibrated.
11. The apparatus of claim 10, wherein, The encoding pattern is encoded according to the physical coordinates of the marker points in the calibration board; The physical coordinate determination module comprises: The physical coordinate acquisition submodule is configured to decode each coded pattern in the calibration board image to obtain the physical coordinates of the marker point corresponding to each coded pattern in the calibration board. The coded pattern is encoded according to the index coordinates of the marker point in the calibration board region to which the marker point belongs and the physical spacing between adjacent marker points included in the calibration board region, wherein the first coordinate component of the index coordinates is used to identify the row number of the marker point in the plurality of marker points included in the calibration board region, and the second coordinate component of the index coordinates is used to identify the column number of the marker point in the plurality of marker points included in the calibration board region. The physical coordinate determination module comprises: The decoding submodule is configured to decode each coded pattern in the calibration board image to obtain the index coordinates of the marker point corresponding to the coded pattern in the calibration board region to which the marker point belongs and the physical spacing between adjacent marker points included in the calibration board region. The origin difference calculation submodule is configured to calculate the horizontal coordinate difference and the vertical coordinate difference between the coordinate origin of the region coordinate system of the calibration board region corresponding to the calibration board image and the coordinate origin of the calibration board coordinate system. The physical coordinate calculation submodule is configured to take the sum of the first coordinate component of the index coordinates of the marker point, the multiplication of the physical spacing and the horizontal coordinate difference as the horizontal coordinate of the physical coordinates of the marker point, and take the sum of the second coordinate component of the index coordinates of the marker point, the multiplication of the physical spacing and the vertical coordinate difference as the vertical coordinate of the physical coordinates of the marker point.
12. A calibration plate characterized by The calibration board is generated based on the method of any one of claims 1-4.
13. An electronic device, comprising: It comprises: The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the method of any one of claims 1-4 or 5-7.
14. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method of any one of claims 1-4 or 5-7.
Citation Information
Patent Citations
Multi-camera calibration method
CN107862717A
Camera external parameter calibration method and device, electronic equipment and storage medium
CN114187367A