Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, are intended to fall within the scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an embodiment of a calibration plate of the present application, wherein an array pattern 10a and at least one feature pattern 12a located in the array pattern 10a are formed on a surface of the calibration plate 1a, and the at least one feature pattern 12a is used for indicating geometric parameters of the array pattern 10 a. In one application scenario, the geometric parameters include length, diameter, radius, width, etc., and the feature pattern 12a indicates what geometric parameters can be preset. When the processor acquires the picture of the calibration plate 1a, the geometrical parameters corresponding to the characteristic pattern 12a can be automatically acquired by analyzing the characteristic pattern 12a in the picture, so that human intervention in the calibration process is reduced, the calibration efficiency is improved, and the probability of human error is reduced. The thickness of the display pattern 10a formed on the surface of the calibration plate 1a and the thickness of the characteristic pattern 12a can be the same, so that calibration errors caused by identification errors between the display pattern and the characteristic pattern can be better avoided; the thickness of the array pattern 10a may also be different from the thickness of the feature pattern 12a, and the difference between the thicknesses may be no more than 0.1mm, which is advantageous for distinguishing the feature pattern 12a from the array pattern 10a during the recognition process, and the recognition error between the two is small. The thickness of the array pattern 10a and the feature pattern 12a may be not greater than 0.1mm, and the surface of the display pattern 10a and the feature pattern 12a is flat, so as to avoid recognition errors and improve recognition accuracy. The thickness of the calibration plate 1a can be formulated according to the actual calibration requirements.
In one embodiment, as shown in fig. 1, the calibration plate 1a is a checkered calibration plate, and the array pattern 10a includes a plurality of first color squares (e.g., white squares) 100a and second color squares (e.g., black squares) 102a which are alternately arranged and have the same size, wherein the size of the feature pattern 12a is an integer multiple of the first color squares 100a or the second color squares 102a, for example, 1-fold (as shown in fig. 1, the feature pattern 12a is the size of one first color square 100a or second color square 102 a), 2-fold, 3-fold, 4-fold (as shown in fig. 2, the feature pattern 12d in the calibration plate 1b is the size of 4 first color squares 100a or second color squares 102 a), and the like. In order to conveniently obtain the geometric information of the calibration plate 1a, the feature patterns 12a may be an even number, and are symmetrically distributed in the array pattern 10a along the axis of the array pattern 10a, and the feature patterns 12a are spaced apart by the same number (for example, 3, 4, 5, etc.) of square grids in the horizontal direction and the vertical direction, for example, 4 feature patterns 12a are distributed at the positions of 120a, 120b, 120c, 120d in fig. 1. Of course, in other application scenarios, the feature patterns 12a may be an odd number, which is not limited in this application. In this embodiment, the calibration plate 1a is a checkerboard calibration plate, and the geometric parameters of the array pattern 10a include the side lengths d1 of the first color square 100a and the second color square 102 a.
In another embodiment, as shown in fig. 3, the array pattern 10c on the calibration plate 1c includes a plurality of sub-patterns (for example, circles, etc.) with the same shape and disposed at a predetermined distance, the size of the feature pattern 12e is an integer multiple (for example, 1 time, etc.) of the sub-patterns, and in order to conveniently obtain the geometric information of the calibration plate 1c, the feature pattern 12e may be an even number and symmetrically distributed in the array pattern 10c along the axis of the array pattern 10c, that is, the plurality of sub-patterns with the same number (for example, 3, 4, 5, etc.) of feature patterns 12e are spaced apart in the horizontal direction and the vertical direction, which is, of course, in other application scenarios, the feature pattern 12e may be an odd number. In the present embodiment of the present invention, in the present embodiment, the geometric parameters of the array pattern 10c include a distance d2 between centers of adjacent sub-patterns; when the sub-pattern is a circle, the geometric parameter includes a distance d2 between centers of adjacent circles.
In still another embodiment, as shown in fig. 1, the feature pattern 12a is a two-dimensional code pattern, and the two-dimensional code patterns corresponding to different values of the geometric parameter are different. The two-dimensional code pattern may be a stacked or row-wise two-dimensional code, or may be a matrix two-dimensional code (as shown in fig. 1). The two-dimensional code pattern may be generated in advance by the two-dimensional code generator according to the side length d1 of the square of the calibration plate 1 a. For example, the two-dimensional code generator receives information of "the side length d1 of the square lattice is 1mm", and generates a corresponding two-dimensional code pattern by using the "the side length d1 of the square lattice is 1 mm". In the calibration process, the geometric parameters corresponding to the two-dimensional code pattern can be obtained by scanning the two-dimensional code pattern on the calibration plate 1 a.
In still another embodiment, the two-dimensional code pattern may include, in addition to preset geometric parameter information, distribution and position of the two-dimensional code pattern may also indicate other information about the calibration board 1a, for example, coordinate axis information, etc., so that in the calibration process, the geometric parameter corresponding to the two-dimensional code pattern may be obtained by scanning the two-dimensional code pattern on the calibration board 1a, and coordinate axis information may be obtained by positioning the two-dimensional code pattern. Specifically, referring to fig. 1, the calibration plate 1a is provided with a first two-dimensional code pattern 120a, a second two-dimensional code pattern 120b, and a third two-dimensional code pattern 120c, where the first two-dimensional code pattern 120a, the second two-dimensional code pattern 120b, and the third two-dimensional code pattern 120c are different from each other. The first two-dimensional code pattern 120a and the second two-dimensional code pattern 120b form a first connection line L1, the second two-dimensional code pattern 120b and the third two-dimensional code pattern 120c form a second connection line L2, the first connection line L1 and the second connection line L2 intersect at the second two-dimensional code pattern 120 b; the second two-dimensional code pattern 120b further defines a coordinate origin of the world coordinate system where the calibration plate 1a is located, the first two-dimensional code pattern 120a and the second two-dimensional code pattern 120b further define a first coordinate axis of the world coordinate system where the calibration plate 1a is located, for example, X-axis positive direction information, and the third two-dimensional code pattern 120c and the second two-dimensional code pattern 120b further define a second coordinate axis of the world coordinate system where the calibration plate 1a is located, for example, Y-axis positive direction information, and the first coordinate axis is perpendicular to the second coordinate axis.
In one application scenario, the second two-dimensional code pattern 120b may define an origin of coordinates as an origin of coordinates (0, 0) for an upper left corner or an upper right corner or a lower left corner or a lower right corner of a square occupied by the second two-dimensional code pattern 120b, or may define an origin of coordinates (0, 0) for an upper left corner or an upper right corner or a lower left corner or a lower right corner of a square adjacent above or below or to the left or to the right of the second two-dimensional code pattern 120b, and the application is not limited thereto.
In another application scenario, the distribution of the plurality of feature patterns 12a on the calibration board 10a may be uneven, so the included angle between the first connecting line L1 and the second connecting line L2 may be a right angle, or may be an acute angle or an obtuse angle, which is not limited in this application. The first two-dimensional code pattern 120a and the second two-dimensional code pattern 120b may define the X-axis positive direction as the horizontal extending direction from the origin of coordinates (0, 0) to the current first two-dimensional code pattern 120a, or the X-axis positive direction as the horizontal extending direction from the first two-dimensional code pattern 120a to the origin of coordinates (0, 0). The third two-dimensional code pattern 120c and the second two-dimensional code pattern 120b may define a Y-axis positive direction as a vertical extension direction from the origin of coordinates (0, 0) to the current third two-dimensional code pattern 120c, or a Y-axis positive direction as a vertical extension direction from the third two-dimensional code pattern 120c to the origin of coordinates (0, 0). The coordinate origin, the X-axis positive direction, and the Y-axis positive direction are determined in advance, and then the calibration plate 1a is prepared, and the feature pattern 12a is placed in a predetermined distribution.
In still another application scenario, the first, second, and third two-dimensional code patterns 120a, 120b, 120c may be generated in advance by the two-dimensional code generator according to the input information. For example, the two-dimensional code generator receives information that "the side length d1 of the square is 2mm, and sets the top left corner vertex of the square occupied by the currently generated two-dimensional code pattern as the origin of coordinates (0, 0)", and then generates a corresponding two-dimensional code pattern based on the information. In the calibration process, the geometric parameters and coordinate axis information corresponding to the two-dimensional code pattern can be obtained by scanning the two-dimensional code pattern on the calibration plate 1 a.
In yet another embodiment, referring to fig. 4, the feature pattern 12f of the calibration plate 1d is a specific shape selected from a plurality of shapes, and the plurality of shapes respectively correspond to different values of preset geometric parameters, and the specific shapes of all the feature patterns 12f on the calibration plate 1d are the same, wherein the specific shapes may be a circle, a triangle, a quadrilateral, a pentagon, a hexagon, etc., so that when the image capturing apparatus captures all or part of the image of the calibration plate 1d, the corresponding geometric parameters of the specific shapes of the feature patterns 12f can be obtained according to the specific shapes. In one application scenario, a first mapping table may be designed in advance, where the first mapping table is a comparison table of relationships between different specific shapes and different values of geometric parameters, as shown in table 1 below. In the calibration process, the specific shape of the characteristic pattern 12f on the calibration plate 1d is obtained through image recognition, and the geometric parameters corresponding to the specific shape can be obtained by calling the first mapping table. For example, in fig. 4, the specific shape corresponding to the feature pattern 12f is a triangle, and by looking up the following table 1, the geometric parameter corresponding to the calibration plate 1d can be obtained to be 1.35mm. It will be appreciated that table 1 only shows exemplary mappings between different specific shapes and geometric parameters, and in practice a user may formulate the first mapping table as desired. It will be appreciated that in other embodiments, all the feature patterns on the calibration plate may be different, and a first specific position may be designated on the calibration plate in advance, where a specific shape of the feature pattern at the first specific position corresponds to a value of a preset geometric parameter, and the feature patterns at the remaining positions may be used to designate remaining information about the calibration plate.
Watch (watch) 1: first mapping table
In still another embodiment, as shown in fig. 5, the feature patterns 12g provided on the calibration plate 1e are combined shapes including at least one specific shape, and the number of specific shapes included in the combined shapes is used to indicate different values of the geometric parameters, and the number of specific shapes included in all the feature patterns 12g on the calibration plate 1e is the same, so that when the image capturing apparatus captures all or part of the image of the calibration plate 1e, the corresponding values of the geometric parameters can be obtained according to the number of specific shapes of the feature patterns 12 g. Wherein the specific shape may be a circle, triangle, quadrangle, pentagon, hexagon, etc. The plurality of specific shapes may form a combined shape in a spaced manner so as to facilitate the post-processor to obtain the number of specific shapes in the feature pattern 12 g.
In one application scenario, a second mapping table may be designed in advance, where the second mapping table is a relationship comparison table between the number of specific shapes and different values of the geometric parameters, as shown in table 2 below. In the calibration process, the number of specific shapes contained in the feature pattern 12g on the calibration plate 1e is obtained through image recognition, and the second mapping table is called, so that the geometric parameters corresponding to the feature pattern 12g can be obtained. For example, in fig. 5, the number of specific shapes corresponding to the feature pattern 12g is 2, and by looking up the following table 2, the geometric parameter corresponding to the calibration plate 1e can be obtained to be 1.35mm. It will be appreciated that in other embodiments, the number of specific shapes included in all the feature patterns on the calibration plate may be different, and a first specific position may be designated in advance on the calibration plate, where the number of specific shapes of the feature patterns at the first specific position corresponds to a value of a preset geometric parameter, and the feature patterns at the remaining positions may be used to designate remaining information about the calibration plate.
Watch (watch) 2: second mapping table
Number of specific shapes
|
Geometric parameters
|
1 number of
|
1mm
|
2 personal (S)
|
1.35mm
|
3 pieces of
|
2mm
|
4 pieces of
|
3mm
|
…
|
… |
In still another embodiment, as shown in fig. 6, the feature pattern 12H provided on the calibration plate 1f is a two-dimensional code pattern 12i and a combined shape 12H including at least one specific shape, and the number of specific shapes included in all the feature patterns 12H on the calibration plate 1f is the same, the number of two-dimensional code patterns 12i is the same as or different from the number of combined shapes 12H, and the two-dimensional code patterns 12i are disposed adjacent to or at intervals from the combined shapes 12H, the two-dimensional code patterns 12i include basic unit information for indicating a basic unit, and the value of the geometric parameter of the calibration plate 1f is the product of the basic unit and the number of specific shapes included in the combined shapes 12H. In one embodiment, only one two-dimensional code pattern 12i may be disposed on the calibration plate 1f, and the two-dimensional code pattern 12i may be disposed adjacent to one of the combination shapes 12h, or may be located at another position on the calibration plate 1 f. In another embodiment, the calibration plate 1f may also be designed with a two-dimensional code pattern 12i near each of the combination shapes 12 h. In the calibration process, the number of specific shapes included in the combined shape 12h on the calibration plate 1f and the basic unit indicated by the two-dimensional code pattern 12i are obtained, so that the geometric parameters corresponding to the feature pattern 12h can be obtained. For example, assuming that the number of specific shapes corresponding to the combined shape 12h in fig. 6 is 2 and the basic unit indicated by the two-dimensional code pattern 12i is 1mm, the geometric parameter corresponding to the calibration plate 1f is 1×2mm, that is, 2mm. It will be appreciated that in other embodiments, the number of specific shapes included in all the feature patterns on the calibration plate may be different, and a first specific position may be designated on the calibration plate in advance, where the product of the number of specific shapes of the feature pattern and the basic unit at the first specific position corresponds to a value of a preset geometric parameter, and the feature patterns at the remaining positions may be used to designate the remaining information about the calibration plate.
In still another embodiment, after the feature patterns are designed correspondingly, the feature patterns on the calibration board can be identified and analyzed in the calibration process, and meanwhile, the geometric parameters, coordinate axis information and the like corresponding to the feature patterns are obtained. Specifically, as shown in fig. 7, the characteristic pattern 12J set on the calibration plate 1g is a combined pattern formed by the identifier 14a and the specific shape 12J, wherein at least one characteristic pattern 12J is set on the calibration plate 1g, the identifiers 14a of all the characteristic patterns 12J on the calibration plate 1g are different, the specific shapes 12J of all the characteristic patterns 12J on the calibration plate 1g are the same, the specific shape 12J is used for indicating the value of the geometric parameter, and the different identifiers 14a are used for defining the origin and the coordinate axis of the world coordinate system in which the calibration plate 1g is located.
In an application scenario, please continue to refer to fig. 7, the calibration board 1g includes a first feature pattern 12J provided with a first identifier 14a, a second feature pattern 12K provided with a second identifier 14b, and a third feature pattern 12L provided with a third identifier 14c, the first feature pattern 12J and the second feature pattern 12K form a third connection line L3, the second feature pattern 12K and the third feature pattern 12L form a fourth connection line L4, and the third connection line L3 and the fourth connection line L4 intersect at the second feature pattern 12K; wherein the first identifier 14a, the second identifier 14b, and the third identifier 14c are different, and the position of the second identifier 14b in the array pattern defines the origin of coordinates of the world coordinate system in which the calibration plate 1g is located (for example, the first identifier 14a may define the top left corner or the top right corner or the bottom left corner or the bottom right corner of the square in which the first identifier 14a is located as the origin of coordinates (0, 0), etc.), and the connecting line of the first identifier 14a and the second identifier 14b defines the first coordinate axis of the world coordinate system in which the calibration plate 1g is located (for example, the horizontal extending direction of the first identifier 14a to the second identifier 14b is the positive direction of the X axis, or the horizontal extending direction of the first identifier 14a to the second identifier 14b is the positive direction of the X axis, etc.); a line connecting the second identifier 14b and the third identifier 14c defines a second coordinate axis of the world coordinate system in which the calibration plate 1g is located (for example, a vertical extending direction of the second identifier 14b to the third identifier 14c is a Y-axis positive direction, or a vertical extending direction of the third identifier 14c to the second identifier 14b is a Y-axis positive direction), and the like; and the first coordinate axis is perpendicular to the second coordinate axis.
In another application scenario, the first identifier 14a, the second identifier 14b, and the third identifier 14c may be preset, and may be graphics, numbers, symbols, and the like.
In another application scenario, taking the first feature pattern 12J provided with the first identifier 14a as an example, the number or shape of the specific shapes 12J in the first feature pattern 12J is used to indicate the geometric parameters of the calibration plate 1g, so as not to affect the obtaining of the geometric parameters, the first identifier 14a may be disposed inside the specific shapes 12J of the first feature pattern 12J; the processor obtains the outline of the first characteristic pattern 12J, so that a specific shape 12J corresponding to the first characteristic pattern 12J can be obtained, and further, geometric parameters corresponding to the specific shape 12J can be obtained; the processor obtains the first identifier 14a corresponding to the first characteristic pattern 12J by obtaining the inner contour of the first characteristic pattern 12J.
Of course, other manners may be used to achieve the purpose of simultaneously obtaining the geometric parameters, coordinate axis information, and the like corresponding to the feature pattern.
In one application scenario, as shown in fig. 8, the calibration plate 1h is preset with a first specific position 12M, a second specific position 12N, and a third specific position 12P, and the first specific position 12M, the second specific position 12N, and the third specific position 12P are respectively provided with a first feature pattern 12M, a second feature pattern 12N, and a third feature pattern 12P. The first feature pattern 12M, the second feature pattern 12N, and the third feature pattern 12P may be the same or different, and the two-dimensional code pattern corresponding to the first feature pattern 12M or the specific shape or the number of specific shapes corresponds to the value of the geometric parameter, and the position of the first feature pattern 12M in the array pattern defines the origin of coordinates of the world coordinate system where the calibration plate 1h is located; the connection line L5 of the first characteristic pattern 12M and the second characteristic pattern 12N defines a first coordinate axis of a world coordinate system where the calibration plate 1h is positioned; the connection line L6 between the first feature pattern 12M and the third feature pattern 12P defines a second coordinate axis of the world coordinate system where the calibration plate 1h is located, and the first coordinate axis is perpendicular to the second coordinate axis. Of course, in other embodiments, the above-described arrangement of the first, second, and third characteristic patterns 12M, 12N, 12P may also be used to determine rotational direction information between the calibration plate and the image capturing apparatus, and the like, during calibration of the calibration plate 1 h.
In another application scenario, please refer to fig. 8 again, the calibration board 1h is preset with a first designated position 12M, a first feature pattern 12M is set at the first designated position 12M, and the two-dimensional code pattern corresponding to the first feature pattern 12M corresponds to the geometric parameter value corresponding to the specific shape or the number of specific shapes; in addition, the rest positions on the calibration plate 1h are also provided with mutually different characteristic patterns, and each characteristic pattern corresponds to different preset coordinate values. In the calibration process, by identifying all the feature patterns on the calibration plate 1h, the value of the geometric parameter corresponding to the first feature pattern 12M can be obtained, the preset coordinate values corresponding to the rest feature patterns can be calculated through a plurality of preset coordinate values to obtain the first internal parameter of the calibration plate 1h, the value of the geometric parameter can be calculated to obtain the second internal parameter of the calibration plate 1h, whether the difference value between the first internal parameter and the second internal parameter is within the preset range is compared, if the difference value is within the preset range, the first internal parameter or the second internal parameter is output, otherwise, the calibration is performed again.
In yet another application scenario, the feature pattern itself indicates the geometric parameters of the calibration plate. The distribution position of the feature pattern on the calibration plate may be used to define a coordinate system of the calibration plate, for example, define a position of a coordinate system origin of the calibration plate (a position of a feature pattern, i.e., a position of the coordinate system origin), and coordinate axes of the coordinate system of the calibration plate (for example, a position of a feature pattern is a position of the coordinate system origin, and connection lines of the feature pattern and the other two feature patterns are respectively an X axis and a Y axis of the coordinate system of the calibration plate, where the X axis and the Y axis are perpendicular). The distribution position of the characteristic pattern on the calibration plate can be used for indicating the rotation direction and the rotation angle between the calibration plate and the image pickup device, so that the calibration system can calibrate according to the rotation direction and the rotation angle by automatic rotation shooting, for example, after the calibration plate is placed, the image pickup device rotates leftwards when a certain characteristic pattern is positioned at the left side of a first connecting line of another two characteristic patterns, and the image pickup device is pushed in the same way, and the included angle between the second connecting line and the first connecting line of one characteristic pattern in the connecting line of the characteristic pattern can be the rotation angle of the image pickup device, and the rotation direction of the image pickup device can be indicated more accurately through the indication of the position of the characteristic pattern. The distribution position of the feature pattern on the calibration plate can also be used for calibrating the geometric parameter, for example, the geometric parameter is the size of an array pattern (or a specific pattern) at a certain position of the calibration plate, or the distance between the centers of the array pattern (or the specific pattern), the feature pattern is formed at a position adjacent to or a certain distance from the array pattern (or the specific pattern), the geometric parameter indicated by the feature pattern is the related geometric parameter of the array pattern (or the specific pattern) adjacent to or a certain distance from the feature pattern, after the feature pattern is identified to acquire the geometric parameter, an object corresponding to the geometric parameter is determined according to the position of the feature pattern, or whether the object (the array pattern or the specific pattern) corresponding to the geometric parameter is correct is determined according to the position of the feature pattern, so that the geometric parameter is calibrated.
Referring to fig. 9, fig. 9 is a flow chart illustrating an embodiment of a parameter calibration method in the present application, where the method includes:
s101: and acquiring an image of the calibration plate.
Specifically, the structure of the calibration plate may be referred to any of the above embodiments, and will not be described herein. The image capturing device can capture images of the calibration plate in any of the above embodiments from different angles, and the image capturing device transmits the captured images to the processor, which in turn obtains image information of the calibration plate.
S102: and identifying the characteristic pattern contained in the image, and acquiring the geometric parameters of the array pattern of the calibration plate indicated by the characteristic pattern according to the characteristic pattern.
Specifically, in one embodiment, as shown in fig. 1 or fig. 2 for the calibration plate 1a or 1b, when the feature pattern 12a or 12d on the calibration plate 1a or 1b is a two-dimensional code pattern, the two-dimensional code patterns corresponding to the different values of the geometric parameter are different, and the step S102 of obtaining the geometric parameter of the indicated array pattern of the calibration plate 1a or 1b according to the feature pattern 12a or 12d specifically includes: reading the two-dimensional code pattern, and decoding the two-dimensional code pattern to obtain the geometric parameters corresponding to the two-dimensional code pattern. For example, the geometric parameters can be obtained by decoding through built-in two-dimensional code recognition software.
In another embodiment, as shown in fig. 3 or fig. 4, the calibration plate 1c or 1d is provided with a feature pattern 12e or 12f which is a specific shape selected from a plurality of shapes, and the plurality of shapes respectively correspond to different values of the geometric parameters, and the specific shapes of all the feature patterns 12e or 12f on the calibration plate 1c or 1d are the same; before the step S102, the method provided in the present application may further include: presetting a first mapping table between a plurality of different values of the shape and geometry parameters (for example, the first mapping table shown in table 1 in the above embodiment); the step S102 of obtaining the geometric parameters of the array pattern of the calibration plate 1c or 1d indicated by the feature pattern 12e or 12f specifically includes: identifying a specific shape of the feature pattern; and calling a first mapping table between different values of the preset shapes and the geometric parameters, and obtaining the value of the geometric parameter corresponding to the specific shape of the characteristic pattern according to the specific shape of the characteristic pattern and the first mapping table.
In another embodiment, such as the calibration plate 1e shown in fig. 5, the feature pattern 12g on the calibration plate 1e includes at least one combination of specific shapes, and the number of specific shapes included in the combination is used to indicate different values of the geometric parameter. Before the step S102, the method provided in the present application further includes: presetting a second mapping table (for example, the second mapping table shown in table 2 in the above embodiment) between different numbers of specific shapes and different values of geometric parameters; the step S102 of obtaining the geometric parameters of the array pattern of the calibration plate 1e according to the feature pattern 12g specifically includes: identifying the number of specific shapes included in the feature pattern 12 g; and calling a second mapping table between the number of preset specific shapes and the values of the geometric parameters, and obtaining the values of the geometric parameters corresponding to the characteristic patterns 12g according to the number of the specific shapes and the second mapping table.
In another embodiment, as shown in fig. 6, the feature pattern 12H on the calibration plate 1f is a two-dimensional code pattern 12i and a combined shape 12H including at least one specific shape, the two-dimensional code pattern 12i is adjacent to or spaced from the combined shape 12H, the two-dimensional code pattern 12i includes basic unit information for indicating the basic unit, and the step S102 of acquiring the geometric parameters of the indicated array pattern of the calibration plate 1f according to the feature pattern 12H specifically includes: identifying the kind of the feature pattern 12H; if the feature pattern 12H is a two-dimensional code pattern 12i, decoding the two-dimensional code pattern 12i to obtain information (a basic unit in the embodiment) corresponding to the two-dimensional code pattern 12 i; if the feature pattern 12H is the combined shape 12H, identifying the specific shape and the number of specific shapes included in the combined shape 12H; according to the obtained basic unit information corresponding to the two-dimensional code pattern 12i and the number of the specific shapes in the combined shape 12h, calculating to obtain the value of the geometric parameter of the calibration plate 1f, wherein the value of the geometric parameter of the calibration plate 1f can be the product of the basic unit and the number of the specific shapes.
Of course, in other application scenarios, as shown in fig. 6, the calibration plate 1f may further include, before the step S102: the third mapping table (as shown in table 3 below) of the number of specific shapes and the set value included in the preset combined shape 12h may be the same or different, and the present application is not limited thereto. In step S102, the geometric parameters of the array pattern of the calibration plate 1f indicated by the feature pattern 12H may be specifically: identifying the kind of the feature pattern 12H; if the feature pattern 12H is a two-dimensional code pattern 12i, decoding the two-dimensional code pattern 12i to obtain information (a basic unit in the embodiment) corresponding to the two-dimensional code pattern 12 i; if the feature pattern 12H is the combined shape 12H, identifying the specific shape and the number of specific shapes included in the combined shape 12H; calling a third mapping table to obtain a set value corresponding to the number of the specific shapes; and calculating to obtain the value of the geometric parameter of the calibration plate 1f according to the obtained basic unit information corresponding to the two-dimensional code pattern 12i and the set value corresponding to the number of the specific shapes in the combined shape 12h, wherein the value of the geometric parameter of the calibration plate 1f can be the product of the basic unit and the set value.
Table 3: third mapping table
Number/number of specific shapes
|
Setting a numerical value
|
1
|
1
|
2
|
4
|
3
|
6
|
4
|
8
|
…
|
… |
S103: and acquiring coordinates of a plurality of characteristic points on the calibration plate in the world coordinate system according to the positions of the calibration plate in the world coordinate system and the geometric parameters.
Specifically, as shown in fig. 1, when the calibration plate 1a is a checkered calibration plate, the feature points may be corner points of the checkered, for example, points a, B, C, D indicated in fig. 1; or, for example, as shown in fig. 3, when the calibration plate 1c is a circular array calibration plate, the feature point may be the center of a circle.
In an application scenario, the step S103 may be implemented by using an imaging device calibration tool. For example, the plurality of feature points on the image correspond to the same world coordinate system, the Z-axis coordinate in the world coordinate system in which the plurality of feature points on the image are located may be preset to 0, and the origin of coordinates, the positive X-axis direction, and the positive Y-axis direction of the world coordinate system may be preset, and the coordinates of the respective feature points may be further obtained from the obtained geometric parameters. Referring to fig. 1 again, the upper left corner a of the picture is preset to be the origin of coordinates (0, 0), the right horizontal direction of the corner a is the positive X-axis direction, the vertical direction of the lower corner a is the positive Y-axis direction, if the geometric parameter corresponding to the calibration plate 1a is 1mm, the coordinates of the corner B in the world coordinate system are (1, 0), the coordinates of the corner C in the world coordinate system are (0, 1, 0), and the coordinates of the corner D in the world coordinate system are (2,5,0).
Of course, in other application scenarios, the feature pattern may be further designed, so that the processor analyzes the feature pattern to obtain the geometric parameter, and meanwhile, obtains information such as the origin of coordinates, the positive direction of the X axis, the positive direction of the Y axis, and the like of the world coordinate system, so as to avoid the traditional manual setting process. In one embodiment, before the step S103, the method provided in the present application further includes: positioning the position of the feature pattern in the array pattern of the calibration plate; and determining the origin and coordinate axes of the world coordinate system of the calibration plate according to the position of the characteristic pattern in the array pattern.
In one application scenario, as shown in fig. 1, when the feature pattern 12a is a two-dimensional code pattern, the feature pattern 12a includes a first two-dimensional code pattern 120a, a second two-dimensional code pattern 120b, and a third two-dimensional code pattern 120c, where the position of the second two-dimensional code pattern 120b in the array pattern defines the origin of coordinates of the world coordinate system where the calibration plate 1a is located, the connection line of the first two-dimensional code pattern 120a and the second two-dimensional code pattern 120b defines the first coordinate axis (for example, X-axis positive direction information) of the world coordinate system where the calibration plate 1a is located, and the connection line of the second two-dimensional code pattern 120b and the third two-dimensional code pattern 120c defines the second coordinate axis (for example, Y-axis positive direction information) of the world coordinate system where the calibration plate 1a is located, and the first coordinate axis is perpendicular to the second coordinate axis. The determining the origin and coordinate axes of the world coordinate system of the calibration plate according to the position of the feature pattern in the array pattern specifically includes: the first two-dimensional code pattern 120a, the second two-dimensional code pattern 120b and the third two-dimensional code pattern 120c in the image are read, a coordinate origin of a world coordinate system where the calibration plate 1a defined by the position of the second two-dimensional code pattern 120b in the array pattern is located, a first coordinate axis of the world coordinate system where the calibration plate 1a defined by the connection line of the first two-dimensional code pattern 120a and the second two-dimensional code pattern 120b is located, a second coordinate axis of the world coordinate system where the calibration plate 1a defined by the connection line of the second feature pattern 120b and the third feature pattern 120c is located, and the first coordinate axis is perpendicular to the second coordinate axis. The step S103 specifically includes: and utilizing the coordinate origin, the first coordinate axis, the second coordinate axis and the geometric parameters to obtain coordinates of the plurality of feature points in a world coordinate system. For example, assuming that the geometric parameter indicated by the first two-dimensional code pattern 120a is 1mm, the origin of coordinates defined by the second two-dimensional code pattern 120B is the origin of coordinates (0, 0) at the top left corner vertex D of the square occupied by the second two-dimensional code pattern 120B, the positive X-axis direction defined by the first two-dimensional code pattern 120a and the second two-dimensional code pattern 120B is the direction of horizontal extension of the origin of coordinates (0, 0) to the first two-dimensional code pattern 120a, the positive Y-axis direction defined by the third two-dimensional code pattern 120C and the second two-dimensional code pattern 120B is the direction of vertical extension of the origin of coordinates (0, 0) to the current third two-dimensional code pattern 120C, the coordinates corresponding to the corner point a are (-2,5,0), the coordinates corresponding to the corner point B are (-1,5,0), and the coordinates corresponding to the corner point C are (-2,4,0).
In another application scenario, as shown in fig. 7, the calibration plate 1g includes a first feature pattern 12J provided with a first identifier 14a, a second feature pattern 12K provided with a second identifier 14b, and a third feature pattern 12L provided with a third identifier 14c, where the first identifier 14a, the second identifier 14b, and the third identifier 14c are different, and the position of the second identifier 14b in the array pattern defines the origin of coordinates of the world coordinate system in which the calibration plate 1g is located, the linking symbol of the first identifier 14a and the second identifier 14b defines a first coordinate axis of the world coordinate system in which the calibration plate 1g is located, and the linking symbol of the second identifier 14b and the third identifier 14c defines a second coordinate axis of the world coordinate system in which the calibration plate 1g is located, and the first coordinate axis is perpendicular to the second coordinate axis; the determining the origin and coordinate axes of the world coordinate system of the calibration plate according to the position of the feature pattern in the array pattern specifically includes: acquiring a first identifier 14a, a second identifier 14b and a third identifier 14c respectively arranged on a first feature pattern 12J, a second feature pattern 12K and a third feature pattern 12L in the picture, wherein the coordinate origin of a world coordinate system where a calibration plate 1g defined by the position of the second identifier 14b in the array pattern is located, a first coordinate axis of the world coordinate system where a calibration plate 1g defined by a connecting line of the first identifier 14a and the second identifier 14b is located, and a second coordinate axis of the world coordinate system where a calibration plate 1g defined by a connecting line of the second identifier 14b and the third identifier 14c is located, wherein the first coordinate axis is perpendicular to the second coordinate axis; the step S103 specifically includes: and utilizing the coordinate origin, the first coordinate axis, the second coordinate axis and the geometric parameters to obtain coordinates of the plurality of feature points in a world coordinate system. Assume that, as shown in fig. 7, the top left corner vertex of the square where the second identifier 14b (e.g., triangle, etc.) is located is set in advance as the origin of coordinates (0, 0), and the horizontal extending direction of the first identifier 14a (e.g., five-pointed star, etc.) to the second identifier 14b is the positive X-axis direction; the vertical extending direction of the second identifier 14b to the third identifier 14c (e.g., circular shape, etc.) is the Y-axis positive direction; and then combining geometric parameters corresponding to the shapes or the number of the specific shapes contained in the first feature pattern 12J or the second feature pattern 12K or the third feature pattern 12L, so that coordinates in a world coordinate system corresponding to each feature point can be obtained.
S104: acquiring image coordinates of a plurality of characteristic points of a calibration plate;
specifically, this step S104 may be implemented by using an image capturing apparatus calibration tool box, which is not described herein too much, for example, when using an OpenCV image capturing apparatus calibration tool box, the cvfindcessboard filters function may be selected to extract the image coordinates of a plurality of feature points of the picture.
S105: and calculating to obtain the internal parameters according to the world coordinates and the image coordinates corresponding to the feature points and the conversion relation between the world coordinate system and the image coordinate system.
Specifically, this step S105 may be implemented by using an image capturing apparatus calibration toolbox or an OpenCV image capturing apparatus calibration toolbox, which is not described in detail herein, for example, when using the OpenCV image capturing apparatus calibration toolbox, the cvcalibrecat 2 function may be selected to calculate and obtain the internal parameters of the image capturing apparatus.
In one embodiment, the algorithm principle of calculating the internal parameters of the image capturing apparatus is as follows:
each picture can obtain the following two constraint equations for the internal parameter matrix:
wherein K is an internal parameter matrix, h1 and h2 are homography matrices, and the internal parameter matrix K contains 5 unknown parameters; when the number of pictures at different angles shot by the camera equipment is more than or equal to 3, 3 groups of homography matrixes h1 and h2 can be obtained, and the 3 groups of homography matrixes h1 and h2 are substituted into the two constraint equations to generate 6 equations, so that 5 unknown parameters contained in the internal parameter matrix K can be solved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an embodiment of a machine vision system of the present application, and the system 2 includes: the processor 20, the memory 22 and the image pickup apparatus 24, the memory 22 stores program instructions that can be loaded by the processor 20 and execute the internal parameter calibration method in any of the above embodiments. In the present application, the number of the image pickup apparatuses 24 may be 1 or a plurality of them, which is not limited in the present application.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an embodiment of a device with a storage function of the present application, where the device with a storage function 30 stores program data 300 thereon, and the program data 300 implements the steps in the internal parameter calibration method in any of the above embodiments when executed by a processor. In one application scenario, the device with storage function 30 may be a usb disk, a hard disk, or the like.
The foregoing description is only of embodiments of the present invention, and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the present invention.