Camera calibration method and calibration device
By using the central area of the test grid image as the central corner point in camera calibration and gradually determining other corner points, the complexity of the camera calibration process is solved, and both accuracy and convenience are improved.
Patent Information
- Application Number
- CN202210047555.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-01-17
AI Technical Summary
After prolonged use, existing cameras suffer from reduced internal assembly precision, making calibration complex and inconvenient, requiring disassembly and reassembly.
By using the central region of the test grid image as the central corner point, other corner points are gradually determined through involute positioning trajectories, thereby increasing the probability of corner point acquisition, simplifying the calibration process, and improving accuracy.
It simplifies the camera calibration process, improves calibration accuracy and convenience, and ensures accurate positioning of camera corner points.
Smart Images

Figure CN114296313B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cameras, and in particular to a camera calibration method and a camera calibration device. Background Art
[0002] With the development of technology, cameras are assembled based on internal mechanical assembly and their accuracy is adjusted. When the camera is used for a long time, the accuracy of the camera will gradually decrease due to the internal assembly. In the prior art, when the camera needs to be calibrated, the operator needs to disassemble the camera and reassemble the camera, which makes the camera calibration process more complicated. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a camera calibration method and a calibration device, taking the corner point of the central area of the test grid image as the central corner point, and gradually extending outward with the involute positioning trajectory to gradually determine other corner points, thereby improving the probability of the camera determining the corner point and ensuring the acquisition of the camera's corner points, thereby ensuring that the camera calibrates the camera at the current working parameters based on the central corner point and other corner points, improving the accuracy and convenience of the camera calibration, and simplifying the camera calibration process.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a camera calibration method, including: obtaining current working parameters of the camera, and obtaining a test grid image based on the current working parameters; traversing the test grid image, and preliminarily locating the central area of the test grid image; taking the corner point of the central area of the test grid image as the central corner point, and extending outward in a spiral direction based on the central corner point to form an involute positioning trajectory; determining other corner points based on the involute positioning trajectory; updating the positioning point of the camera according to the other corner points, and calibrating the camera.
[0005] In addition, an embodiment of the present invention also provides a camera calibration device, which includes: an acquisition module: used to acquire the current working parameters of the camera, and acquire a test grid image based on the current working parameters; a traversal module: used to traverse the test grid image, and preliminarily locate the central area of the test grid image; a formation module: used to take the corner point of the central area of the test grid image as the central corner point, and extend outward in a spiral direction based on the central corner point, and form an involute positioning trajectory; a determination module: used to determine other corner points based on the involute positioning trajectory; an update module: used to update the positioning point of the camera according to the other corner points, and calibrate the camera.
[0006] In an embodiment of the present invention, through the method in the embodiment of the present invention, the current working parameters of the camera are obtained, and a test grid image is obtained based on the current working parameters; the test grid image is traversed, and the central area of the test grid image is preliminarily located; the corner point of the central area of the test grid image is used as the central corner point, and based on the central corner point, it is extended outward in a spiral direction to form an involute positioning trajectory; other corner points are determined based on the involute positioning trajectory; the positioning point of the camera is updated according to the other corner points, and the camera is calibrated, wherein the corner point of the central area of the test grid image is used as the central corner point, and the involute positioning trajectory is gradually extended outward to gradually determine other corner points, thereby improving the probability of the camera determining the corner point, ensuring the acquisition of the camera's corner points, thereby ensuring that the camera calibrates the camera at the current working parameters based on the central corner point and other corner points, improving the accuracy and convenience of the camera calibration, and simplifying the camera calibration process. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0008] Figure 1 is a stereoscopic diagram of a test fixture for a camera in an embodiment of the present invention;
[0009] Figure 2 is an internal schematic diagram of a test fixture for a camera in an embodiment of the present invention;
[0010] Figure 3 is a stereoscopic diagram of a test fixture for a camera in another embodiment of the present invention;
[0011] Figure 4 is a schematic diagram of a black and white chessboard of a test fixture for a camera in an embodiment of the present invention;
[0012] Figure 5 is a schematic flow chart of a camera calibration method in an embodiment of the present invention;
[0013] Figure 6 is a test chart of the camera calibration method in an embodiment of the present invention;
[0014] Figure 7 is another test chart of the camera calibration method in the embodiment of the present invention;
[0015] Figure 8is a schematic diagram of the structure of a camera calibration device in an embodiment of the present invention;
[0016] Fig. 9 The figure is a hardware diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Embodiment 1
[0019] This embodiment provides a test fixture for testing a camera, referring to Figure 1-Figure 4 The camera is installed in a test fixture for testing the camera. The test fixture for testing the camera includes a fixing seat 10, a test assembly 20 and a mounting plate 30. The fixing seat 10 is used to be installed on the ground, a wall or a flat plate. The mounting plate 30 is arranged on one side of the fixing seat 10. The mounting plate 30 is provided with a mounting hole 31. The camera is installed through the mounting hole 31, so as to achieve the fixation of the camera relative to the test fixture. The test assembly 20 is arranged between the fixing seat 10 and the mounting plate 30. The test assembly 20 is formed by a plurality of test plates. The inner wall of each test plate is provided with a black and white checkerboard, as shown below Figure 4 The following are schematic diagrams of the black and white checkerboards on the inner wall of each test plate.
[0020] Optionally, there are five test boards 21, and the five test boards 21 correspond to five black and white checkerboards. The angles and sizes between the five black and white checkerboards need to be adjusted according to the field of view coverage, the accuracy of corner point recognition, the depth of field of the camera, and the accuracy and stability of the internal parameter calibration algorithm.
[0021] In another embodiment, the test fixture for testing the camera also has an expansion plate 40, which is arranged between the test component 20 and the mounting plate 30 and is used to adjust the position of the mounting plate 30 to facilitate adjustment of the position of the camera relative to the test component 20, thereby ensuring the calibration accuracy of the camera.
[0022] Two adjacent test boards 21 are connected to each other, and there is an angle between the two adjacent test boards 21. The inner wall of each test board 21 has a test area where black grids and white grids are staggered, and the camera traverses the corner points through the black grids and white grids on the test board 21, so as to extend outward in a spiral direction based on the central corner point and form an involute positioning track.
[0023] The camera is installed in the installation hole 31 and faces the inner wall of the test assembly 20, so that the shooting range of the camera is in the test area on the test board 21, and the camera is calibrated based on the test area. The camera is tested relative to the test fixture based on the current working parameters, and the current working parameters include the original parameters of the camera and the parameters of the test fixture. The parameters of the test fixture include the angle between the side test board 21 and the bottom test board 21, the angle between adjacent test boards 21, and the side length of each grid in the black and white checkerboard grid on the inner wall of the test board 21.
[0024] Embodiment 2
[0025] See also Figures 5 to 7 , a camera calibration method, the method comprising:
[0026] S11: Acquire current working parameters of the camera, and acquire a test grid image based on the current working parameters;
[0027] In the specific implementation process of the present invention, the specific steps may be: the test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area; the test area covers the viewing angle of the camera, and the plurality of black and white checkerboards are distributed in different directions of the viewing angle of the camera.
[0028] Wherein, the adjustment is made based on the camera in the current working parameters, and the test grid image is used as the calibration image. In the test grid image, a plurality of adjacent black and white checkerboards enclose a test area; the test area covers the viewing angle of the camera, so as to facilitate the calibration of each angle of the camera one by one, and a plurality of black and white checkerboards are distributed in different directions of the viewing angle of the camera. The current working parameters include the position of the camera relative to each chart and the initial internal parameters of the camera, and may also include the original parameters of the camera and the parameters of the test fixture. The parameters of the test fixture include the angle between the side test board 21 and the bottom test board 21, the angle between adjacent test boards 21, and the side length of each grid in the black and white checkerboard on the inner wall of the test board 21.
[0029] In addition, there is an angle between two adjacent black and white chessboards and they are facing the camera. The two adjacent black and white chessboards are arranged obliquely and cover different directions of the camera. The obliquely arranged black and white chessboards can ensure that the camera can perform viewing angle testing within a certain test range and ensure the test accuracy of the test grid image, thereby improving the calibration accuracy of the camera.
[0030] The other black and white checkerboards extend in different directions with the edge of the black and white checkerboard facing the camera and are connected to each other, wherein the other black and white checkerboards gradually expand along their extension direction. At this time, the edges of the other black and white checkerboards expand outward along the corresponding direction with the edge of the black and white checkerboard facing the camera as the center, and ensure that the other black and white checkerboards are connected to each other, gradually covering the calibration direction and calibration area of the camera.
[0031] Alternatively, the test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area, and further includes: each of the black and white checkerboards has a black grid and a white grid, and the black grid and the white grid together fill the surface area of the black and white checkerboards, and are arranged alternately in sequence; the shape of the black grid and the shape of the white grid can be rectangular or irregular, which is not limited here. Wherein, a corresponding edge is formed between the black grid and the white grid, and the edge is used as one of the traversal tracks.
[0032] S12: traversing the test grid image and preliminarily locating the central area of the test grid image;
[0033] In the specific implementation process of the present invention, the specific steps may be: first traverse the black and white chessboard in the test grid image that is directly opposite to the camera along the viewing angle of the camera; preliminarily locate the central area of the black and white chessboard, and use the central area of the black and white chessboard as a reference starting point; traverse outward along the reference starting point based on the mask, and obtain the corner points of the black and white chessboard to determine the target corner point; traverse the other black and white chessboards along the viewing angle of the camera based on the mask, and traverse them in a circular direction in sequence; repeat the above steps for each black and white chessboard to determine the target corner points of the other black and white chessboards.
[0034] The center area of the black and white chessboard is used as a reference starting point, and the reference starting point is traversed outward to obtain each corner point of the black and white chessboard to determine the target corner point. The target corner point is determined at each corner point based on the traversal of the edge. The target corner point is used as the traversal end point of a single black and white chessboard and as a calibration point for camera calibration. The shape of the mask can be rectangular or irregular. When the shape of the mask is irregular, the camera can effectively distinguish the target corner point from other corner points when traversing the edge.
[0035] In addition, based on the mask, traverse the other black and white checkerboards along the camera's viewing angle, and traverse in a circular direction in sequence; for each black and white checkerboard, traverse outward along the center area of each black and white checkerboard in sequence, and obtain the corner points of the black and white checkerboard to determine the target corner point; combine the target corner points in different directions to preliminarily calibrate the viewing angle positioning of the camera in different directions. By first identifying the corner points in the center area of the camera, using the difference between the coordinates of the identified corner points and the theoretical coordinates, correct the theoretical coordinates of the corner points to be identified, and then identify the corner points on the special-shaped mask of the theoretical coordinates, so that the theoretical coordinates of all corner points are gradually generated from the center area according to the trajectory of the "involute", and the corner points are accurately found near the theoretical coordinates of the corner points.
[0036] S13: taking a corner point of a central area of the test grid image as a central corner point, and extending outward in a spiral direction based on the central corner point to form an involute positioning track;
[0037] In the specific implementation process of the present invention, the specific steps may be: determining the corner point of the central area of the test grid image as the central corner point; using the central corner point as the starting point of outward traversal, extending outward along the edges of each black and white checkerboard in the test grid image based on the mask, wherein the center corner point is extended outward in a spiral direction to form an involute positioning trajectory.
[0038] Among them, taking the central corner point as the starting point of outward traversal, based on the mask, extending outward along the edges of each black and white checkerboard in the test grid image, a traversal trajectory extending outward in a spiral direction with the central corner point as the center is formed, and the trajectory is defined as an involute positioning trajectory, and each corner point is gradually traversed through the involute positioning trajectory, and the accuracy of identifying the edges of the black grid or the white grid is improved, and each corner point is covered.
[0039] S14: Determine other corner points based on the involute positioning trajectory;
[0040] In the specific implementation process of the present invention, the specific steps may be: based on the mask, gradually traverse the edges of each grid along the involute positioning trajectory, and determine the corresponding corner point position, wherein the surrounding area of the corresponding position is detected based on the traversal trajectory, and if there are multiple alternating black and white areas in the surrounding area, the position is determined to be the corner point position.
[0041] Among them, the surrounding area of the corresponding position is detected based on the traversal trajectory. If there are multiple black and white alternating areas in the surrounding area, the position is determined to be the corner point position, ensuring the recognition accuracy of the corner point position. In addition, at the theoretical coordinates of the corner point to be identified, the corner point to be identified is made to be within the mask to the greatest extent possible, while the adjacent corner points are outside the mask, to prevent the adjacent corner points from being mistakenly identified.
[0042] In the specific implementation process of the present invention, the specific steps include: determining the arrangement of the other corner points based on the position of the corner point, and forming a reference positioning point; updating the positioning point of the camera based on the reference positioning point, wherein the positioning point of the camera at the current working parameters will be replaced by the reference positioning point to form a new positioning point; if the reference positioning point meets the target reference point, determining the calibration range of the camera, and calibrating the camera.
[0043] In an embodiment of the present invention, through the method in the embodiment of the present invention, the current working parameters of the camera are obtained, and a test grid image is obtained based on the current working parameters; the test grid image is traversed, and the central area of the test grid image is preliminarily located; the corner point of the central area of the test grid image is used as the central corner point, and based on the central corner point, it is extended outward in a spiral direction to form an involute positioning trajectory; other corner points are determined based on the involute positioning trajectory; the positioning point of the camera is updated according to the other corner points, and the camera is calibrated, wherein the corner point of the central area of the test grid image is used as the central corner point, and the involute positioning trajectory is gradually extended outward to gradually determine other corner points, thereby improving the probability of the camera determining the corner point, ensuring the acquisition of the camera's corner points, thereby ensuring that the camera calibrates the camera at the current working parameters based on the central corner point and other corner points, improving the accuracy and convenience of the camera calibration, and simplifying the camera calibration process.
[0044] Embodiment 3
[0045] See also Figure 8 , a camera calibration device, the camera calibration device comprising:
[0046] Acquisition module 21: used to acquire current working parameters of the camera, and acquire a test grid image based on the current working parameters;
[0047] A traversal module 22 is used to traverse the test grid image and preliminarily locate the central area of the test grid image;
[0048] Forming module 23: used for taking the corner point of the central area of the test grid image as the central corner point, and extending outward in a spiral direction based on the central corner point to form an involute positioning track;
[0049] Determination module 24: used to determine other corner points based on the involute positioning trajectory;
[0050] Update module 25: used for updating the positioning points of the camera according to the other corner points and calibrating the camera.
[0051] Example
[0052] See also Fig. 9 , refer to the following Fig. 9 The electronic device 40 according to this embodiment of the present invention will be described. Fig. 9 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0053] like Fig. 9 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: at least one processing unit 41, at least one storage unit 42, and a bus 43 connecting different system components (including the storage unit 42 and the processing unit 41).
[0054] The storage unit stores program codes, which can be executed by the processing unit 41, so that the processing unit 41 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.
[0055] The storage unit 42 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 421 and / or a cache memory unit 422 , and may further include a read-only memory unit (ROM) 423 .
[0056] The storage unit 42 may also include a program / utility 424 having a set (at least one) of program modules 425, such program modules 425 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0057] Bus 43 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0058] The electronic device 40 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 40, and / or any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 45. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 46. Fig. 9As shown, the network adapter 46 communicates with other modules of the electronic device 40 via the bus 43. It should be understood that although Fig. 9 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0059] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0060] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. In addition, it stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the above method.
[0061] In addition, the camera calibration method and calibration device provided in the embodiments of the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A camera calibration method, characterized in that: include: Acquire current working parameters of the camera, and acquire a test grid image based on the current working parameters; The test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area; The test area covers the viewing angle of the camera, and the plurality of black and white checkerboards are distributed in different directions of the viewing angle of the camera; there is an angle between two adjacent black and white checkerboards, and they face the camera, and are arranged obliquely between two adjacent black and white checkerboards; Traversing the test grid image and preliminarily locating the center area of the test grid image; first traversing the black and white checkerboard directly facing the camera in the test grid image along the viewing angle of the camera; preliminarily locating the center area of the black and white checkerboard, and using the center area of the black and white checkerboard as a reference starting point; Traversing outward along the reference starting point based on the mask and acquiring each corner point of the black and white chessboard to determine the target corner point; Based on the mask, traverse the other black and white checkerboards along the viewing angle of the camera, and traverse in a circular direction in sequence; repeat the above steps for each black and white checkerboard to determine the target corner points of the other black and white checkerboards; Preliminarily calibrating the viewing angle positioning of the camera in different directions in combination with the target corner points in different directions; Taking the corner point of the central area of the test grid image as the central corner point, and extending outward in a spiral direction based on the central corner point to form an involute positioning track; determining the corner point of the central area of the test grid image as the central corner point; taking the central corner point as the starting point of outward traversal, extending outward along the edges of each black and white checkerboard in the test grid image based on the mask, wherein extending outward in a spiral direction based on the central corner point to form an involute positioning track; Determining other corner points based on the involute positioning trajectory; The positioning point of the camera is updated according to the other corner points, and the camera is calibrated.
2. The camera calibration method according to claim 1, characterized in that: The test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area, including: There is an angle between two adjacent black and white chessboard squares, and they face the camera; The other black and white checkerboards extend in different directions with the edges of the black and white checkerboards facing the camera and are connected to each other, wherein the other black and white checkerboards gradually expand along the extension direction.
3. The camera calibration method according to claim 2, characterized in that: The test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area, further comprising: Each of the black and white checkerboards has a black grid and a white grid, and the black grid and the white grid together fill the surface area of the black and white checkerboard and are arranged alternately in sequence.
4. The camera calibration method according to claim 1, characterized in that: The determining of other corner points based on the involute positioning trajectory comprises: Based on the mask, the edges of each grid are gradually traversed along the involute positioning trajectory, and the corresponding corner point position is determined, wherein the surrounding area of the corresponding position is detected based on the traversal trajectory. If there are multiple black and white alternating areas in the surrounding area, the position is determined to be the corner point position.
5. The camera calibration method according to claim 4, characterized in that: The updating of the positioning point of the camera according to the other corner points and calibrating the camera includes: Determine the arrangement of the other corner points based on the corner point positions, and form reference positioning points; Updating the positioning point of the camera based on the reference positioning point, wherein the positioning point of the camera at the current working parameter will be replaced by the reference positioning point to form a new positioning point; If the reference positioning point satisfies the target reference point, the calibration range of the camera is determined, and the camera is calibrated.
6. A camera calibration device, characterized in that: The camera calibration device comprises: Acquisition module: used to acquire the current working parameters of the camera, and acquire a test grid image based on the current working parameters; the test grid image is a plurality of adjacent black and white checkerboards, and the plurality of adjacent black and white checkerboards enclose a test area; the test area covers the viewing angle of the camera, and the plurality of black and white checkerboards are distributed in different directions of the viewing angle of the camera; there is an angle between two adjacent black and white checkerboards, and they face the camera, and the two adjacent black and white checkerboards are arranged obliquely; Traversal module: used to traverse the test grid image and preliminarily locate the center area of the test grid image; first traverse the black and white chessboard directly opposite to the camera in the test grid image along the viewing angle of the camera; preliminarily locate the center area of the black and white chessboard, and use the center area of the black and white chessboard as the reference starting point; traverse outward along the reference starting point based on the mask, and obtain each corner point of the black and white chessboard to determine the target corner point; traverse the other black and white chessboards along the viewing angle of the camera based on the mask, and traverse in a circular direction in sequence; repeat the above steps for each black and white chessboard to determine the target corner points of the other black and white chessboards; preliminarily calibrate the viewing angle positioning of the camera in different directions in combination with the target corner points in different directions; A forming module: used for taking the corner point of the central area of the test grid image as the central corner point, and extending outward in a spiral direction based on the central corner point to form an involute positioning track; determining the corner point of the central area of the test grid image as the central corner point; taking the central corner point as the starting point of outward traversal, extending outward along the edges of each black and white checkerboard in the test grid image based on the mask, wherein the central corner point is extended outward in a spiral direction to form an involute positioning track; Determination module: used for determining other corner points based on the involute positioning trajectory; Update module: used to update the positioning point of the camera according to the other corner points and calibrate the camera.
