CN115713562A - Camera calibration method, device, equipment and storage medium - Google Patents

Camera calibration method, device, equipment and storage medium Download PDF

Info

Publication number
CN115713562A
CN115713562A CN202211447890.1A CN202211447890A CN115713562A CN 115713562 A CN115713562 A CN 115713562A CN 202211447890 A CN202211447890 A CN 202211447890A CN 115713562 A CN115713562 A CN 115713562A
Authority
CN
China
Prior art keywords
image
card
initial
target
pattern
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211447890.1A
Other languages
Chinese (zh)
Inventor
尹逊刚
黄国书
肖睿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202211447890.1A priority Critical patent/CN115713562A/en
Publication of CN115713562A publication Critical patent/CN115713562A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The application discloses a camera calibration method, a camera calibration device, camera calibration equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring a graph card image of a graph card acquired by a camera to be calibrated, wherein the graph card is composed of at least two sub-graph cards which are perpendicular to each other, and any sub-graph card comprises a plurality of patterns; respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image of the image card according to the image of the image card, wherein the target codes of the pattern images are different from each other; for any pattern image, determining the three-dimensional coordinate position of the pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence relationship between the target code and the three-dimensional coordinate of the pattern image; and determining camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.

Description

Camera calibration method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a camera calibration method, a camera calibration apparatus, an electronic device, and a computer-readable storage medium.
Background
In image measurement or machine vision applications, camera calibration is one of the very critical links. Based on camera calibration, the correlation between the three-dimensional coordinate position of a point on the spatial object and the two-dimensional coordinate position of its corresponding point in the image can be determined.
Therefore, how to perform camera calibration is a technical problem to be solved urgently.
Disclosure of Invention
An object of the present application is to provide a new technical solution for camera calibration.
According to a first aspect of the present application, there is provided a camera calibration method, the method comprising:
acquiring a picture card image of a picture card acquired by a camera to be calibrated, wherein the picture card is composed of at least two sub-picture cards which are vertical to each other, and any sub-picture card comprises a plurality of patterns;
respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image card according to the image card, wherein the target codes of the pattern images are different from each other;
for any pattern image, determining the three-dimensional coordinate position of the pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence between the target code of the pattern image and the three-dimensional coordinate;
and determining camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.
Optionally, the determining, according to the image of the image card, the target code and the two-dimensional coordinate position of each pattern image in the image of the image card respectively includes at least:
identifying a shape of a pattern image included in the image of the graphic card;
acquiring second target mapping data; wherein the second target mapping data includes a one-to-one correspondence between a shape of the pattern image and the target number;
generating a target digital table of the image card according to the second target mapping data and the shape of the pattern image included in the image of the image card;
acquiring a target convolution kernel;
and according to the target convolution kernel, performing convolution on the target digitization table of the image card to obtain the target code of each pattern image in the image card.
Optionally, the obtaining second target mapping data includes:
acquiring second initial mapping data, wherein the second initial mapping data comprises a one-to-one correspondence relationship between the shape of the pattern image and the initial number;
generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card;
performing a first volume process, the first volume process comprising: convolving the initial digitization table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image card;
modifying the initial number in the second initial mapping data in the case that there are at least two of the same between the first initial encodings of the pattern images in the image of the graphics card;
repeatedly executing the first convolution processing until the first initial codes of each pattern image in the image card images are different from each other;
second initial mapping data in a case where the first initial codes of each pattern image in the image card images are different from each other is used as second target mapping data.
Optionally, the obtaining the target convolution kernel includes:
acquiring an initial convolution kernel;
performing a second convolution process, the second convolution process comprising: convolving a target digitization table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image card;
modifying the initial convolution kernel if there are at least two encodings that are the same between second initial encodings of the pattern image in the graphics card image;
repeatedly performing the second convolution processing until the second initial encoding of each pattern image in the image card image is different from each other;
and taking the initial convolution kernel in the condition that the second initial codes of the pattern images in the image card image are different from each other as a target convolution kernel.
Optionally, the graphic card is a black and white graphic card or a color graphic card.
According to a second aspect of the present application, there is provided a camera calibration apparatus, the apparatus including:
the system comprises an acquisition module, a calibration module and a calibration module, wherein the acquisition module is used for acquiring a graphic card image of a graphic card acquired by a camera to be calibrated, the graphic card is composed of at least two sub-graphic cards which are perpendicular to each other, and any sub-graphic card comprises a plurality of patterns;
the first determining module is used for respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image card according to the image card, wherein the target codes of the pattern images are different from each other;
the second determining module is used for determining the three-dimensional coordinate position of any pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence between the target code and the three-dimensional coordinate of the pattern image;
and the third determining module is used for determining the camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.
Optionally, the first determining module includes:
an identification unit configured to identify a shape of a pattern image included in the image of the graphic card;
a first obtaining unit configured to obtain second target mapping data; wherein the second target mapping data includes a one-to-one correspondence between a shape of the pattern image and the target number;
a generating unit configured to generate a target digitization table of the image card according to the second target mapping data and a shape of a pattern image included in the image card image;
a second obtaining unit, configured to obtain a target convolution kernel;
and the convolution unit is used for performing convolution on the target digital table of the image card according to the target convolution kernel to obtain the target code of each pattern image in the image card.
Optionally, the first obtaining unit is specifically configured to:
acquiring second initial mapping data, wherein the second initial mapping data comprises a one-to-one correspondence relationship between the shape of the pattern image and the initial number;
generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card;
performing a first volume process, the first volume process comprising: convolving the initial digitization table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image card;
modifying the initial number in the second initial mapping data in the case that there are at least two of the same between the first initial encodings of the pattern images in the image of the graphics card;
repeatedly executing the first convolution processing until the first initial codes of each pattern image in the image card images are different from each other;
second initial mapping data in a case where the first initial codes of each pattern image in the image card images are different from each other is used as second target mapping data.
Optionally, the second obtaining unit is specifically configured to:
acquiring an initial convolution kernel;
performing a second convolution process, the second convolution process comprising: convolving a target digitization table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image card;
modifying the initial convolution kernel if there are at least two encodings that are the same between second initial encodings of the pattern image in the graphics card image;
repeatedly performing the second convolution processing until the second initial encoding of each pattern image in the image card image is different from each other;
and taking the initial convolution kernel in the condition that the second initial codes of the pattern images in the image card image are different from each other as a target convolution kernel.
According to a third aspect of the application, there is provided an electronic device comprising the apparatus of any of the second aspects; alternatively, the first and second liquid crystal display panels may be,
comprising a memory for storing computer instructions and a processor for retrieving said computer instructions from said memory for performing the camera calibration method according to any of the first aspect.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the camera calibration method according to any one of the first aspects.
In an embodiment of the present application, a camera calibration method is provided, where the method includes: acquiring a picture card image of a picture card acquired by a camera to be calibrated, wherein the picture card is composed of at least two sub-picture cards which are vertical to each other, and any sub-picture card comprises a plurality of patterns; respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image of the image card according to the image of the image card, wherein the target codes of the pattern images are different from each other; for any pattern image, determining the three-dimensional coordinate position of the pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence between the target code of the pattern image and the three-dimensional coordinate; and determining the camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image. By this method, each pattern image in the image of the image card can be uniquely encoded. And a two-dimensional coordinate position and a three-dimensional coordinate position which are uniquely corresponding to the same target code can be obtained. Because the target code is only corresponding to one pattern image, the two-dimensional coordinate position and the three-dimensional coordinate position corresponding to the same target code belong to the two-dimensional coordinate position and the three-dimensional coordinate position of the same pattern on the graphic card. On the basis, the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image in the image of the image card can be obtained, and the camera parameters can be further obtained, so that the calibration of the camera to be calibrated is realized. In addition, the image card provided by the embodiment of the application can improve the efficiency of the camera calibration method provided by the embodiment of the application.
Further features of the present application and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which is to be read in connection with the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a block diagram of a hardware configuration of an electronic device implementing a camera calibration method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a camera calibration method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a graphics card provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of another camera calibration method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a camera calibration apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Fig. 1 is a block diagram of a hardware configuration of an electronic device implementing a camera calibration method according to an embodiment of the present application.
The electronic device 1000 may be a terminal or a server. Further, the terminal may be a head-mounted device, a laptop, a tablet, a palmtop, etc. The server may be a cloud server or the like.
The electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so forth. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. Communication device 1400 is capable of wired or wireless communication, for example. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. A user can input/output voice information through the speaker 1700 and the microphone 1800.
Although a plurality of devices are shown in fig. 1 for each electronic device 1000, the present application may refer to only some of the devices, for example, the electronic device 1000 refers to only the memory 1200 and the processor 1100.
In an embodiment of the present application, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to execute the camera calibration method provided in the embodiment of the present application.
In the above description, the skilled person can design the instructions according to the solution disclosed in the present application. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
Fig. 2 is a schematic flowchart of a camera calibration method provided in an embodiment of the present application.
As shown in fig. 2, the camera calibration method provided in the embodiment of the present application includes the following steps S2100 to S2400:
s2100, obtaining a picture card image of a picture card collected by a camera to be calibrated.
The graph card is composed of at least two sub-graph cards which are perpendicular to each other, and any sub-graph card comprises a plurality of patterns.
In one embodiment of the present application, the graphic card may be composed of 3 mutually perpendicular sub-graphic cards as shown in fig. 3: a sub-graph card A, a sub-graph card B and a sub-graph card C.
In the embodiment of the present application, no limitation is made on whether sub-graph card a, sub-graph card B, and sub-graph card C are the same.
In one example, the pattern included in sub-graph card a, sub-graph card B, and sub-graph card C may be, but is not limited to, at least one of a diamond, a rectangle, a triangle, a circle, a rectangle, and the like. In fig. 3, the patterns respectively included in the sub-graph card a, the sub-graph card B, and the sub-graph card C are illustrated as diamonds and triangles.
In the conventional camera calibration process, a camera to be calibrated needs to acquire a conventional black-and-white card (for example, a black-and-white checkerboard) in different directions respectively to acquire a plurality of card images of the conventional black-and-white card. Compared with the traditional camera calibration, in the embodiment of the application, the graphic card is composed of at least two sub-graphic cards, so that the camera to be calibrated can acquire more sub-graphic cards at one time, and the position of the camera to be calibrated does not need to be adjusted. Therefore, the efficiency of the camera calibration method provided by the embodiment of the application is improved.
In the embodiment of the application, the sub-graphics cards included in the graphics card are perpendicular to each other. Taking fig. 3 as an example, the Y-axis coordinates of the pattern in sub-graph a are all 0, the X-axis coordinates of the pattern in sub-graph B are all 0, and the Z-axis coordinates of the pattern in sub-graph C are all 0. This facilitates the camera calibration personnel to mark the three-dimensional coordinates of the pattern in the daughter card.
In this embodiment of the present application, the specific implementation of S2100 is: placing a camera to be calibrated at a position where as many sub-graphics cards as possible can be acquired; controlling a camera to be calibrated to acquire an image of the graphic card; and acquiring a picture card image of the picture card acquired by the camera to be calibrated from the camera to be calibrated.
And S2200, respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image of the image card according to the image card.
Wherein the object codes of the pattern images are different from each other.
In the embodiment of the present application, the two-dimensional coordinate position of each pattern image in the image card refers to: the position of the center point of the corresponding pattern image in the two-dimensional coordinates of the image of the card. In one example, the origin of coordinates of the two-dimensional coordinate system of the image of the card is at the upper left corner, the X-axis is the direction of the width of the image of the card, the Y-axis is the direction of the length of the image of the card, and the measure of the coordinate system is the number of pixels.
In one embodiment of the present application, the coordinate position of each pattern image in the image card image in the two-dimensional coordinate system may be determined first; and determining the coordinate position of the central point of the corresponding pattern image according to the coordinate position of each pattern image to be used as the two-dimensional coordinate position of each pattern image.
In the embodiment of the application, each pattern in the image of the image card is coded, so that the target codes of any two pattern images in the image card are different. Thus, one of the pattern images in the image of the card possesses a unique target code. In order to implement the encoding in the embodiment of the present application, S2200 described above includes at least a step of determining a target encoding of each pattern image in the image of the image card according to the image card. This step is implemented by S2210-S2250 as follows:
s2210, a shape of the pattern image included in the image of the card is recognized.
In one embodiment of the present application, the outline of the pattern image may be extracted from the image of the graphic card according to an outline extraction algorithm; the shape of the pattern image is determined based on the outline of the pattern image.
S2220, second target mapping data is obtained.
Wherein the second target mapping data includes a one-to-one correspondence between the shape of the pattern image and the target number.
In the embodiment of the present application, different target codes of each pattern image in the graphics card image can be obtained by the second target mapping data and the target convolution kernel in S2240 described below.
In order to obtain different target codes of each pattern image in the image card, in an embodiment of the present application, the initial code of each pattern image in the image card may be determined by presetting second initial mapping data, and combining a preset target convolution kernel (the preset target convolution kernel is fixed, and the size and specific value thereof are not limited) based on the second initial mapping data. And under the condition that at least two same initial codes exist between the initial codes of the pattern images of the image card, modifying the second initial mapping data to realize that each pattern image in the image card has different target codes.
Alternatively, in one embodiment of the present application, the initial code of each pattern image in the image card may be determined based on the initial volume kernel in combination with the preset second target mapping data by first setting the second target mapping data (fixed, and as long as the one-to-one correspondence between the shape of one pattern image and the target number in the second target mapping data can be satisfied). Under the condition that at least two same initial codes exist between the initial codes of the pattern images of the image card, the target codes different from each other of each pattern image in the image card are realized by modifying the initial convolution kernel.
For the above manner of modifying the preset second initial mapping data, the above S2220 may be specifically implemented by the following S2220-1 to S2220-6:
s2220-1, second initial mapping data is obtained.
Wherein the second initial mapping data includes a one-to-one correspondence between the shape of the pattern image and the initial number.
In the present embodiment, one pattern image corresponds to one shape, and one shape corresponds to one initial number. And the initial number corresponding to the shape of the pattern image may be designated in advance by a calibration person.
In one example, the second initial mapping data may be as follows:
TABLE 1
Shape of pattern image Initial number
Diamond shape 3
Triangle shape 1
Is free of 0
In table 1, "none" indicates that no pattern image is present.
S2220-2, generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card.
In the embodiment of the application, for any pattern image in the image card, the initial number corresponding to the shape which is the same as the shape of the pattern image is searched from the second initial mapping data; and generating an initial digital table of the image card based on the searched initial number.
Taking the sub-card a in fig. 3 as an example, the sub-initialization table corresponding to the card a in the initial digitization table of the image of the card is shown in the following table 2:
TABLE 2
3 1 3 1 3 1
0 1 3 3 3 0
0 0 1 3 3 0
1 0 0 3 1 0
S2220-3, executing the first volume processing.
Wherein the first convolution processing includes: and carrying out convolution on the initial digital table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image of the image card.
In the embodiment of the application, the convolution operation is carried out on the initial digital table of the image card by using the target convolution core, and the first initial code of each pattern image in each image card is obtained.
It should be noted that, in the embodiments of the present application, the size and specific numerical value of the target convolution kernel are not limited, as long as the convolution kernel capable of performing convolution is within the protection scope of the present application.
In one example, the size of the target convolution kernel may be 3 × 3, or 5 × 5.
S2220-4, in the case that there are at least two of the same between the first initial codes of the pattern image in the image of the graphic card, modifying the initial number in the second initial mapping data.
In one embodiment of the present application, whether there are at least two of the same first initial encodings of the pattern image in the image of the card may be determined according to a larger or smaller manner.
If there are not at least two patterns in the first initial codes of the pattern images in the image card, the initial codes of the pattern images in the image card are different from each other. At this time, the second initial mapping data is used as the second target mapping data.
On the other hand, if there are at least two patterns in the first initial codes of the pattern images in the image card, it is explained that the target codes of the pattern images in the image card that do not meet the requirement in S2200 are different from each other. At this point, the initial number in the second initial mapping data is modified.
In one embodiment of the present application, the manner of modifying the initial number in the second initial mapping data may be: at least one of the initial numbers is increased or decreased but is different from the other numbers.
In one example, the modified second initial mapping data based on the above may be as shown in table 3 below:
TABLE 3
Shape of pattern image Initial number
Diamond shape 2
Triangle shape 1
Is composed of 0
S2220-5, the first convolution processing is repeatedly executed until the first initial codes of each pattern image in the image of the image card are different from each other.
S2220-6, the second initial mapping data when the first initial codes of each pattern image in the image card image are different from each other is used as the second target mapping data.
After the initial numbers in the second initial mapping data are modified, the above S2220-4 is repeatedly performed. Thus, the target codes of each pattern image in the image of the image card are different from each other in a circulating mode.
S2230, according to the second target mapping data and the shape of the pattern image included in the image of the graphic card, and generating a target digital table of the image card.
In the embodiment of the application, for any pattern image in the image card, searching the second target mapping data for the target number corresponding to the shape which is the same as the shape of the pattern image; and generating a target digital table of the image of the graphic card based on the searched number.
Based on the above description of S2220, it can be understood that, in the case where the second target mapping data in S2230 is obtained by modifying the second initial mapping data set in advance to obtain different target codes for each pattern image in the image card, the second target mapping data is obtained based on S2220-1 to S2220-6.
In the case of obtaining different target codes of each pattern image in the image card by modifying the preset initial convolution kernel, the second target mapping data may be preset by the calibration personnel as long as the one-to-one correspondence between the shape of one pattern image and the target number in the second target mapping data is satisfied.
Taking sub-graph card a in fig. 3 and the second target mapping data as table 3 as an example, the sub-target digitization table corresponding to graph card a in the target initial digitization table of the graph card image is shown in the following table 4:
TABLE 4
2 1 2 1 2 1
0 1 2 2 2 0
0 0 1 2 2 0
1 0 0 2 1 0
S2240, obtaining a target convolution kernel.
In the case that different target codes of each pattern image in the image card image are obtained by modifying the preset second initial mapping data, the size and specific numerical value of the target convolution kernel are not limited, as long as the convolution kernel capable of performing convolution is within the protection scope of the present application. In one example, the size of the initial convolution kernel may be 3 × 3, or 5 × 5.
For the above manner of modifying the preset initial convolution kernel, the above S2240 is implemented by the following S2240-1 to S2240-6:
s2240-1, obtaining an initial convolution kernel.
The size and specific values of the initial convolution kernel in S2240-1 are not limited in this embodiment, and the convolution kernel capable of performing convolution is within the scope of the present application.
In one example, the size of the initial convolution kernel may be 3 × 3, or 5 × 5.
S2240-2, second convolution processing is executed, and the second convolution processing comprises: and performing convolution on the target digital table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image of the image card.
In the embodiment of the present application, the object digitization table in S2240-2 is generated based on the second object mapping data and the shape of the pattern image included in the image of the graphic card. The second target mapping data is not limited as long as the one-to-one correspondence between the shape of one pattern image and the target number in the second target mapping data can be satisfied.
S2240-3, modifying an initial convolution kernel under the condition that at least two codes which are the same exist between second initial codes of the pattern image in the image card;
the method for modifying the initial convolution kernel in S2220-3 may be: at least one of which is increased or decreased.
S2240-4, the second convolution processing is repeatedly executed until the second initial codes of each pattern image in the image card image are different from each other.
S2240-5, taking the initial convolution kernel when the second initial codes of the pattern images in the image card image are different as the target convolution kernel.
And S2250, convolving the target digitization table of the image card image according to the target convolution kernel to obtain the target code of each pattern image in the image card image.
In one example, as shown in fig. 4, taking a sub-graph a in the graph card as an example, first, according to the second target mapping data shown in the above table 3 (taking the second initial mapping data shown in table 3 as the second target mapping data), the target digitization table shown in fig. 4 is obtained; the target digitization table shown in fig. 4 is convolved with the target convolution kernel in fig. 4, resulting in the target encoding of the pattern image shown in fig. 4.
S2300, for any image pattern, determining the three-dimensional coordinate position of the pattern image according to the first mapping data and the target code of the pattern image.
The first mapping data comprises a one-to-one correspondence relationship between target codes and three-dimensional coordinates of the pattern images.
And the coordinate system corresponding to the three-dimensional coordinate position in S2300 is a world coordinate system.
In one embodiment of the present application, the first mapping data is calculated in advance for the calibration personnel. Specifically, the method comprises the following steps: and the calibration personnel obtains the target code of each pattern in the graphic card according to the graphic card in the S2100, the second target mapping data in the S2220 and the target convolution kernel in the S2240. And for each pattern, calibrating the three-dimensional coordinate position of the pattern in a world coordinate system. And establishing a corresponding relation between the target code of each pattern and the corresponding three-dimensional coordinate to obtain first mapping data. And inputting the obtained first mapping data into the electronic equipment for executing the camera calibration method provided by the embodiment of the application.
In this embodiment, after obtaining the unique target code of each pattern image based on the above S2200, the unique corresponding three-dimensional coordinate may be found from the first mapping data according to the target code. And by combining the two-dimensional coordinates corresponding to the target codes in S2200, a two-dimensional coordinate position and a three-dimensional coordinate position uniquely corresponding to the same target code can be obtained. Because the target code is only corresponding to one pattern image, the two-dimensional coordinate position and the three-dimensional coordinate position corresponding to the same target code belong to the two-dimensional coordinate position and the three-dimensional coordinate position of the same pattern on the graphic card.
And S2400, determining camera parameters according to the two-dimensional coordinates and the corresponding three-dimensional coordinate positions of each pattern image.
In the embodiment of the present application, the camera parameters include an in-camera parameter, an out-camera parameter, and a distortion parameter. It can be understood that after the camera parameters are determined, the calibration of the camera to be calibrated is completed.
In an embodiment of the present application, a camera calibration method is provided, where the method includes: acquiring a picture card image of a picture card acquired by a camera to be calibrated, wherein the picture card is composed of at least two sub-picture cards which are vertical to each other, and any sub-picture card comprises a plurality of patterns; respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image of the image card according to the image of the image card, wherein the target codes of the pattern images are different from each other; for any pattern image, determining the three-dimensional coordinate position of the pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence between the target code of the pattern image and the three-dimensional coordinate; and determining the camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image. By this method, each pattern image in the image of the image card can be uniquely encoded. And a two-dimensional coordinate position and a three-dimensional coordinate position which are uniquely corresponding to the same target code can be obtained. Because the target code is only corresponding to one pattern image, the two-dimensional coordinate position and the three-dimensional coordinate position corresponding to the same target code belong to the two-dimensional coordinate position and the three-dimensional coordinate position of the same pattern on the graphic card. On the basis, the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image in the image of the image card can be obtained, and further camera parameters can be obtained, so that the calibration of the camera to be calibrated is realized. In addition, the image card provided by the embodiment of the application can improve the efficiency of the camera calibration method provided by the embodiment of the application.
On the basis of any of the above embodiments, the graphic card is a black-and-white graphic card or a color graphic card.
In the embodiment of the application, the unique coding of the pattern image in the image of the image card can be realized, so that the image card is not required to be a black and white image card. On the basis, the image card can be a black and white image card or a color image card. In this way, the restriction on the graphic card in the embodiment of the present application can be reduced.
The present application further provides a camera calibration apparatus 500, as shown in fig. 5, the apparatus 500 includes:
an obtaining module 510, configured to obtain a card image of a card acquired by a camera to be calibrated, where the card is composed of at least two sub-cards perpendicular to each other, and any sub-card includes multiple patterns;
a first determining module 520, configured to determine, according to the image card image, a target code and a two-dimensional coordinate position of each pattern image in the image card image, where the target codes of the pattern images are different from each other;
a second determining module 530, configured to determine, for any pattern image, a three-dimensional coordinate position of the pattern image according to first mapping data and a target code of the pattern image, where the first mapping data includes a one-to-one correspondence relationship between the target code and the three-dimensional coordinate of the pattern image;
a third determining module 540, configured to determine a camera parameter according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.
In one embodiment of the present application, the first determining module 520 includes:
an identification unit configured to identify a shape of a pattern image included in the image of the graphic card;
a first obtaining unit configured to obtain second target mapping data; wherein the second target mapping data includes a one-to-one correspondence between a shape of the pattern image and the target number;
a generating unit configured to generate a target digitization table of the image card according to the second target mapping data and a shape of a pattern image included in the image card image;
a second obtaining unit, configured to obtain a target convolution kernel;
and the convolution unit is used for performing convolution on the target digital table of the image card according to the target convolution kernel to obtain the target code of each pattern image in the image card.
In an embodiment of the present application, the first obtaining unit is specifically configured to:
acquiring second initial mapping data, wherein the second initial mapping data comprises a one-to-one correspondence relationship between the shape of the pattern image and the initial number;
generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card;
performing a first convolution process, the first convolution process comprising: convolving the initial digitization table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image card;
modifying the initial number in the second initial mapping data in the case that there are at least two of the same between the first initial encodings of the pattern images in the image of the graphics card;
repeatedly executing the first convolution processing until the first initial codes of each pattern image in the image card images are different from each other;
second initial mapping data in a case where the first initial codes of each pattern image in the image card images are different from each other is set as second target mapping data.
In an embodiment of the application, the second obtaining unit is specifically configured to:
acquiring an initial convolution kernel;
performing a second convolution process, the second convolution process comprising: convolving a target digitization table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image card;
modifying the initial convolution kernel if there are at least two encodings that are the same between second initial encodings of the pattern image in the graphics card image;
repeatedly performing the second convolution processing until the second initial encoding of each pattern image in the image card image is different from each other;
and taking the initial convolution kernel in the condition that the second initial codes of the pattern images in the image card image are different from each other as a target convolution kernel.
In one embodiment of the present application, the graphic card is a black and white graphic card or a color graphic card.
Through the camera calibration device provided by the embodiment of the application, each pattern image in the image of the image card can be uniquely coded. And a two-dimensional coordinate position and a three-dimensional coordinate position which are uniquely corresponding to the same target code can be obtained. Because the target code only corresponds to one pattern image, the two-dimensional coordinate position and the three-dimensional coordinate position corresponding to the same target code belong to the two-dimensional coordinate position and the three-dimensional coordinate position of the same pattern on the graphic card. On the basis, the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image in the image of the image card can be obtained, and further camera parameters can be obtained, so that the calibration of the camera to be calibrated is realized. In addition, the image card provided by the embodiment of the application can improve the efficiency of the camera calibration method provided by the embodiment of the application.
An embodiment of the present application further provides an electronic device 600, where the electronic device 600 includes the apparatus according to any one of the apparatus embodiments provided above; alternatively, the first and second liquid crystal display panels may be,
as shown in fig. 6, the apparatus comprises a memory 610 and a processor 620, wherein the memory 610 is used for storing computer instructions, and the processor 620 is used for calling the computer instructions from the memory 610 to execute the camera calibration method according to any one of the above method embodiments.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the camera calibration method according to any one of the above method embodiments.
The present application may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present application.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as a punch card or an in-groove protruding structure with instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be interpreted as a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present application may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present application are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Various aspects of the present application are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the application is defined by the appended claims.

Claims (11)

1. A camera calibration method, characterized in that the method comprises:
acquiring a picture card image of a picture card acquired by a camera to be calibrated, wherein the picture card is composed of at least two sub-picture cards which are vertical to each other, and any sub-picture card comprises a plurality of patterns;
respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image card according to the image card, wherein the target codes of the pattern images are different from each other;
for any pattern image, determining the three-dimensional coordinate position of the pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence between the target code and the three-dimensional coordinate of the pattern image;
and determining camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.
2. The method of claim 1, wherein the determining the target code and the two-dimensional coordinate position of each pattern image in the image of the image card respectively according to the image of the image card comprises at least:
identifying a shape of a pattern image included in the image of the graphic card;
acquiring second target mapping data; wherein the second target mapping data includes a one-to-one correspondence between a shape of the pattern image and the target number;
generating a target digital table of the image card according to the second target mapping data and the shape of the pattern image included in the image of the image card;
acquiring a target convolution kernel;
and according to the target convolution kernel, performing convolution on the target digitization table of the image card to obtain the target code of each pattern image in the image card.
3. The method of claim 2, wherein obtaining second target mapping data comprises:
acquiring second initial mapping data, wherein the second initial mapping data comprises a one-to-one correspondence relationship between the shape of the pattern image and the initial number;
generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card;
performing a first convolution process, the first convolution process comprising: convolving an initial digitization table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image card;
modifying the initial number in the second initial mapping data in the case that there are at least two of the same between the first initial encodings of the pattern images in the image of the graphics card;
repeatedly executing the first convolution processing until the first initial codes of each pattern image in the image card images are different from each other;
second initial mapping data in a case where the first initial codes of each pattern image in the image card images are different from each other is used as second target mapping data.
4. The method of claim 2, wherein obtaining the target convolution kernel comprises:
acquiring an initial convolution kernel;
performing a second convolution process, the second convolution process comprising: convolving a target digitization table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image card;
modifying the initial convolution kernel if there are at least two encodings that are the same between second initial encodings of the pattern image in the graphics card image;
repeatedly performing the second convolution processing until the second initial encoding of each pattern image in the image card image is different from each other;
and taking the initial convolution kernel in the condition that the second initial codes of the pattern images in the image card image are different from each other as a target convolution kernel.
5. The method of any one of claims 1-4, wherein the graphic card is a black and white graphic card or a color graphic card.
6. A camera calibration apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a calibration module and a calibration module, wherein the acquisition module is used for acquiring a graphic card image of a graphic card acquired by a camera to be calibrated, the graphic card is composed of at least two sub-graphic cards which are perpendicular to each other, and any sub-graphic card comprises a plurality of patterns;
the first determining module is used for respectively determining the target code and the two-dimensional coordinate position of each pattern image in the image card according to the image card, wherein the target codes of the pattern images are different from each other;
the second determining module is used for determining the three-dimensional coordinate position of any pattern image according to first mapping data and the target code of the pattern image, wherein the first mapping data comprises the one-to-one correspondence relationship between the target code and the three-dimensional coordinate of the pattern image;
and the third determining module is used for determining the camera parameters according to the two-dimensional coordinate position and the three-dimensional coordinate position of each pattern image.
7. The apparatus of claim 6, wherein the first determining module comprises:
an identification unit configured to identify a shape of a pattern image included in the image of the graphic card;
a first acquisition unit configured to acquire second target mapping data; wherein the second target mapping data includes a one-to-one correspondence between a shape of the pattern image and the target number;
a generating unit configured to generate a target digitization table of the image card according to the second target mapping data and a shape of a pattern image included in the image card image;
a second obtaining unit, configured to obtain a target convolution kernel;
and the convolution unit is used for performing convolution on the target digital table of the image card according to the target convolution kernel to obtain the target code of each pattern image in the image card.
8. The apparatus according to claim 7, wherein the first obtaining unit is specifically configured to:
acquiring second initial mapping data, wherein the second initial mapping data comprises a one-to-one correspondence relationship between the shape of the pattern image and the initial number;
generating an initial digital table of the image card according to the second initial mapping data and the shape of the pattern image included in the image of the image card;
performing a first volume process, the first volume process comprising: convolving an initial digitization table of the image card according to the target convolution core to obtain a first initial code of each pattern image in the image card;
modifying the initial numbers in the second initial mapping data in the case that there are at least two of the same between the first initial encodings of the pattern images in the image of the graphics card;
repeatedly executing the first convolution processing until the first initial codes of each pattern image in the image card images are different from each other;
second initial mapping data in a case where the first initial codes of each pattern image in the image card images are different from each other is used as second target mapping data.
9. The apparatus according to claim 7, wherein the second obtaining unit is specifically configured to:
acquiring an initial convolution kernel;
performing a second convolution process, the second convolution process comprising: convolving a target digitization table of the image card according to the initial convolution core to obtain a second initial code of each pattern image in the image card;
modifying the initial convolution kernel if there are at least two encodings that are the same between second initial encodings of the pattern image in the graphics card image;
repeatedly performing the second convolution processing until the second initial encoding of each pattern image in the image card image is different from each other;
and taking the initial convolution kernel in the condition that the second initial codes of the pattern images in the image card image are different from each other as a target convolution kernel.
10. An electronic device, characterized in that the electronic device comprises an apparatus according to any of claims 6-9; alternatively, the first and second electrodes may be,
comprising a memory for storing computer instructions and a processor for retrieving said computer instructions from said memory for performing the camera calibration method as claimed in any one of claims 1-5.
11. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the camera calibration method according to any one of claims 1-5.
CN202211447890.1A 2022-11-18 2022-11-18 Camera calibration method, device, equipment and storage medium Pending CN115713562A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211447890.1A CN115713562A (en) 2022-11-18 2022-11-18 Camera calibration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211447890.1A CN115713562A (en) 2022-11-18 2022-11-18 Camera calibration method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115713562A true CN115713562A (en) 2023-02-24

Family

ID=85233747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211447890.1A Pending CN115713562A (en) 2022-11-18 2022-11-18 Camera calibration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115713562A (en)

Similar Documents

Publication Publication Date Title
US8902229B2 (en) Method and system for rendering three dimensional views of a scene
CN109711508B (en) Image processing method and device
CN110717920B (en) Method and device for extracting target image of projector galvanometer test and electronic equipment
EP2945374A2 (en) Positioning of projected augmented reality content
US10430967B2 (en) Information processing apparatus, method, and program
CN111583381B (en) Game resource map rendering method and device and electronic equipment
CN105808035B (en) Icon display method and device
CN104484856A (en) Picture labeling display control method and processor
JP2017084117A (en) Display control method, display control program and information processing device
CN112528318A (en) Image desensitization method and device and electronic equipment
CN104615331A (en) Corner mark processing method
KR20210040305A (en) Method and apparatus for generating images
JP7262530B2 (en) Location information generation method, related device and computer program product
CN107203961B (en) Expression migration method and electronic equipment
CN111105440B (en) Tracking method, device, equipment and storage medium for target object in video
CN111797642B (en) Bar code identification method and terminal
CN104917963A (en) Image processing method and terminal
CN104991695A (en) Information processing method and electronic equipment
CN104503662A (en) Generation method and device for geometric outline of desktop element
CN115713562A (en) Camera calibration method, device, equipment and storage medium
CN108629219B (en) Method and device for identifying one-dimensional code
CN111427446B (en) Virtual keyboard display method and device of head-mounted display equipment and head-mounted display equipment
CN104615357A (en) Terminal
JP2019082927A (en) Information processing apparatus, information processing method, and program
CN114758145A (en) Image desensitization method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination