Camera calibration method, device and system and storage medium

By identifying and decoding the arrangement order and encoding of multiple logo graphics, the problem in the existing technology that camera calibration requires shooting the entire calibration plate is solved, achieving higher robustness and accuracy.

CN118628580APending Publication Date: 2024-09-10SHENZHEN ORBBEC CO LTD

Patent Information

Application Number
CN202410719133.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing camera calibration methods require photographing the entire calibration plate, which limits the direction and field of view of the calibration plate, affecting the accuracy and robustness of camera parameters.

Method used

Using multiple logo graphics that are not identical, the camera parameters are obtained by identifying and decoding the arrangement sequence and coding of the logo graphics, allowing camera calibration without limiting the direction of the calibration plate and the field of view.

Benefits of technology

It improves the robustness and accuracy of camera calibration, simplifies the calibration process, and reduces the requirements for the direction and field of view of the calibration plate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628580A
    Figure CN118628580A
Patent Text Reader

Abstract

The invention discloses a camera calibration method, device and system and a storage medium, and the method comprises the steps: obtaining a calibration plate image obtained by photographing at least part of the region of a calibration plate through a camera, the calibration plate image comprises a plurality of first mark patterns and a plurality of second mark patterns, and the center points of the plurality of first mark patterns are sequentially connected to form an asymmetric polygon; identifying the arrangement sequence of the plurality of first sign graphs to obtain codes of the first sign graphs and the second sign graphs, and obtaining image coordinates and world coordinates of the first sign graphs and the second sign graphs according to the codes of the first sign graphs and the second sign graphs; and calibrating parameters of the camera by using the world coordinates and the image coordinates of the plurality of first mark graphs and / or the second mark graphs. According to the method and the device, the camera parameters can be determined according to the shot calibration plate image without limiting the direction of the calibration plate and shooting the whole area of the calibration plate, so that the robustness of camera calibration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Depth cameras, color cameras, infrared cameras and other cameras need to have their internal and external parameters calibrated before leaving the factory and during daily use, which is very important for the accuracy of the camera. The calibration plate is a common device used for camera calibration. Usually, the camera captures the calibration plate image, analyzes the known features in the calibration plate image, and calculates the camera's internal and external parameters. The calibration plate used is generally a checkerboard calibration plate. The calibration plate image captured during camera calibration must contain the entire checkerboard. Summary of the invention

[0003] The present application provides a camera calibration method, apparatus, device, system and storage medium, which can solve the problem that the entire calibration plate must be photographed during camera calibration and improve the robustness of camera calibration.

[0004] In a first aspect, a camera calibration method is provided, which is applied to a calibration system including a calibration plate and a host, wherein n first marker graphics and m second marker graphics that are not completely the same are provided on the calibration plate, and the center points of the n first marker graphics are connected to form an asymmetric polygon, comprising: obtaining a calibration plate image obtained by photographing at least a part of the calibration plate by a camera, wherein the calibration plate image comprises n first marker graphics and s second marker graphics, s≤m; identifying the n first marker graphics and the m second marker graphics in the calibration plate image, obtaining an arrangement order of the n first marker graphics according to the coordinates of the n first marker graphics, and decoding the calibration plate image using the arrangement order to obtain a first code corresponding to the n first marker graphics and a second code corresponding to the s second marker graphics; obtaining the world coordinates of each first marker graphic on the calibration plate and the image coordinates in the calibration plate image according to the first code of each first marker graphic, and obtaining the world coordinates of each second marker graphic on the calibration plate and the image coordinates in the calibration plate image according to the second code of each second marker graphic; calibrating the camera using the world coordinates and image coordinates of multiple first marker graphics and / or multiple second marker graphics on the calibration plate to obtain camera parameters.

[0005] In the present application, a calibration plate image is obtained by capturing at least a portion of the calibration plate with a camera. Since the first mark pattern and the second mark pattern in the calibration plate are different, and the center points of each of the n first mark patterns in the calibration plate are connected in sequence to form an asymmetric polygon, the first codes corresponding to the n first mark patterns and the second codes corresponding to the s second mark patterns can be obtained according to the arrangement of the n first mark patterns in the calibration plate image. Afterwards, the world coordinates of each first mark pattern on the calibration plate and the image coordinates in the calibration plate image can be obtained according to the first code of each first mark pattern, and the world coordinates of each second mark pattern on the calibration plate and the image coordinates in the calibration plate image can be obtained according to the second code of each second mark pattern. Finally, the parameters of the camera are calibrated according to the world coordinates and image coordinates of the multiple first mark patterns and / or multiple second mark patterns on the calibration plate. In the present application, the parameters of the camera can be determined according to the captured calibration plate image without limiting the direction of the calibration plate and without capturing the entire area of ​​the calibration plate, so that the robustness of the camera calibration can be improved.

[0006] In a second aspect, a camera calibration device is provided, the device comprising: a first acquisition module, used to acquire a calibration plate image obtained by photographing at least a portion of the calibration plate by a camera, wherein n first marker graphics and m second marker graphics that are not completely the same are arranged on the calibration plate, and the center points of the n first marker graphics are sequentially connected to form an asymmetric polygon, and the calibration plate image comprises n first marker graphics and s second marker graphics, s≤m; a decoding module, used to identify the n first marker graphics and the m second marker graphics in the calibration plate image, and to acquire the arrangement order of the n first marker graphics according to the coordinates of the n first marker graphics and to use the arrangement order to obtain the arrangement order of the n first marker graphics. The calibration plate image is decoded in sequence to obtain first codes corresponding to n first mark graphics and second codes corresponding to s second mark graphics; a second acquisition module is used to obtain the world coordinates of each first mark graphic on the calibration plate and the image coordinates in the calibration plate image according to the first code of each first mark graphic, and to obtain the world coordinates of each second mark graphic on the calibration plate and the image coordinates in the calibration plate image according to the second code of each second mark graphic; a calibration module is used to calibrate the camera using the world coordinates and image coordinates of multiple first mark graphics and / or multiple second mark graphics on the calibration plate to obtain camera parameters.

[0007] In a third aspect, a camera calibration device is provided. The camera calibration device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the camera calibration method described in the first aspect is implemented.

[0008] In a fourth aspect, a camera calibration system is provided, which includes a calibration board and a host; n first mark graphics and m second mark graphics are provided on the calibration board, and the center points of each of the n first mark graphics are connected in sequence to form an asymmetric polygon, and the first mark graphics are different from the second mark graphics; the host is used to execute the camera calibration method described in the first aspect above to obtain camera parameters.

[0009] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the camera calibration method described in the first aspect is implemented.

[0010] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the camera calibration method described in the first aspect.

[0011] It can be understood that the beneficial effects of the second, third, fourth, fifth and sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0013] Figure 1 is a schematic diagram of a camera calibration system provided in an embodiment of the present application;

[0014] Figure 2 is a schematic diagram of a calibration plate provided in an embodiment of the present application;

[0015] Figure 3 is a schematic diagram of another calibration plate provided in an embodiment of the present application;

[0016] Figure 4 is a schematic diagram of another calibration plate provided in an embodiment of the present application;

[0017] Figure 5 is a schematic diagram of another calibration plate provided in an embodiment of the present application;

[0018] Figure 6 is a schematic diagram of another calibration plate provided in an embodiment of the present application;

[0019] Figure 7 is a schematic diagram of another calibration plate provided in an embodiment of the present application;

[0020] Figure 8 is a flow chart of a camera calibration method provided in an embodiment of the present application;

[0021] Fig. 9 is a schematic diagram of a calibration plate image provided in an embodiment of the present application;

[0022] Fig.10 is a schematic diagram of another calibration plate image provided in an embodiment of the present application;

[0023] Fig.11 is a schematic diagram of another calibration plate image provided in an embodiment of the present application;

[0024] Fig.12 is a schematic diagram of another calibration plate image provided in an embodiment of the present application;

[0025] Fig.13 is a structural schematic diagram of a camera calibration device provided in an embodiment of the present application;

[0026] Fig.14 It is a structural schematic diagram of a camera calibration device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0028] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.

[0029] The phrases "one embodiment" or "some embodiments" described in the present application mean that the specific features, structures or characteristics described in the embodiments are included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in the differences in the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. In addition, the terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0030] Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are first described.

[0031] At present, when calibrating a camera, a video camera, a visual sensor, etc., a suitable calibration plate is first selected, and then the calibration plate image is captured by the camera. By analyzing the known features in the calibration plate image, the internal and external parameters of the camera are obtained. However, in the above method, when capturing the calibration plate, the direction of the calibration plate needs to be specified, many parameters need to be set, and the captured calibration plate image must include the entire calibration plate, which makes it impossible for the calibration plate to fill the entire field of view of the camera, which will have a certain impact on the fitting of the distortion coefficient.

[0032] To this end, an embodiment of the present application provides a camera calibration method, which can complete the accurate calibration of the shooting device without specifying the direction of the calibration plate and only photographing a partial area of ​​the calibration plate.

[0033] Figure 1 is a schematic diagram of a camera calibration system provided in an embodiment of the present application. Figure 1 The camera calibration system is used to calibrate the camera 100. The camera calibration system includes a calibration board 101 and a host 102. The camera 100 communicates with the host 102 through a wired connection or a wireless connection. The camera 100 is used to capture an image of the calibration board and send the captured image of the calibration board to the host 102. The host 102 is used to trigger the camera 100 to capture an image of at least a portion of the area on the calibration board 101 to obtain the calibration board image, and is also used to receive the calibration board image sent by the camera 100, and process the calibration board image according to the camera calibration method provided in one or more embodiments of the present application to complete the calibration of the camera 100 and obtain the parameters of the camera 100.

[0034] In the present application, the camera parameters include internal parameters and / or external parameters, the internal parameters include focal length, optical center, distortion coefficient, etc., and the external parameters include rotation matrix, translation vector, etc. of the camera. Furthermore, during the calibration process, the position and posture of the camera 100 and / or the calibration plate 101 can be adjusted so that the camera 100 captures different calibration plate images, and the camera 100 internal and external parameters are obtained by processing different calibration plate images according to the camera calibration method provided in one or more embodiments of the present application, thereby improving the accuracy of the camera parameters.

[0035] Figure 2 is a schematic diagram of a calibration plate provided in an embodiment of the present application. Figure 2 , n first mark patterns and m second mark patterns are provided on the calibration plate 101. The number n of first mark patterns and the number m of second mark patterns in the calibration plate 101 are preset, where n is an integer greater than 3, and m is an integer greater than or equal to 2. Figure 2 As shown, the number n of the first mark images is 4, and the number m of the second mark images is 206. In addition, the calibration plate 101 can be obtained by providing n first mark images and m second mark images on the substrate by etching, stickers, etc., which is not limited in the embodiment of the present application.

[0036] In some embodiments, the first logo graphic and the second logo graphic are not completely the same, including: the first logo graphic and the second logo graphic have different shapes, or the first logo graphic and the second logo graphic have the same shapes but different sizes. Wherein, when the first logo graphic and the second logo graphic have the same shapes, the size of the first logo graphic may be larger than the size of the second logo graphic, or may be smaller than the size of the second logo graphic.

[0037] For example, when the first logo graphic and the second logo graphic have the same shape, they can both be circular, such as Figure 2 As shown, the first logo graphic is Figure 2 The big circle in the middle, the second symbol is Figure 2 The small circles in the middle can also be squares, such as Figure 3 As shown, the first logo graphic is Figure 3 The second symbol is the large square in the Figure 3 When the shapes of the first logo graphic and the second logo graphic are different, such as Figure 4 As shown, the first logo graphic is Figure 4 The square in the middle, the second symbol is Figure 4 It should be noted that the shapes of the first logo graphic and the second logo graphic may also be other shapes such as a ring, and may also be a solid pattern or a hollow pattern, which is not limited in the present application.

[0038] In some embodiments, the center points of each of the n first mark patterns in the calibration plate 101 are connected in sequence to form an asymmetric polygon, and the distance between the first mark patterns of the asymmetric polygon makes it directional to clearly distinguish the relative positions of the first mark patterns. For example, if n is 4, Figure 2 , Figure 3 or Figure 4 As shown, the center points of each of the four first mark patterns are connected in sequence to form an asymmetric quadrilateral, such as a right-angled trapezoid.

[0039] In some embodiments, the m second mark patterns in the calibration plate 101 are arranged in multiple rows and columns, and the n first mark patterns are embedded in the m second mark patterns arranged in multiple rows and columns, forming a regular arrangement or a non-regular arrangement. Figure 2 , Figure 3 and Figure 4 As shown, the first mark pattern and the second mark pattern in the calibration plate 101 are arranged neatly, that is, the first mark pattern and the second mark pattern are arranged in the same row and column; Figure 5 As shown, the first mark pattern and the second mark pattern in the calibration plate 101 are arranged irregularly, that is, the first mark pattern and the second mark pattern are not arranged in the same row and column. Further, the mark pattern adjacent to any first mark pattern among the n first mark patterns can be the first mark pattern or the second mark pattern. When the number of rows and columns of the m second mark patterns increases, the interval between the n first mark patterns increases, and the present application does not limit this.

[0040] In one embodiment, the n first mark patterns are preferably arranged in the central area of ​​the calibration plate, so that the camera can also perform calibration by only shooting the central area of ​​the calibration plate. When the n first mark patterns are set in the central area of ​​the calibration plate, there are fewer restrictions on the size of the calibration plate and the camera acquisition field of view. Whether using a smaller calibration plate (such as a user calibration plate) or a larger calibration plate, or a camera with a small field of view (FOV) or a camera with a large FOV, calibration can be performed, making the calibration system of the present application more adaptable.

[0041] In one embodiment, each of the n first mark graphics and the m second mark graphics is uniformly encoded so that each mark graphic has a unique code to identify the mark graphic, which is used to indicate the position of the mark graphic in the calibration plate 101. Optionally, the encoding form of all the mark graphics (including the first mark graphics and the second mark graphics) in the calibration plate 101 is an ordered encoding, such as encoding all the mark graphics in the calibration plate 101 in ascending order from left to right or from top to bottom. Figure 6As shown, the code of the mark graphic in the 1st row and 1st column of the calibration plate 101 is set to 0, and the code is increased from left to right with a step size of 1, then the code of the mark graphic in the 1st row and 2nd column of the calibration plate 101 is 1, the code of the mark graphic in the 1st row and 3rd column of the calibration plate 101 is 2, and so on, until the code of the last mark graphic in the 15th row and 14th column of the calibration plate 101 is 209.

[0042] Furthermore, a first corresponding relationship is obtained by associating the code of any one of the mark graphics among all the mark graphics in the calibration plate 101 with the coordinates of the center point of the mark graphic in the calibration plate coordinate system (i.e., the world coordinate system where the calibration plate 101 is located). The first corresponding relationship can be pre-stored in the host 102 mentioned above, so that in the subsequent calibration process, the coordinates of the mark graphic can be obtained by decoding the mark graphic in the calibration plate to complete the calibration of the camera; wherein, the first mark graphic corresponds to the first code, and the second mark graphic has the second code.

[0043] It should be noted that the calibration plate coordinate system may be a coordinate system established with the center of the calibration plate 101 as the origin, the horizontal direction of the calibration plate 101 as the x-axis, the vertical direction of the calibration plate 101 as the y-axis, and the direction perpendicular to the calibration plate 101 as the z-axis. Alternatively, the calibration plate coordinate system may be a coordinate system established with the lower left corner of the calibration plate 101 as the origin, the horizontal direction of the calibration plate 101 as the x-axis, the vertical direction of the calibration plate 101 as the y-axis, and the direction perpendicular to the calibration plate 101 as the z-axis. Of course, the calibration plate coordinate system may also be a coordinate system established on the calibration plate 101 in other ways, and this application does not limit this.

[0044] Furthermore, considering that the center points of each of the n first mark patterns in the calibration plate 101 are connected in sequence to form an asymmetric polygon, and the formed polygon has directionality, the arrangement order of the n first mark patterns can also be determined according to the distance between each first mark pattern in the polygon to obtain the arrangement sequence number of the n first mark patterns, and the arrangement sequence number of the n first mark patterns is associated with the corresponding first code to obtain a second corresponding relationship, and the second corresponding relationship can be pre-stored in the host 102 described above. Figure 7As shown, the display direction of the calibration plate 101 is a preset direction. The calibration plate 101 includes four first mark graphics. According to the arrangement order of the first mark graphics, the arrangement number of the first mark graphics coded as 117 is set to 1, the arrangement number of the first mark graphics coded as 120 is set to 2, the arrangement number of the first mark graphics coded as 92 is set to 3, and the arrangement number of the first mark graphics coded as 90 is set to 4. In this way, the direction of the calibration plate can be located. When the calibration plate posture is changed in the subsequent calibration process, the arrangement order of the first mark graphics is kept unchanged to obtain the calibration plate image with the same or similar direction, and then the calibration of the camera internal and external parameters is completed using different calibration plate images.

[0045] It should be noted that the camera 100 in the present application can be a shooting device such as a depth camera, a color camera, an infrared camera, a video camera, a visual sensor, etc., and the host 102 can be a terminal (including but not limited to a computer, etc.) or a server, which is not limited in the present application.

[0046] Figure 8 1 is a flow chart of a camera calibration method provided in an embodiment of the present application. The method is applied to the above calibration system and is executed by the host 102 in the calibration system. The method includes the following steps:

[0047] Step 801: Obtain a calibration plate image obtained by photographing at least a partial area of ​​the calibration plate with a camera, wherein the calibration plate is provided with n first mark graphics and m second mark graphics that are not completely the same, and the center points of the n first mark graphics are connected in sequence to form an asymmetric polygon, and the calibration plate image contains n first mark graphics and s second mark graphics, s≤m.

[0048] In some embodiments, the calibration plate image may be an image obtained by capturing a partial area of ​​the calibration plate by the camera or an image obtained by capturing the entire area of ​​the calibration plate by the camera. When the camera captures only a partial area of ​​the calibration plate, the calibration plate may fill the entire acquisition field of view of the camera, which helps to fit the distortion coefficient of the camera and obtain accurate parameters.

[0049] Step 802: Identify n first marker graphics and m second marker graphics in the calibration plate image, obtain the arrangement order of the n first marker graphics according to the coordinates of the n first marker graphics, and use the arrangement order to decode the calibration plate image to obtain the first codes corresponding to the n first marker graphics and the second codes corresponding to the s second marker graphics.

[0050] Since the center points of each of the n first mark patterns in the calibration plate are connected in sequence to form an asymmetric polygon, the center points of each of the n first mark patterns in the calibration plate image are connected in sequence to form an asymmetric polygon.

[0051] In some embodiments, obtaining the arrangement order of n first mark graphics according to the coordinates of n first mark graphics and decoding the calibration plate image using the arrangement order to obtain first codes corresponding to the n first mark graphics and second codes corresponding to s second mark graphics include: obtaining the arrangement order of n first mark graphics in the calibration plate image according to the coordinates of the n first mark graphics, decoding the first mark graphics in the calibration plate image using the arrangement order of the n first mark graphics to obtain the first codes corresponding to the n first mark graphics; decoding the second mark graphics in the calibration plate image according to the relative positions of the s second mark graphics and the n first mark graphics and the first codes corresponding to the n first mark graphics to obtain the second codes corresponding to the s second mark graphics.

[0052] In view of the fact that in the above embodiment, the arrangement order of the n first mark graphics has been associated with the first codes corresponding to the n first mark graphics to obtain the second corresponding relationship, the first codes corresponding to the n first mark graphics can be determined based on the arrangement order of the n first mark graphics. Therefore, when the camera in the embodiment of the present application shoots the calibration plate, there is no need to limit the display direction of the calibration plate, thereby reducing the parameters that need to be set during calibration.

[0053] In some embodiments, identifying n first mark graphics in the calibration plate image includes: extracting the outlines of all graphics in the calibration plate image, identifying a graphic whose outline is a preset outline to obtain multiple mark graphics, and selecting n first mark graphics from the multiple mark graphics according to the size of each mark graphic. For example, the preset outline is set according to the shape of the first mark graphic. For example, when the shape of the first mark graphic is a circle / square / triangle, the preset outline is correspondingly set to a circle / square / triangle outline.

[0054] Step 803: Obtain the world coordinates of each first mark graphic on the calibration plate and the image coordinates in the calibration plate image according to the first code of each first mark graphic, and obtain the world coordinates of each second mark graphic on the calibration plate and the image coordinates in the calibration plate image according to the second code of each second mark graphic.

[0055] For example, for any first mark graphic among the n first mark graphics, the corresponding coordinates are obtained from a pre-stored first correspondence relationship according to the first code corresponding to the first mark graphic as the world coordinates of the first mark graphic on the calibration board; for any second mark graphic among the s second mark graphics, the corresponding coordinates are obtained from the pre-stored first correspondence relationship according to the second code corresponding to the second mark graphic as the world coordinates of the second mark graphic on the calibration board.

[0056] It should be noted that the pre-stored first correspondence is obtained by associating the code of any one of the mark graphics among all the mark graphics in the calibration plate with the coordinates of the center point of the mark graphic in the calibration plate coordinate system, which is the same as the first correspondence in the above-mentioned calibration system and will not be repeated in this application.

[0057] Step 804: Calibrate the camera using the world coordinates and image coordinates of the plurality of first marker graphics and / or the plurality of second marker graphics on the calibration board to obtain camera parameters.

[0058] Specifically, the present application may process the world coordinates and image coordinates of multiple first marker graphics and / or multiple second marker graphics on the calibration board through Zhang Zhengyou calibration algorithm or other existing calibration algorithms to determine the camera parameters, and the present application is not limited to this.

[0059] Furthermore, when the calibration plate is acquired by using a camera to acquire the calibration plate image, in addition to the first marker pattern and the second marker pattern, there will also be noise patterns with contours similar to the first marker pattern and the second marker pattern in the calibration plate image. Specifically, if the first marker pattern and the second marker pattern have the same shape, the multiple marker patterns include n first marker patterns and s second marker patterns, as well as noise patterns with a preset contour; if the first marker pattern and the second marker pattern have different shapes, the multiple marker patterns include n first marker patterns and may include noise patterns with a preset contour. Therefore, in step 802, n first marker patterns need to be screened out from the multiple marker patterns.

[0060] In some embodiments, selecting n first logo graphics from a plurality of logo graphics includes the following three methods:

[0061] The first method is to obtain the number of pixels in each of the multiple logo graphics, sort the multiple logo graphics in descending order of the number of pixels, and determine the first n logo graphics among the sorted multiple logo graphics as the first logo graphics.

[0062] For example, the number of pixels in the logo graphic is the number of all pixels in the logo graphic or the number of pixels of a preset color in the logo graphic; wherein the preset color is set according to the color of the first logo graphic. For example, if the color of the first logo graphic is black, the preset color is set to black; or, if the color of the first logo graphic is blue, the preset color is set to blue.

[0063] When the first mark graphic and the second mark graphic on the calibration plate have the same shape and the first mark graphic is larger than the second mark graphic, the number of pixels in the first mark graphic in the calibration plate image (whether the number of all pixels or the number of pixels of preset colors) is greater than the number of pixels in the second mark graphic, and the number of pixels of preset colors in the first mark graphic is greater than the number of pixels of preset colors in a noise graphic that is similar in shape to the first mark graphic; when the first mark graphic and the second mark graphic are different on the calibration plate, the number of pixels of preset colors in the first mark graphic in the calibration plate image is usually greater than the number of pixels of preset colors in a noise graphic that is similar in shape to the first mark graphic.

[0064] Based on this, after sorting the multiple logo graphics in descending order of the number of pixel points, the first n logo graphics among the sorted multiple logo graphics are most likely to be the n first logo graphics. Therefore, each of the first n logo graphics can be determined as the first logo graphic to more accurately determine the n first logo graphics.

[0065] The second method is to select n first logo graphics from the multiple logo graphics according to the size of each logo graphic in the multiple logo graphics.

[0066] Optionally, obtain the dimensions of at least two directions of each logo graphic among the multiple logo graphics, calculate the size representative value of each logo graphic according to the dimensions in at least two directions, sort the multiple logo graphics in descending order of the size representative values, and determine the first n logo graphics among the sorted multiple logo graphics as the first logo graphics.

[0067] For example, when the logo graphic is a circle, the size representative value of the logo graphic is the radius of the circle. Performing ellipse fitting on any one of the multiple logo graphics to obtain the major axis and minor axis of the fitted ellipse, and determining the mean of the major axis and minor axis of the ellipse as the radius of the circle is regarded as obtaining the size representative value of the logo image.

[0068] When the first mark pattern and the second mark pattern have the same shape and the first mark pattern is larger than the second mark pattern, the size representative value of the first mark pattern is larger than the size representative value of the second mark pattern and the size representative value of the noise pattern. When the first mark pattern and the second mark pattern have different shapes, the size representative value of the first mark pattern is larger than the size representative value of the noise pattern. Based on this, after sorting the multiple mark patterns in descending order of the size representative values, the first n mark patterns among the sorted multiple mark patterns are most likely to be the n first mark patterns, and thus each mark pattern among the first n mark patterns is determined as the first mark pattern, so as to more accurately determine the n first mark patterns.

[0069] The third method: obtain the number of pixels in each of the multiple logo graphics and the size of each of the multiple logo graphics in at least two directions, calculate the size representative value of each logo graphic according to the size in at least two directions, and filter n first logo graphics from the multiple logo graphics in combination with the number of pixels in each logo graphic and the size representative value.

[0070] In some embodiments, selecting n first logo graphics in combination with the number of pixels in each logo graphic and the size representative value includes: sorting the multiple logo graphics in descending order of the number of pixels, selecting the first a logo graphics among the sorted multiple logo graphics, a being an integer greater than n; sorting the a logo graphics in descending order of the size representative value, and determining the first n logo graphics among the sorted a logo graphics as the first logo graphics. This implementation can further improve the accuracy of determining the n first logo graphics by selecting n first logo graphics from multiple logo graphics by dual sorting of the number of pixels in the logo graphics and the size of the logo graphics.

[0071] It should be noted that when the host identifies the n first logo graphics in the calibration plate image, it can also identify the multiple second logo graphics in the calibration plate image. For example, when the shapes of the first logo graphics and the second logo graphics are the same, after identifying the multiple logo graphics in the calibration plate image, the other logo graphics in the multiple logo graphics except the n first logo graphics selected above are determined as the second logo graphics; or, after identifying the multiple logo graphics in the calibration plate image, for any other logo graphics in the multiple logo graphics except the n first logo graphics selected above, when the number of pixels of a preset color in the logo graphics is greater than or equal to the preset number of pixels, the logo graphics is determined as the second logo graphics to reduce the probability of misidentifying the noise graphics as the second logo graphics; wherein the preset number of pixels can be set by the technician according to the size of the second logo graphics, etc.

[0072] In the case where the shapes of the first mark graphic and the second mark graphic are different, after extracting the contours of all graphics in the calibration plate image, a mark graphic whose contour is a target contour is identified to obtain multiple second mark graphics; or a mark graphic whose contour is a target contour and in which the number of pixel points of a preset color is greater than or equal to a preset number of pixels is determined as a second mark graphic to avoid misidentifying a noise graphic as a second mark graphic; wherein the target contour is pre-set according to the shape of the second mark graphic.

[0073] To further improve the calibration accuracy, after the host identifies n first marker graphics and multiple second marker graphics in the above manner, if the marker graphics whose recognized graphic contour is the preset contour or the target contour is neither the first marker graphics nor the second marker graphics, the corresponding marker graphics are determined as noise graphics; if the graphic attribute of a second marker graphics does not meet the preset graphic attribute conditions, the second marker graphics are determined as noise graphics; wherein the preset graphic attribute conditions are determined by the second marker graphics, such as when the shape of the second marker graphics is a circle, the preset graphic attribute conditions are the conditions that the graphic attributes such as roundness and the number of ellipse points need to meet. Optionally, a filtering operation or a removal operation is performed on the noise graphics in the calibration plate image to avoid interfering with the calibration results.

[0074] Optionally, if the clarity of a second mark graphic is low, the second mark graphic is determined to be a blurred graphic; if a part of a second mark graphic is blocked, the second mark graphic is determined to be an blocked graphic. Interpolation or elimination operations are performed on blurred graphics or blocked images to avoid interference with calibration results.

[0075] In some embodiments, obtaining the arrangement order of n first mark graphics according to the coordinates of the n first mark graphics in step 802 includes: calculating the distance between every two first mark graphics among the n first mark graphics according to the coordinates of the n first mark graphics, and determining the arrangement order of the n first mark graphics in the calibration plate image using the distance between every two first mark graphics, wherein the distance between every two first mark graphics is preferably the distance between the center points of the first mark graphics.

[0076] Since the asymmetric polygon formed by connecting the center points of each of the n first mark graphics in the calibration plate in sequence has directionality, the arrangement sequence of the first mark graphics constituting the polygon has a second corresponding relationship with the first code of the first mark graphics, so the arrangement sequence number of each of the n first mark graphics can also be determined according to the distance between every two first mark graphics in the n first mark graphics in the calibration plate image. After obtaining the arrangement sequence number of each of the n first mark graphics, decoding the calibration plate image using the arrangement sequence in step 802 to obtain the first code corresponding to the n first mark graphics includes: obtaining the code associated with the arrangement sequence number of each first mark graphic as the corresponding first code based on the pre-stored second corresponding relationship, thereby completing the decoding of the first mark graphics.

[0077] Specifically, using the distance between every two first mark graphics to determine the arrangement order of n first mark graphics in the calibration plate image includes: obtaining the two first mark graphics with the largest distance among the n first mark graphics and the number of first mark graphics in the right angle direction and / or the distance between each first mark graphic in the right angle direction and other first mark graphics among the two first mark graphics with the largest distance, and determining the arrangement order corresponding to the two first mark graphics with the largest distance according to the number and / or the distance; determining the arrangement order corresponding to the remaining first mark graphics according to the distance between each of the remaining first mark graphics and at least one of the two first mark graphics with the largest distance, and thereby obtaining the arrangement serial number of each first mark graphic.

[0078] It should be noted that the right-angle direction refers to the length direction and width direction of the calibration plate image. The right-angle direction of a first mark figure is the direction of the two sides of the right angle with the center point of the first mark figure as the vertex. The direction of the two sides of the right angle is consistent with the length direction and width direction of the calibration plate image.

[0079] like Fig. 9 As shown in Figure (a), the calibration plate includes 4 first mark patterns, and the serial numbers of the 4 first mark patterns are: 1, 2, 3, 4, and the codes of the 4 first mark patterns are: 117, 120, 92, 90. Connect the center points of every two first mark patterns in the 4 first mark patterns, among which the line between the center points of the first mark patterns with serial numbers 1 and 3 is the longest. The first mark pattern with serial number 1 has only the first mark pattern with serial number 2 in the right angle direction, that is, the number of the first mark patterns with serial number 1 in the right angle direction is 1; the first mark pattern with serial number 3 has the first mark patterns with serial numbers 2 and 4 in the right angle direction, that is, the number of the first mark patterns with serial number 3 in the right angle direction is 2; and the line between the center points of the first mark patterns with serial numbers 2 and 1 is longer than the line between the center points of the first mark patterns with serial numbers 4 and 1.

[0080] like Fig. 9 As shown in Figure (b), after obtaining the calibration plate image, the distance between the center points of each two first marker graphics in the four first marker graphics in the calibration plate image is determined to determine the two first marker graphics with the largest distance between the center points, namely, the first marker graphic in the lower left corner and the first marker graphic in the upper right corner. One of the two first marker graphics has a serial number of 1, and the other first marker graphic has a serial number of 3.

[0081] Further, the number of first mark graphics in the right angle direction of each of the two first mark graphics is determined; wherein, the number of first mark graphics in the right angle direction of the first mark graphics in the lower left corner is 1, and the number of first mark graphics in the right angle direction of the first mark graphics in the upper right corner is 2; based on the number of remaining first mark graphics in the right angle direction of the two first mark graphics with the largest distance, the serial number of the first mark graphic in the lower left corner is determined to be 1 and the serial number of the first mark graphic in the upper right corner is determined to be 3, and then according to the second corresponding relationship between the first code and the arrangement number, it is determined that the first code corresponding to the first mark graphic with the arrangement number 1 in the lower left corner is 117, and the first code corresponding to the first mark graphic with the arrangement number 3 in the upper right corner is 92.

[0082] Based on any first mark pattern of known first code, the first codes of the remaining first mark patterns are determined according to the distance between it and the first mark pattern of unknown code. Specifically, the distance between the first mark pattern of unknown code in the upper left corner and the first mark pattern of known code in the lower left corner, and the distance between the first mark pattern of unknown code in the lower right corner and the first mark pattern of known code in the lower left corner are obtained; since the distance between the first mark pattern in the upper left corner and the first mark pattern in the lower left corner is smaller than the distance between the first mark pattern in the lower right corner and the first mark pattern in the lower left corner, the serial number of the first mark pattern in the upper left corner is determined to be 4 and the serial number of the first mark pattern in the lower right corner is determined to be 2, and then according to the second corresponding relationship between the first code and the arrangement serial number, the first code corresponding to the first mark pattern with the arrangement serial number of 4 in the upper left corner is determined to be 90, and the first code corresponding to the first mark pattern with the arrangement serial number of 2 in the lower right corner is determined to be 120.

[0083] In other embodiments, identifying the arrangement order of n first mark graphics in a calibration plate image based on the n first mark graphics includes: obtaining the coordinates of the center points of each of the n first mark graphics, using the coordinates of the center points of the n first mark graphics to calculate the angle information of the polygon formed by the center points of the n first mark graphics, and determining the arrangement order of the n first mark graphics based on the angle information.

[0084] like Fig. 9 As shown in Figure (a), the calibration plate includes 4 first mark patterns, and the serial numbers of the 4 first mark patterns are: 1, 2, 3, 4, and the codes of the 4 first mark patterns are: 117, 120, 92, 90. Connecting the center points of the 4 first mark patterns can form a right-angled trapezoid, in which the internal angle with the center point of the first mark pattern with serial number 1 as the vertex is the smallest, and the internal angle with the center point of the first mark pattern with serial number 4 as the vertex is the largest. The serial numbers of the internal angles with the center points of the remaining first mark patterns as the vertices are numbered in reverse order.

[0085] like Fig. 9As shown in Figure (b), after obtaining the calibration plate image, the angle information of the polygon formed by the center points of the four first marker graphics is calculated according to the coordinates of the center points of the four first marker graphics in the calibration plate image. Among them, the internal angle with the center point of the first marker graphic in the lower left corner as the vertex is the smallest, and the internal angle with the center point of the first marker graphic in the lower right corner as the vertex is the largest, so the serial number of the first marker graphic in the lower left corner is determined to be 1, the serial number of the first marker graphic in the upper left corner is 4, and the serial numbers of the remaining first marker graphics are numbered in reverse order. Then, according to the second corresponding relationship between the first code and the arrangement serial number, it is determined that the first code corresponding to the first marker graphic with the arrangement serial number of 1 in the lower left corner is 117, the first code corresponding to the first marker graphic with the arrangement serial number of 2 in the lower right corner is 120, the first code corresponding to the first marker graphic with the arrangement serial number of 3 in the upper right corner is 92, and the first code corresponding to the first marker graphic with the arrangement serial number of 4 in the upper left corner is 90.

[0086] After obtaining the first code of the first mark pattern, the second mark pattern needs to be decoded to obtain the second code of the second mark pattern. Therefore, in step 802, the second mark pattern in the calibration plate image is decoded according to the relative positions of the s second mark patterns and the n first mark patterns and the first codes corresponding to the n first mark patterns to obtain the second codes corresponding to the s second mark patterns, which specifically includes steps A to D:

[0087] Step A: Obtain the world coordinates of the center points of the n first mark graphics in the reference coordinate system according to the first codes corresponding to the n first mark graphics and the pre-stored first correspondence. The reference coordinate system is a world coordinate system in the standard direction of the calibration plate, which is constructed with the center or vertex of the calibration plate as the origin and the length and width directions of the calibration plate as the x-axis and y-axis.

[0088] It should be noted that the pre-stored first correspondence is obtained by associating the code of any one of the mark graphics among all the mark graphics in the calibration plate with the coordinates of the center point of the mark graphic in the calibration plate coordinate system, which is the same as the first correspondence in the above-mentioned calibration system and will not be repeated in this application.

[0089] Step B: Obtain the image coordinates of the center points of the n first mark patterns in the calibration plate image, and construct a mapping relationship using the image coordinates of the center points of the n first mark patterns in the calibration plate image and the world coordinates in the reference coordinate system.

[0090] Step C: Map the calibration plate image to the reference coordinate system according to the mapping relationship to obtain a corrected calibration plate image in the reference coordinate system.

[0091] It should be understood that the calibration plate image is corrected to be an image in the same coordinate system as the calibration plate, that is, the calibration plate image is rotated, translated, and other operations are performed to make the calibration plate in the calibration plate image and the standard orientation of the calibration plate consistent, ensuring that the calibration plate and the calibration plate in the calibration plate image can be accurately matched, thereby achieving that the calibration plate can provide an accurate reference for subsequent calibration when placed in any direction without setting more parameters, making calibration simpler and more accurate.

[0092] Step D: Decode the s second marker patterns using the relative position relationship between the s second marker patterns and the n first marker patterns in the calibration plate image and the first codes corresponding to the n first marker patterns to obtain the second codes corresponding to the s second marker patterns.

[0093] The relative position relationship between the n first mark graphics and the s second mark graphics in the calibration plate in the reference coordinate system is known, and the encoding of each first mark graphic and each second mark graphic is also known. Therefore, when determining the relative position relationship between the first mark graphics and the second mark graphics in the correction calibration plate image, the s second mark graphics can be decoded according to the first encoding corresponding to the n first mark graphics to obtain the second encoding of the s second mark graphics.

[0094] In some embodiments, step D includes: constructing a tree data structure using the relative position relationship between s second mark graphics and n first mark graphics in the correction calibration plate image, and obtaining adjacent mark graphics of each first mark graphic according to the tree data structure; determining a target first mark graphic based on the number of adjacent mark graphics of each first mark graphic, wherein the number of adjacent mark graphics of the target first mark graphic is greater than a preset number threshold; growing outward from the target first mark graphic as a starting point, and obtaining second codes of the s second mark graphics according to the first code corresponding to the target first mark graphic.

[0095] In some embodiments, constructing a tree data structure using the relative position relationship between the s second marker graphics and the n first marker graphics in the calibration plate image includes: constructing a tree data structure using the coordinates of the center points of the s second marker graphics and the n first marker graphics in the calibration plate image in a reference coordinate system, wherein each node in the tree data structure contains the coordinates of a center point. By way of example, the tree data structure is a k-dimensional (KD) Tree data structure.

[0096] Specifically, for any first marker graphic among the n first marker graphics, by querying the node to which the coordinates of the center point of the first marker graphic belong in the tree data structure, the first marker graphics and / or second marker graphics adjacent to the first marker graphic are searched in the tree data structure to determine the total number of first marker graphics and second marker graphics adjacent to the first marker graphic, and if the total number is greater than or equal to a preset number threshold, the first marker graphic is determined as the target first marker graphic. In this way, the target first marker graphic can be quickly determined based on the tree data structure.

[0097] For example, based on the node to which the center coordinates of any first marker graphic belong in the tree data structure, the nearest neighbor points of the node are searched in the tree data structure using a k nearest neighbor search (kNN) algorithm or a ranged-kNN algorithm. If the total number of the nearest neighbor points of the node is greater than or equal to a preset number threshold, the first marker graphic corresponding to the node is determined as the target first marker graphic.

[0098] In some embodiments, growing outward from a target first mark graphic as a starting point, obtaining second codes corresponding to s second mark graphics according to a first code corresponding to the target first mark graphic includes: taking the target first mark graphic as the target mark graphic, defining a half-edge structure of the target mark graphic to obtain adjacent mark graphics of the target mark graphic; decoding the neighborhood mark graphic of the target mark graphic according to the code corresponding to the target mark graphic and the relative position relationship between each second mark graphic adjacent to the target mark graphic, and obtaining a second code corresponding to each second mark graphic adjacent to the target mark graphic.

[0099] After the decoding of the neighborhood mark graphic of the target mark graphic is completed, a second mark graphic is selected from the second mark graphics adjacent to the target mark graphic as a new target mark graphic, and the steps of "defining the half-edge structure of the target mark graphic to obtain the adjacent mark graphics of the target mark graphic; decoding the neighborhood mark graphics of the target mark graphic according to the code corresponding to the target mark graphic and the relative position relationship between each second mark graphic adjacent to the target mark graphic to obtain the second code corresponding to each second mark graphic adjacent to the target mark graphic" are re-executed until the second codes corresponding to all the second mark graphics among the s second mark graphics are determined.

[0100] In some embodiments, the half-edge structure of the target logo pattern includes four neighborhoods, eight neighborhoods, diagonal adjacency, checkerboard adjacency, etc., which are used to determine the growth direction of the target logo pattern, avoid reverse growth or growth toward other areas, and maintain the independence between logo patterns. Fig.10As shown, the first mark pattern P is used as the target mark pattern, and based on this as the starting point, it continuously grows outward based on the defined half-edge structure, and the encoding of all the second mark patterns in the calibration plate image is efficiently determined.

[0101] In some cases, two or more first marker graphics can be used as starting points to gradually determine the codes of all second marker graphics in the calibration plate image based on the half-edge structure. That is, when the target first marker graphics are first determined from n first marker graphics, multiple target first marker graphics can be determined, and the codes of all second marker graphics in the calibration plate image can be determined using each target first marker graphic as a starting point. In this case, the codes of the same second marker graphics determined using different target first marker graphics as starting points can also be verified with each other, thereby further improving the accuracy of the determined code of the second marker graphics.

[0102] In some embodiments, obtaining an adjacent sign graphic of a target sign graphic includes: obtaining a target distance between a center point of the target sign graphic and a center point of an adjacent first sign graphic or a second sign graphic, and determining a second sign graphic adjacent to the target sign graphic according to the coordinates of the center point of the target sign graphic, the coordinates of the center point of each second sign graphic in a plurality of second sign graphics, and the target distance. Specifically, according to the node to which the coordinates of the center point of the target sign graphic belong in the tree data structure, at least one nearest neighbor of the node to which the coordinates belong is searched from the tree data structure by a kNN algorithm or a ranged-kNN algorithm, the distance between the coordinates corresponding to the node to which the coordinates belong and the coordinates corresponding to each nearest neighbor are calculated, and the minimum distance is determined as the target distance.

[0103] Take the target logo graphic half-edge structure as an 8-neighborhood as an example, Fig.11 As shown, assuming that the target distance is d, the coordinates of the center point of the target logo graphic are P(x, y), and the center point of the target logo graphic is used as the starting point to grow outward. Given that the target logo graphic has 8 neighborhoods, the coordinates of the nearest neighbor points are P1(xd, yd), P2(x, yd), P3(x+d, yd), P4(x+d, y), P5(x+d, y+d), P6(x, y+d), P7(xd, y+d), and P8(xd, y). The logo graphic whose center point coordinates are closest to the above coordinates is determined from other logo graphics except the target logo graphic to obtain all adjacent logo graphics of the target logo graphic, thereby further determining the second logo graphic adjacent to the target logo graphic from all adjacent logo graphics of the target logo graphic.

[0104] Optionally, if the distance between the center point coordinates of a second mark graphic adjacent to the target mark graphic and the center point coordinates of the target mark graphic is less than or equal to a first preset distance, the second mark graphic is determined to be a noise graphic, and there is no need to decode the noise graphic subsequently; wherein the first preset distance is less than or equal to the target distance, and it can be set according to the minimum distance between the first mark graphic and the second mark graphic in the calibration plate, etc.

[0105] Furthermore, if the distance between the center point coordinates of a second mark pattern adjacent to the target mark pattern and the center point coordinates of the noise pattern is less than or equal to the second preset distance, the second mark pattern can be determined to be a contaminated pattern, and there is no need to decode the contaminated pattern later. The second preset distance can be set according to the minimum distance between any two mark patterns in the calibration plate. Fig.12 If the noise pattern shown is very close to a second mark pattern, the second mark pattern is determined to be a contaminated pattern, and there is no need to decode the contaminated pattern.

[0106] It should be noted that, for the second marker graphics that are blurred graphics, noise graphics, occluded graphics or polluted graphics, there is no need to decode them in this application, which can avoid affecting the calibration accuracy. In addition, when there are noise graphics, blurred second marker graphics, polluted second marker graphics and occluded second marker graphics in the calibration plate image, the calibration method of this application does not need to decode them and can complete the camera calibration later. While ensuring the calibration accuracy, it reduces the requirements of the calibration plate image, making the calibration method of this application robust.

[0107] Fig.131 is a schematic diagram of the structure of a camera calibration device provided by an embodiment of the present application. The device includes: a first acquisition module 1301, which is used to acquire a calibration plate image obtained by photographing at least a part of the calibration plate by a camera, wherein the calibration plate is provided with n first marker graphics and m second marker graphics that are not completely the same, wherein the center points of the n first marker graphics are sequentially connected to form an asymmetric polygon, and the calibration plate image includes n first marker graphics and s second marker graphics, s≤m; a decoding module 1302, which is used to identify the n first marker graphics and the m second marker graphics in the calibration plate image, obtain the arrangement order of the n first marker graphics according to the coordinates of the n first marker graphics, and use the arrangement order to decode the calibration plate image; The first codes corresponding to the n first marker graphics and the second codes corresponding to the s second marker graphics are obtained by row decoding; the second acquisition module 1303 is used to obtain the world coordinates of each first marker graphic on the calibration board and the image coordinates in the calibration board image according to the first code of each first marker graphic, and to obtain the world coordinates of each second marker graphic on the calibration board and the image coordinates in the calibration board image according to the second code of each second marker graphic; the calibration module 1304 is used to calibrate the camera using the world coordinates and image coordinates of multiple first marker graphics and / or multiple second marker graphics on the calibration board to obtain camera parameters.

[0108] Fig.14 This is a schematic diagram of the structure of a camera calibration device provided in an embodiment of the present application. Fig.14 As shown, the camera calibration device 14 includes: a processor 140, a memory 141, and a computer program 142 stored in the memory 141 and executable on the processor 140. When the processor 140 executes the computer program 142, the steps in the camera calibration method in the above embodiment are implemented.

[0109] The camera calibration device 14 can be a general-purpose computer device or a dedicated computer device. In a specific implementation, the camera calibration device 14 can be a desktop computer, a portable computer, a network server, a PDA, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of the camera calibration device 14. Those skilled in the art can understand that Fig.14 It is only an example of the camera calibration device 14 and does not constitute a limitation on the camera calibration device 14. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.

[0110] The processor 140 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0111] The memory 141 may be an internal storage unit of the camera calibration device 14, such as a hard disk or memory of the camera calibration device 14. The memory 141 may also be an external storage device of the camera calibration device 16, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the camera calibration device 14. Further, the memory 141 may also include both an internal storage unit of the computer device 14 and an external storage device. The memory 141 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs. The memory 141 may also be used to temporarily store data that has been output or is to be output.

[0112] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0113] The embodiments of the present application provide a computer program product, which, when executed on a computer, enables the computer to execute the steps in the above-mentioned method embodiments.

[0114] It should be noted that if the integrated unit in the present application is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk and an optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, a non-transient storage medium.

[0115] In the present application, all or part of the steps for implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the above-mentioned computer-readable storage medium.

[0116] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0117] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0118] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0120] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A camera calibration method, characterized in that: Applied to a calibration system including a calibration board and a host, the calibration board is provided with n first mark patterns and m second mark patterns that are not completely the same, the center points of the n first mark patterns are connected to form an asymmetric polygon, and the method includes: Acquire a calibration plate image obtained by photographing at least a partial area of ​​the calibration plate with a camera, wherein the calibration plate image includes n first mark patterns and s second mark patterns, where s≤m; Identify n first mark patterns and m second mark patterns in the calibration plate image, determine the arrangement order of the n first mark patterns according to the coordinates of the n first mark patterns and decode the calibration plate image using the arrangement order to obtain first codes of the n first mark patterns and second codes of the s second mark patterns; Acquire the world coordinates of each first mark pattern on the calibration plate and the image coordinates in the calibration plate image according to the first code of each first mark pattern, and acquire the world coordinates of each second mark pattern on the calibration plate and the image coordinates in the calibration plate image according to the second code of each second mark pattern; The camera is calibrated using the world coordinates and image coordinates of the plurality of the first mark patterns and / or the plurality of the second mark patterns on the calibration plate to obtain camera parameters.

2. The method according to claim 1, characterized in that Decoding the calibration plate image using the arrangement sequence to obtain the first codes of the n first mark patterns and the second codes of the s second mark patterns includes: Decoding the first sign graphics according to the arrangement order of the n first sign graphics to obtain first codes corresponding to the n first sign graphics; The second sign pattern is decoded according to the relative positions of the s second sign patterns and the n first sign patterns and the first codes corresponding to the n first sign patterns to obtain the second codes corresponding to the s second sign patterns.

3. The method according to claim 2, characterized in that The identifying the n first mark patterns in the calibration plate image includes: Extracting the contours of all graphics in the calibration plate image, identifying the contours of the graphics as marker graphics with preset contours, and obtaining a plurality of the marker graphics; The n first logo graphics are selected from the plurality of logo graphics according to the size of each logo graphic.

4. The method according to claim 3, characterized in that The step of selecting the n first sign graphics from the plurality of sign graphics according to the size of each sign graphic comprises: Obtaining the number of pixels in each of the logo graphics and obtaining the size of each of the logo graphics in at least two directions, and calculating the size representative value of each of the logo graphics according to the size in at least two directions; The n first logo patterns are selected from the plurality of logo patterns in combination with the number of pixels in each logo pattern and the size representative value.

5. The method according to any one of claims 2 to 4, characterized in that: Obtaining the arrangement order of the n first mark graphics according to the coordinates of the n first mark graphics includes: Calculating the distance between every two first mark patterns among the n first mark patterns according to the coordinates of the n first mark patterns; Obtaining the number of first mark patterns in the right angle direction and / or the distance between each first mark pattern in the right angle direction and another first mark pattern of the two first mark patterns with the largest distance among the n first mark patterns, and determining the first codes corresponding to the two first mark patterns according to the number and / or the distance between them; According to the distance between each of the other first mark patterns and at least one of the two first mark patterns, the arrangement order corresponding to the other first mark patterns is determined.

6. The method according to claim 5, characterized in that The decoding of the second sign pattern according to the relative positions of the s second sign patterns and the n first sign patterns and the first codes corresponding to the n first sign patterns to obtain the second codes corresponding to the s second sign patterns includes: Obtaining the world coordinates of the n first mark graphics in a reference coordinate system according to the first codes of the n first mark graphics and the pre-stored first correspondence relationship; wherein the reference coordinate system is a coordinate system constructed with the center or vertex of the calibration plate as the origin and the length direction and width direction of the calibration plate as the x-axis and y-axis, and the pre-stored first correspondence relationship is obtained by associating the code of any mark graphic among all the mark graphics in the calibration plate with the coordinates of the center point of the mark graphic in the calibration plate coordinate system; Obtaining image coordinates of center points of n first mark patterns in the calibration plate image, and constructing a mapping relationship using the image coordinates of the n first mark patterns in the calibration plate image and the world coordinates in the reference coordinate system; Mapping the calibration plate image to the reference coordinate system according to the mapping relationship to obtain a corrected calibration plate image in the reference coordinate system; The s second mark patterns are decoded using the relative position relationship between the s second mark patterns and the n first mark patterns in the correction calibration plate image, and the first codes corresponding to the n first mark patterns, to obtain the second codes corresponding to the s second mark patterns.

7. The method according to claim 6, characterized in that The method of decoding the s second mark patterns by using the relative position relationship between the s second mark patterns and the n first mark patterns in the calibration plate image and the first codes corresponding to the n first mark patterns to obtain the second codes corresponding to the s second mark patterns comprises: Constructing a tree data structure using the relative position relationship between the s second mark patterns and the n first mark patterns in the calibration plate image, and acquiring adjacent mark patterns of each first mark pattern according to the tree data structure; Determine a target first sign pattern based on the number of adjacent sign patterns of each of the first sign patterns, wherein the number of adjacent sign patterns of the target first sign pattern is greater than or equal to a preset number threshold; The target first sign pattern is used as a starting point to grow outward, and the second codes corresponding to the s second sign patterns are obtained according to the first code corresponding to the target first sign pattern.

8. A camera calibration device, characterized in that: The device comprises: A first acquisition module is used to acquire a calibration plate image obtained by photographing at least a part of the calibration plate by a camera, wherein the calibration plate is provided with n first mark patterns and m second mark patterns that are not completely the same, wherein the center points of the n first mark patterns are sequentially connected to form an asymmetric polygon, and the calibration plate image includes n first mark patterns and s second mark patterns, where s≤m; A decoding module, used for identifying n first mark patterns and m second mark patterns in the calibration plate image, determining an arrangement order of the n first mark patterns according to the coordinates of the n first mark patterns and decoding the calibration plate image using the arrangement order to obtain a first code of the n first mark patterns and a second code of the s second mark patterns; A third acquisition module is used to acquire the world coordinates of each first mark pattern on the calibration plate and the image coordinates in the calibration plate image according to the first code of each first mark pattern, and to acquire the world coordinates of each second mark pattern on the calibration plate and the image coordinates in the calibration plate image according to the second code of each second mark pattern; The calibration module is used to calibrate the camera using the world coordinates and image coordinates of the plurality of the first mark patterns and / or the plurality of the second mark patterns on the calibration plate to obtain camera parameters.

9. A camera calibration system, characterized in that: The camera calibration system comprises: A calibration plate, provided with n first mark patterns and m second mark patterns, wherein the center points of each of the n first mark patterns are sequentially connected to form an asymmetric polygon, and the first mark pattern is different from the second mark pattern; A host, configured to process the calibration plate image acquired by the camera according to the calibration method according to any one of claims 1 to 7 to obtain camera parameters.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • A high-precision binocular camera calibration method

    CN109598762A

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

    CN114241060A

  • Camera calibration method and device and electronic equipment

    CN117710473A

  • Calibration board, internal parameter calibration method, machine vision system, and storage device

    WO2020014845A1

  • Calibration method for 3D structured light system, and electronic device and storage medium

    WO2022052313A1

Cited By

  • Calibration method and device and scanning system

    CN119958461A