Calibration method, image calibration method and calibration system

By setting up an infrared emitter and a preset point on the calibration carrier, and using the image collected by the infrared signal to determine the camera parameters, the problem of calibration accuracy under poor light conditions is solved, and high-precision calibration in low-light environments is achieved.

CN113140008BActive Publication Date: 2024-08-23CNAUTOCHIPS SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010054045.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-17
Publication Date
2024-08-23
Estimated Expiration
2040-01-17

AI Technical Summary

Technical Problem

When the light conditions are not ideal, especially when the light is dim at night, the accuracy of corner point detection is insufficient, resulting in a decrease in the accuracy of camera calibration.

Method used

By setting a number of preset points on the calibration carrier, and providing infrared emitters at these points to emit infrared signals, the camera device collects infrared images to determine internal and external parameters, thereby improving the accuracy of calibration.

Benefits of technology

This method can accurately obtain plane position information without being interfered by natural conditions, thereby improving the accuracy of calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113140008B
    Figure CN113140008B
Patent Text Reader

Abstract

The present invention discloses a calibration method, an image calibration method and a calibration system, wherein the calibration method comprises: obtaining an infrared image generated by an imaging device collecting an infrared signal of a calibration carrier, wherein the infrared signal is emitted from a preset point of the calibration carrier, the calibration carrier is provided with a plurality of preset points, and an infrared transmitter is provided at the plurality of preset points for emitting the infrared signal; based on the plane position information corresponding to the plurality of preset points in the infrared image, and the spatial position information of the plurality of preset points in space, the internal parameters and / or external parameters of the imaging device are determined. By the above method, the accuracy of the calibration can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a calibration method, an image calibration method and a calibration system. Background Art

[0002] In machine vision and image measurement, in order to determine the three-dimensional position of a spatial object, a geometric model of camera imaging must be established. This process is called camera calibration.

[0003] At present, in the calibration process, it is necessary to obtain the original image of the calibration carrier with calibration patterns such as checkerboard, and then perform corner detection on this basis to calibrate the camera. Therefore, the accuracy of corner detection greatly affects the accuracy of calibration. However, in the case of unsatisfactory lighting conditions, especially in dim light at night, it is impossible to obtain accurate corner information, thereby reducing the accuracy of calibration. In view of this, how to improve the accuracy of calibration has become an urgent problem to be solved. Summary of the invention

[0004] The main problem to be solved by the present invention is to provide a calibration method, an image calibration method and a calibration system, which can improve the accuracy of calibration.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is to provide a calibration method, including: obtaining an infrared image generated by a camera device collecting infrared signals of a calibration carrier, wherein the infrared signals are emitted from preset points of the calibration carrier, and a number of preset points are provided on the calibration carrier, and infrared transmitters are provided at the preset points for emitting infrared signals; based on the planar position information corresponding to the number of preset points in the infrared image, and the spatial position information of the number of preset points in space, the internal parameters and / or external parameters of the camera device are determined.

[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide an image calibration method, including: using the internal parameters of the camera device to correct the visible light image captured by the camera device to obtain a processed image; using the external parameters of the camera device to project the processed image to obtain a texture image; using the texture graphics for rendering to obtain a model corresponding to the current environment, wherein the internal parameters and external parameters of the camera device are obtained through the above calibration method.

[0007] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide a calibration system, including a calibration carrier, and a processor and a camera device coupled to each other, wherein a plurality of preset points are provided on the calibration carrier, and an infrared transmitter is provided at the preset points for emitting infrared signals, and the processor is used to execute program instructions to implement the steps in the above calibration method, or to implement the steps in the above image calibration method.

[0008] Through the above scheme, the beneficial effect of the present invention is: by setting a number of preset points on the calibration carrier, and infrared transmitters are provided at the preset points for emitting infrared signals, so that an infrared image generated by the imaging device collecting the infrared signals emitted from the preset points of the calibration carrier can be obtained, and based on the plane position information corresponding to the several preset points in the infrared image, and the spatial position information of the several preset points in the space, the internal parameters and / or external parameters of the imaging device can be determined, so that accurate plane position information can be obtained without being interfered by natural conditions, and the accuracy of calibration can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0010] Figure 1 It is a flow chart of an embodiment of a calibration method provided by the present invention;

[0011] Figure 2 yes Figure 1 A schematic diagram of the structure of an embodiment of a calibration carrier;

[0012] Figure 3 yes Figure 1 A schematic structural diagram of another embodiment of a marking carrier;

[0013] Figure 4 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S12;

[0014] Figure 5 yes Figure 4 A flow chart of an embodiment of step S122;

[0015] Figure 6 yes Figure 5 A schematic diagram of a flow chart of an embodiment of step S53;

[0016] Figure 7 is a flow chart of an embodiment of an image calibration method provided by the present invention;

[0017] Figure 8 It is a schematic diagram of the framework of an embodiment of a calibration system provided by the present invention;

[0018] Fig. 9 It is a schematic diagram of the framework of an embodiment of a storage device provided by the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a calibration method provided by the present invention. Specifically, it may include the following steps:

[0021] Step S11: obtaining an infrared image generated by an imaging device collecting infrared signals of a calibration carrier.

[0022] In this embodiment, the infrared signal is emitted from a preset point of the calibration carrier. Specifically, the calibration carrier is provided with a plurality of preset points, and an infrared transmitter is provided at the plurality of preset points for emitting the infrared signal. In an implementation scenario, an infrared receiver may be integrated in the camera device for receiving the infrared signal, and the camera device generates an infrared image by collecting the infrared signal.

[0023] In a specific implementation scenario, please refer to Figure 2 , Figure 2 yes Figure 1 The structural diagram of the calibration carrier in the embodiment of FIG. Figure 2 As shown, the calibration carrier is a plate-shaped object with a checkerboard pattern arranged thereon, and the corner points of the checkerboard pattern (the circular positions filled with oblique lines in the figure) are the preset points of the calibration carrier, such as Figure 2 As shown, in this embodiment, the number of preset points can be 24. In other implementation scenarios, the number of preset points can also be other values, such as 12, 18, 30, etc., which are not specifically limited here. In addition, other calibration patterns can also be set on the calibration carrier, such as triangles, circles, etc. When the calibration pattern is a triangle, the preset points can be at the corners of the triangle, and the infrared transmitter is set at the corners of the triangle. When the calibration pattern is a circle, the preset points can be at the center of the circle, and the infrared transmitter is set at the center of the circle.

[0024] In another specific implementation scenario, in order to expand the scope of application, the camera device can also be set as a panoramic camera, and the calibration carrier can be set as a three-dimensional calibration carrier. Figure 3 , Figure 3 yes Figure 1 A schematic diagram of the structure of another embodiment of the calibration carrier. Figure 3 As shown, the calibration carrier includes a ground calibration plate and a side calibration plate connected at a preset angle, and the ground calibration plate and the side calibration plate are respectively provided with a plurality of preset points, and infrared transmitters are respectively provided at the plurality of preset points of the ground calibration plate and the side calibration plate, which can be specifically as follows Figure 2 The preset angle can be set in the manner shown in the figure, or it can be set as a triangular or circular calibration pattern, which is not specifically limited here. Among them, the preset angle can be 90 degrees to 135 degrees, for example, 90 degrees, 105 degrees, 120 degrees, 135 degrees, etc. Figure 3 The stereoscopic calibration carrier shown can calibrate the camera device on the ground and off the ground respectively, so as to facilitate its application in the three-dimensional model. The specific calibration method and application method in the three-dimensional model will not be described here.

[0025] In another specific implementation scenario, in order to further improve the accuracy of calibration, multiple calibration carriers can be placed for calibration. In particular, when the camera device is installed on a large vehicle such as a bus, truck, bulldozer, or forklift, multiple calibration carriers can be placed within the field of view of the camera device, so that the position information of preset points on multiple calibration carriers can be obtained at the same time, thereby improving the accuracy of subsequent calibration.

[0026] Step S12: determining internal parameters and / or external parameters of the imaging device based on the planar position information corresponding to the plurality of preset points in the infrared image and the spatial position information of the plurality of preset points in space.

[0027] In this embodiment, the plane position information corresponding to the preset points can be obtained by using the infrared image. In one implementation scenario, the plane position information includes the two-dimensional position coordinates of the preset points in the infrared image (i.e., the pixel coordinates of the preset points in the infrared image). In addition, according to the placement position of the calibration carrier in the space, the spatial position information of the preset points in the space can be measured. In one implementation scenario, the spatial position information includes the three-dimensional position coordinates of the preset points in the space.

[0028] In this embodiment, the internal parameters may include a first image center coefficient, a second image center coefficient, a first magnification coefficient and a second magnification coefficient, and a first distortion coefficient and a second distortion coefficient. The first image center coefficient and the second image center coefficient respectively represent the offset of the pixel center of the image in the x direction and the y direction, the first magnification coefficient and the second magnification coefficient respectively represent the multiples of the physical size of the camera chip and the pixel size in the x direction and the y direction, and the first distortion coefficient and the second distortion coefficient both represent radial distortion.

[0029] In an implementation scenario, the first image center coefficient, the second image center coefficient, the first magnification coefficient, and the second magnification coefficient in the internal parameters of the imaging device can be determined by statistics and calculation of average values ​​based on the plane position information and spatial position information of several preset points. In addition, the first distortion coefficient and the second distortion coefficient in the internal parameters of the imaging device can be determined by statistics and iteration based on the plane position information and spatial position information of several preset points. For details, please refer to the steps in the following embodiments, which will not be described here.

[0030] In this embodiment, the external parameters may include the rotation matrix and translation matrix adopted from the world coordinate system to the camera coordinate system through the rigid body transformation (rotation and translation). Specifically, it can be obtained by Zhang Zhengyou calibration method. In an implementation scenario, in order to simplify the amount of calculation, a small number of preset points that can form a special shape (for example: rectangle) can be selected from a number of preset points, and the spatial position information of these preset points in the space and the plane position information in the plane are obtained, and then based on the plane position information and the spatial position information, the projection relationship matrix between the two is calculated as the external parameter of the camera device.

[0031] In a specific implementation scenario, in order to expand the scope of application, the camera device can also be set as a panoramic camera, and the calibration carrier can be set as a three-dimensional calibration carrier. Figure 3The calibration carrier shown, for each direction of the panoramic camera, can determine the first internal parameter and the first external parameter of the camera device on the ground based on the plane position information corresponding to several preset points of the ground calibration plate in the infrared image and the spatial position information of several preset points of the ground calibration plate in the space, and determine the second internal parameter and the second external parameter of the camera device on the non-ground based on the plane position information corresponding to several preset points of the side calibration plate in the infrared image and the spatial position information of several preset points of the side calibration plate in the space. On this basis, when performing three-dimensional rendering, for each direction of the panoramic camera, and the first internal parameter and the first external parameter corresponding to the direction, as well as the second internal parameter and the second external parameter, the current environment can be photographed by the camera device to obtain a visible light image, the visible light image can be corrected by the first internal parameter to obtain a first processed image, and the visible light image can be corrected by the second internal parameter to obtain a second processed image, and then the first processed image can be projected and transformed by the first external parameter to obtain a first texture image corresponding to the ground, and the second processed image can be projected and transformed by the second external parameter to obtain a second texture image corresponding to the non-ground, and finally the first texture image and the second texture image can be used for three-dimensional rendering to obtain a three-dimensional model corresponding to the current environment, thereby using the first internal parameter and the first external parameter corresponding to the ground in each direction obtained by calibrating the panoramic camera in each direction, and the second internal parameter and the second external parameter corresponding to the non-ground in each direction, to perform corresponding processing on the visible light images subsequently photographed in each direction to obtain texture images projected onto the ground and the non-ground, and perform three-dimensional rendering.

[0032] In addition, the above correction processing is to perform center correction and distortion correction on the visible light image captured by the camera device. Specifically, it can be achieved through the following steps:

[0033] First, use the following formula to perform center correction:

[0034] X rr =X r -c x

[0035] Y rr =Y r -c y

[0036] In the above formula, (X r ,Y r ) represents the two-dimensional position coordinates of a pixel point in the visible light image, (X rr ,Y rr ) represents the two-dimensional position coordinates of a pixel point in the visible light image after center correction, c xrepresents the first image center coefficient, c y Represents the second image center coefficient.

[0037] Then, use the following formula to transform the two-dimensional position coordinates into the camera coordinate system:

[0038]

[0039]

[0040] In the above formula, f x represents the first multiplication factor, f y Represents the second multiplication factor.

[0041] Next, use the following formula to calculate the projection radius of the camera coordinates:

[0042]

[0043] In an ideal situation, the incident angle of a distortion-free lens using a pinhole imaging model can be obtained by the following formula:

[0044] θ=arctan(r)

[0045] In practice, the relationship between the incident angle of a distorted lens and the incident angle θ of a non-distorted lens can be expressed as:

[0046] θ D =θ+kc1*θ 3 +kc2*θ 5

[0047] In the above formula, kc1 represents the first distortion coefficient, and kc2 represents the second distortion coefficient.

[0048] For the pinhole imaging model after distortion, the coordinates (xxx, yyy) of the camera coordinate system satisfy the following relationship:

[0049]

[0050]

[0051] Then, after coordinate transformation and center correction, the coordinates of the corresponding pixel points on the corrected image can be obtained (X d ,Y d ):

[0052] X d =xxx*f x +c x

[0053] Y d =yyy*f y +cy

[0054] By performing the above processing steps on all pixels on the visible light image, the correction processing of the visible light image can be completed.

[0055] The above scheme, by setting a number of preset points on the calibration carrier, and providing infrared transmitters at the preset points for emitting infrared signals, can obtain an infrared image generated by the imaging device collecting the infrared signals emitted from the preset points of the calibration carrier, and based on the plane position information corresponding to the several preset points in the infrared image, as well as the spatial position information of the several preset points in space, determine the internal parameters and / or external parameters of the imaging device, thereby being able to obtain accurate plane position information without being interfered by natural conditions, thereby improving the accuracy of calibration.

[0056] See also Figure 4 , Figure 4 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S12 in FIG. 1. In this embodiment, the number of infrared images is a first preset number of images, and the steps may include:

[0057] Step S121: acquiring a first preset number of groups of candidate parameters based on the plane position information corresponding to a plurality of preset points in a first preset number of infrared images and the spatial position information of the plurality of preset points in space.

[0058] In this embodiment, the first preset number can be 3 to 5, for example, 3, 4, 5. The first preset number can also be set to other values ​​according to actual conditions, and no specific limitation is made here. Based on the first preset number of infrared images, the first preset number of groups of plane position information can be obtained, so that the internal parameters of the imaging device can be calculated more accurately based on statistics.

[0059] Taking the first preset number as N and the number of preset points as 24 as an example, the plane position information corresponding to the preset points in the first infrared image can be obtained as P1{(xp1, yp1), (xp2, yp2), …, (xp 24 ,yp 24 )}, the plane position information corresponding to several preset points in the second infrared image can be recorded as P2{(xp1,yp1),(xp2,yp2),…,(xp 24 ,yp 24 )}, and so on, the plane position information corresponding to several preset points in the Nth infrared image can be recorded as P N {(xp1,yp1),(xp2,yp2),…,(xp 24 ,yp 24)}. In addition, the spatial position information of several preset points in the space can be recorded as Q{(xq1,yq1,zq1),(xq2,yq2,zq2),…,(xq 24 ,yq 24 ,zq 24 )}. Thus, we can respectively base on {P1,Q},{P2,Q},…,{P N ,Q}, and obtain N groups of candidate parameters corresponding to the internal parameters of the camera device.

[0060] Step S122: using a first preset number of groups of candidate parameters to determine internal parameters of the imaging device.

[0061] In an implementation scenario, each group of candidate parameters may include a first image center coefficient, a second image center coefficient, a first magnification coefficient, and a second magnification coefficient. After obtaining the first preset number of groups of candidate parameters, the average values ​​of the N first image center coefficients, the second image center coefficients, the first magnification coefficients, and the second magnification coefficients may be respectively counted as the first image center coefficient, the second image center coefficient, the first magnification coefficient, and the second magnification coefficient in the internal parameters of the imaging device.

[0062] In another implementation scenario, each set of candidate parameters includes a first distortion coefficient and a second distortion coefficient. Thus, the first distortion coefficient and the second distortion coefficient in the internal parameters are obtained based on statistics and iteration. Figure 5 , Figure 5 yes Figure 4 In the flowchart of step S122 of an embodiment, the first distortion coefficient and the second distortion coefficient in the internal parameters of the imaging device can be obtained by the following steps:

[0063] Step S51: obtaining a first numerical range between a minimum value and a maximum value of a first preset number of first distortion coefficients, and obtaining a second numerical range between a minimum value and a maximum value of a first preset number of second distortion coefficients.

[0064] Still taking the first preset number as N and the number of preset points as 24 as an example, the N first distortion coefficients can be recorded as KA = {ka1, ka2, ..., ka N}, the N second distortion coefficients can be recorded as KB = {kb1, kb2, ..., kb N}, where the minimum value of the N first distortion coefficients can be recorded as ka min , the maximum value among the N first distortion coefficients can be recorded as ka max , the minimum value of the N second distortion coefficients can be recorded as kb min , the maximum value among the N second distortion coefficients can be recorded as kb max .

[0065] Step S52: obtaining the ratio of the difference between the minimum and maximum values ​​in the first distortion coefficient to the first preset number as the first traversal step length, and obtaining the ratio of the difference between the minimum and maximum values ​​in the second distortion coefficient to the first preset number as the second traversal step length.

[0066] Still taking the first preset number as N and the number of preset points as 24 as an example, the first traversal step length can be expressed as:

[0067]

[0068] The second traversal step length can be expressed as:

[0069]

[0070] Step S53: Filtering first candidate distortion coefficients and second candidate distortion coefficients that meet preset conditions from the first numerical range and the second numerical range based on the first traversal step size and the second traversal step size, respectively, as the first distortion coefficients and the second distortion coefficients in the internal parameters of the imaging device.

[0071] In this embodiment, the preset condition can be that after the first distortion coefficient and the second distortion coefficient obtained by screening, and the first image center coefficient, the second image center coefficient, the first magnification coefficient and the second magnification coefficient in the internal parameters are corrected and projected, any four preset points on the image corresponding to the calibration carrier can form a parallelogram, and the any four preset points form a rectangle in the calibration carrier. For details, please refer to Figure 6 , Figure 6 yes Figure 5 The process diagram of step S53 in the embodiment of FIG. 1 is as follows:

[0072] Step S531: selecting first candidate distortion coefficients in sequence from the first numerical range based on the first traversal step size, and selecting second candidate distortion coefficients in sequence from the second numerical range based on the second traversal step size.

[0073] In this embodiment, based on the first traversal step length dka, the min ~ka max The first candidate distortion coefficient is selected from the first numerical range between and, based on the second traversal step size dkb, sequentially from kb min ~kb max In a specific implementation scenario, a first count value i can be set for the first candidate distortion coefficient, and a second count value j can be set for the second candidate distortion coefficient, and the initial values ​​of the first count value i and the second count value j are 0, so that the first candidate distortion coefficient kai and the second candidate distortion coefficient kb j Can be expressed as:

[0074] ka i =ka min +i*dka

[0075] kb j =kb min +j*dkb

[0076] In the above formula, each time the first count value i and the second count value j are selected, one of them can be increased by 1, so as to achieve iteration.

[0077] Step S532: using the first image center coefficient, the second image center coefficient, the first magnification coefficient, the second magnification coefficient and the first candidate distortion coefficient and the second candidate distortion coefficient in the internal parameters to perform correction processing and projection transformation on the infrared image to obtain a preprocessed image.

[0078] In this embodiment, the implementation steps of performing correction processing using the first image center coefficient, the second image center coefficient, the first magnification coefficient, the second magnification coefficient, and the first candidate distortion coefficient and the second candidate distortion coefficient in the internal parameters can refer to the relevant steps in the above embodiments, and this embodiment will not be repeated here.

[0079] Projection transformation, also known as perspective transformation or projective mapping, is to project the image onto a new viewing plane. Specifically, the following formula can be used for transformation:

[0080]

[0081] In the above formula, (u, v) is the coordinate in the original image, that is, the coordinate of the pixel in the image after correction processing in this embodiment. In addition, (x, y) is the coordinate of the corresponding pixel in the pre-processed image obtained after projection transformation, and the coordinate (x, y) can be expressed as follows:

[0082]

[0083] In addition, the transformation matrix It can be divided into 4 parts, among which, Represents linear transformations, such as scaling, shearing, and rotating. 31 a 32 ] for translation, [a 13 a 23 ]T Used to produce perspective transformation.

[0084] The above formula can be used to express the coordinates (x, y) in the preprocessed image as:

[0085]

[0086]

[0087] Step S533: Determine whether any four preset points forming a rectangle in the calibration carrier form a parallelogram in the preprocessed image. If yes, execute step S534; if no, execute step S535.

[0088] In practical applications, in order to improve robustness, a maximum allowable error may also be considered. If the error between the quadrilateral and the parallelogram formed by any four preset points forming a rectangle in the calibration carrier in the preprocessed image is within the maximum allowable error range, step S534 may be executed, otherwise, step S535 may be executed. Specifically, since the opposite sides of a parallelogram are parallel and equal, if the difference in the lengths of the opposite sides of the formed quadrilateral is within the first error value, and the angle between the extended lines of the opposite sides is within the second error value, it can be considered that the formed quadrilateral and the parallelogram are within a maximum allowable error.

[0089] Step S534: using the currently selected first candidate distortion coefficient and second candidate distortion coefficient as the first distortion coefficient and the second distortion coefficient in the internal parameters.

[0090] When any four preset points forming a rectangle in the calibration carrier form a parallelogram in the preprocessed image, the currently selected first candidate distortion coefficient and second candidate distortion coefficient can be determined as the first distortion coefficient and the second distortion coefficient in the internal parameters of the imaging device.

[0091] Step S535: Re-execute step S531 and subsequent steps.

[0092] When any four preset points that form a rectangle in the calibration carrier cannot form a parallelogram in the preprocessed image, the currently selected first candidate distortion coefficient and second candidate distortion coefficient cannot be used as the first distortion coefficient and the second distortion coefficient in the internal parameters of the camera device, and the first candidate distortion coefficient continues to be selected in sequence from the first numerical range based on the first traversal step, and the second candidate distortion coefficient continues to be selected in sequence from the second numerical range based on the second traversal step.

[0093] By flexibly setting the extreme values ​​of the parameters and traversing the step length, the first distortion parameter and the second distortion parameter are calculated in a statistical and iterative manner. Only one infrared image needs to be corrected and projected, so that the query speed and accuracy can be effectively controlled.

[0094] Furthermore, after obtaining the internal parameters of the imaging device, the following steps may be performed according to the actual application scenario to obtain the external parameters of the imaging device. Specifically:

[0095] Step S123: Correct the infrared image using the internal parameters to obtain a corrected image corresponding to the infrared image.

[0096] After obtaining the internal parameters of the imaging device, in order to continue to obtain the external parameters of the imaging device, the infrared image can also be corrected using the internal parameters to obtain a corrected image corresponding to the infrared image. The specific implementation steps of the correction process can refer to the relevant steps in the above embodiment, and this embodiment will not be repeated here.

[0097] Step S124: selecting a second preset number of preset points from the plurality of preset points, and obtaining spatial position information of the second preset number of preset points in space and plane position information of the second preset number of preset points in the corrected image.

[0098] In this embodiment, in order to simplify the subsequent external parameter acquisition process, the second preset number of preset points can be four vertices of the rectangle on the calibration carrier. Figure 2 , the second preset number of preset points can be Figure 2 In other implementation scenarios, other preset points that can form four vertices of a rectangle may also be used, and this embodiment does not make any specific limitation here.

[0099] Step S125: Calculate the projection relationship matrix between the spatial position information of a second preset number of preset points in the space and the planar position information in the corrected image as the external parameters of the imaging device.

[0100] Please continue to refer to Figure 2 , still Figure 2 Taking the second preset number of four preset points, namely piont01, piont02, piont03 and piont04, as an example, the plane position information P{P1, P2, P3, P4} of the four preset points in the rectified image and the corresponding spatial position information M{M1, M2, M3, M4} in the space can be used to calculate the projection relationship matrix between the two as the external parameters of the imaging device. Specifically, the following formula can be referred to:

[0101]

[0102] In the above formula, (X, Y, Z) is the spatial position information of the preset point in space, (x, y) is the plane position information of the preset point corresponding to the corrected image, That is the projection relationship matrix between the two.

[0103] After expanding the above formula, we can get the equation system about (X,Y,Z) and (x,y):

[0104]

[0105] Therefore, based on the second preset number of preset points, a second preset number of equation groups can be obtained, and then the unknown quantities in the equation groups, that is, the above-mentioned projection relationship matrix, can be solved.

[0106] Different from the above-mentioned embodiment, the external parameters of the imaging device can be obtained by using empirical point projection, that is, performing projection transformation on a second preset number of preset points, which can avoid complicated calculation processes and thus simplify the calculation method of the external parameters.

[0107] See also Figure 7 , Figure 7 1 is a flow chart of an embodiment of the image calibration method provided by the present invention. Specifically, the method may include the following steps:

[0108] Step S71: using the internal parameters of the imaging device to correct the visible light image captured by the imaging device to obtain a processed image.

[0109] In this embodiment, the internal parameters of the imaging device are obtained by the steps in any of the above calibration method embodiments. In addition, the specific steps of the correction process can refer to the above embodiments, which will not be repeated here.

[0110] In an implementation scenario, the internal parameters of the camera device may specifically include a first internal parameter of the camera device on the ground and a second internal parameter of the camera device on the non-ground, so the first internal parameter can be used to correct the visible light image to obtain a first processed image, and the second internal parameter can be used to correct the visible light image to obtain a second processed image. In a specific implementation scenario, the camera device can be a panoramic camera, and specifically, the panoramic camera can be integrated with multiple cameras arranged in opposite directions, and the multiple cameras correspond to a shooting direction respectively, so that the shooting range of the multiple cameras can cover 360 degrees. Multiple cameras can respectively shoot to obtain a visible light image, and corresponding to each shooting direction, the internal parameters include a first internal parameter corresponding to the ground and a second internal parameter corresponding to the non-ground, so for each shooting direction, the first internal parameter of the shooting direction can be used to correct the visible light image of the shooting direction to obtain the first processed image corresponding to the ground of the shooting direction, and the second internal parameter of the shooting direction can be used to correct the visible light image of the shooting direction to obtain the second processed image corresponding to the non-ground of the shooting direction. For example, a panoramic camera is used to collect images of a street to obtain visible light images in various shooting directions, and then, for the visible light images in various shooting directions, a correction process is performed on the visible light images using a first internal parameter corresponding to the shooting direction to obtain a first processed image corresponding to the ground in the corresponding shooting direction, and a correction process is performed on the visible light images using a second internal parameter to obtain a second processed image corresponding to the non-ground in the corresponding shooting direction.

[0111] Step S72: Performing a projection transformation on the processed image using the external parameters of the imaging device to obtain a texture image.

[0112] In this embodiment, the external parameters of the imaging device are obtained by the steps in any of the above calibration method embodiments. In addition, the specific steps of the projection transformation can refer to the above embodiments, which will not be repeated here.

[0113] In an implementation scenario, the external parameters of the imaging device may specifically include a first external parameter of the imaging device on the ground and a second external parameter on the non-ground. Therefore, the first external parameter can be used to perform a projection transformation on the first processed image to obtain a first texture image corresponding to the ground, and the second external parameter can be used to perform a projection transformation on the second processed image to obtain a second texture image corresponding to the non-ground. In a specific implementation scenario, when the imaging device is the above-mentioned panoramic camera, and corresponding to each shooting direction, the external parameters include a first external parameter corresponding to the ground and a second external parameter corresponding to the non-ground, so for each shooting direction, the first external parameter of the shooting direction can be used to perform a projection transformation on the first processed image of the shooting direction to obtain the first texture image of the shooting direction corresponding to the ground, and the second external parameter of the shooting direction can be used to perform a projection transformation on the second processed image of the shooting direction to obtain the second texture image of the shooting direction corresponding to the non-ground. Still taking the above-mentioned street image collection as an example, for each shooting direction, the first external parameter corresponding to the shooting direction can be used to perform a projective transformation on the first processed image in the current shooting direction to obtain a first texture image corresponding to the ground in the current shooting direction, and the second external parameter corresponding to the shooting direction can be used to perform a projective transformation on the second processed image in the current shooting direction to obtain a second texture image corresponding to the non-ground in the current shooting direction.

[0114] Step S73: Rendering is performed using the texture image to obtain a model corresponding to the current environment.

[0115] In an implementation scenario, a first texture image corresponding to the ground and a second texture image corresponding to the non-ground can be used for rendering to obtain a model corresponding to the current environment. In a specific implementation scenario, when the camera device is the above-mentioned panoramic camera, a first texture image corresponding to the ground in each shooting direction and a second texture image corresponding to the non-ground can be used for rendering to obtain a model corresponding to the current environment, and the model can cover 360 degrees of the current environment. Still taking the above-mentioned image acquisition of the street as an example, the first texture image corresponding to the ground in each shooting direction and the second texture image corresponding to the non-ground can be used for rendering to obtain a model of the street. Other application scenarios can be deduced by analogy, and examples are not given one by one here.

[0116] The above scheme uses the internal parameters of the camera device to correct the visible light image captured by the camera device to obtain a processed image, and uses the external parameters of the camera device to project the processed image to obtain a texture image, so that the texture image can be used to obtain a model corresponding to the current environment.

[0117] See also Figure 8 , Figure 88 is a schematic diagram of a framework of an embodiment of a calibration system 80 provided by the present invention. The calibration system 80 includes a calibration carrier 81, and a processor 82 and a camera device 83 coupled to each other. Figure 2 , a calibration carrier 81 is provided with a plurality of preset points, and an infrared transmitter 84 is provided at the preset points for transmitting infrared signals, and a processor 82 is used to execute program instructions to implement the steps in any of the above calibration method embodiments, or to implement the steps in any of the above image calibration method embodiments. In an implementation scenario, the processor 82 can be a processor in an electronic device such as a smart phone, a tablet computer, or a microcomputer, so that it can be connected to the camera device 83 through a data interface of the electronic device, or connected to the camera device 83 in a wired or wireless manner through a network interface of the electronic device, which is not limited here. In addition, in a specific implementation scenario, the processor 82 can also be integrated into the camera device 83.

[0118] Specifically, the processor 82 may also be referred to as a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip having the ability to process signals. The processor 82 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 82 may be implemented by a plurality of integrated circuit chips.

[0119] In this embodiment, the processor 82 is used to obtain an infrared image generated by the camera device collecting the infrared signal of the calibration carrier, wherein the infrared signal is emitted from a preset point of the calibration carrier, and a plurality of preset points are provided on the calibration carrier. Infrared transmitters are provided at the plurality of preset points for emitting infrared signals. The processor 82 is also used to determine the internal parameters and / or external parameters of the camera device based on the planar position information corresponding to the plurality of preset points in the infrared image, and the spatial position information of the plurality of preset points in space.

[0120] The above scheme, by setting a number of preset points on the calibration carrier, and providing infrared transmitters at the preset points for emitting infrared signals, can obtain an infrared image generated by the imaging device collecting the infrared signals emitted from the preset points of the calibration carrier, and based on the plane position information corresponding to the several preset points in the infrared image, as well as the spatial position information of the several preset points in space, determine the internal parameters and / or external parameters of the imaging device, thereby being able to obtain accurate plane position information without being interfered by natural conditions, thereby improving the accuracy of calibration.

[0121] In some embodiments, the number of infrared images is a first preset number of frames, and the processor 82 is further used to obtain a first preset number of groups of candidate parameters based on the planar position information corresponding to a number of preset points in each infrared image, and the spatial position information of the number of preset points in space. The processor 82 is also used to determine the internal parameters of the imaging device using the first preset number of groups of candidate parameters.

[0122] The processor 82 is also used to correct the infrared image using the internal parameters to obtain a corrected image corresponding to the infrared image. The processor 82 is also used to select a second preset number of preset points from a plurality of preset points, and obtain the spatial position information of the second preset number of preset points in the space and the plane position information in the corrected image. The processor 82 is also used to calculate the projection relationship matrix between the spatial position information of the second preset number of preset points in the space and the plane position information in the corrected image as the external parameters of the camera device. In an implementation scenario, the second preset number of preset points are the four vertices of a rectangle on the calibration carrier.

[0123] Different from the above-mentioned embodiment, the external parameters of the imaging device can be obtained by using empirical point projection, that is, performing projection transformation on a second preset number of preset points, which can avoid complicated calculation processes and thus simplify the calculation method of the external parameters.

[0124] In some embodiments, each group of candidate parameters also includes a first image center coefficient, a second image center coefficient, a first magnification coefficient, and a second magnification coefficient. The processor 82 is also used to respectively count the average values ​​of a first preset number of first image center coefficients, second image center coefficients, first magnification coefficients, and second magnification coefficients as the first image center coefficient, second image center coefficient, first magnification coefficient, and second magnification coefficient in the internal parameters of the imaging device.

[0125] In some embodiments, each group of candidate parameters includes a first distortion coefficient and a second distortion coefficient. The processor 82 is further used to obtain a first numerical range between a minimum value and a maximum value among a first preset number of first distortion coefficients, and to obtain a second numerical range between a minimum value and a maximum value among a first preset number of second distortion coefficients. The processor 82 is further used to obtain a ratio between a difference between a minimum value and a maximum value in the first distortion coefficient and the first preset number as a first traversal step length, and to obtain a ratio between a difference between a minimum value and a maximum value in the second distortion coefficient and the first preset number as a second traversal step length. The processor 82 is further used to screen first candidate distortion coefficients and second candidate distortion coefficients that meet preset conditions from the first numerical range and the second numerical range based on the first traversal step length and the second traversal step length, respectively, as the first distortion coefficient and the second distortion coefficient in the internal parameters of the imaging device.

[0126] Different from the above-mentioned embodiment, by flexibly setting the extreme values ​​of the parameters and traversing the step length, the first distortion parameter and the second distortion parameter are calculated in a statistical and iterative manner. Only one infrared image needs to be corrected and projected, so that the query speed and accuracy can be effectively controlled.

[0127] The processor 82 is also used to select the first candidate distortion coefficient in sequence from the first numerical range based on the first traversal step size, and to select the second candidate distortion coefficient in sequence from the second numerical range based on the second traversal step size. The processor 82 is also used to use the first image center coefficient, the second image center coefficient, the first magnification coefficient, the second magnification coefficient and the first candidate distortion coefficient, the second candidate distortion coefficient in the internal parameters to perform correction processing and projection transformation on the infrared image to obtain a preprocessed image. The processor 82 is also used to use the currently selected first candidate distortion coefficient and the second candidate distortion coefficient as the first distortion coefficient and the second distortion coefficient in the internal parameters when any four preset points forming a rectangle in the calibration carrier form a parallelogram in the preprocessed image.

[0128] In some embodiments, the calibration carrier includes a ground calibration plate and a side calibration plate connected at a preset angle, the ground calibration plate and the side calibration plate are respectively provided with a number of preset points, and infrared transmitters are respectively provided at the several preset points of the ground calibration plate and the side calibration plate, the internal parameters include a first internal parameter of the imaging device on the ground and a second internal parameter of the imaging device not on the ground, and the external parameters include a first external parameter of the imaging device on the ground and a second external parameter of the imaging device not on the ground.

[0129] Different from the aforementioned embodiments, the calibration carrier includes a ground calibration plate and a side calibration plate connected at a preset angle, the ground calibration plate and the side calibration plate are respectively provided with a number of preset points, and infrared transmitters are respectively provided at the preset points of the ground calibration plate and the side calibration plate, so that the position of each preset point in the space can be truly obtained. Compared with the previous plane calibration plate, the accuracy of actual calculation can be improved.

[0130] In some embodiments, the processor 82 is also used to use the internal parameters of the camera device to correct the visible light image captured by the camera device to obtain a processed image. The processor 82 is also used to use the external parameters of the camera device to perform a projection transformation on the processed image to obtain a texture image. The processor 82 is also used to render using the texture image to obtain a model corresponding to the current environment.

[0131] Different from the aforementioned embodiment, the visible light image captured by the imaging device is corrected by utilizing the internal parameters of the imaging device to obtain a processed image, and the processed image is projected and transformed by utilizing the external parameters of the imaging device to obtain a texture image, so that the texture image can be used to obtain a model corresponding to the current environment.

[0132] In some embodiments, the calibration carrier 81 includes a ground calibration plate and a side calibration plate connected at a preset angle (see Figure 3 ), the ground calibration plate and the side calibration plate are respectively provided with a plurality of preset points, and the plurality of preset points of the ground calibration plate and the side calibration plate are respectively provided with infrared emitters 84. In one implementation scenario, the preset angle may be 90 degrees to 135 degrees, for example, 90 degrees, 105 degrees, 120 degrees, 135 degrees, and the like.

[0133] In some embodiments, an infrared receiver 85 may be integrated into the camera device 83 to receive infrared signals.

[0134] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a storage device 90 provided by the present invention. The storage device 90 stores program instructions 91 that can be executed by a processor, and the program instructions 91 are used to implement the steps in any of the above calibration method embodiments, or to implement the steps in any of the above image calibration method embodiments.

[0135] The above scheme can improve the accuracy of calibration.

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

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

[0138] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

Claims

1. A calibration method, characterized in that: include: Acquire an infrared image generated by an imaging device collecting an infrared signal of a calibration carrier, wherein the infrared signal is emitted from a preset point of the calibration carrier, and the calibration carrier is provided with a plurality of preset points, and the plurality of preset points are provided with infrared transmitters for emitting the infrared signal; Based on the plane position information corresponding to the plurality of preset points in the infrared image, and the spatial position information of the plurality of preset points in space, the internal parameters and / or external parameters of the imaging device are determined; wherein the internal parameters include a first distortion coefficient and a second distortion coefficient characterizing radial distortion, the number of the infrared images is a first preset number of frames, and the internal parameters of the imaging device are determined based on the plane position information corresponding to the plurality of preset points in the infrared image, and the spatial position information of the plurality of preset points in space, including: Acquire the first preset number of groups of candidate parameters based on the plane position information corresponding to the plurality of preset points in each of the infrared images and the spatial position information of the plurality of preset points in space; The internal parameters of the camera device are determined by utilizing the candidate parameters of the first preset number group; wherein the first distortion coefficient of the camera device is determined by screening the first distortion coefficient that meets the preset conditions based on the ratio between the difference between the maximum value and the minimum value of the first distortion coefficient of the first preset number of the candidate parameters in the first preset number group and the first preset number, and the second distortion coefficient of the camera device is determined by screening the second distortion coefficient that meets the preset conditions based on the ratio between the difference between the maximum value and the minimum value of the second distortion coefficient of the first preset number of the candidate parameters in the first preset number group and the first preset number.

2. The calibration method according to claim 1, characterized in that: After determining the internal parameters of the imaging device based on the plane position information corresponding to the plurality of preset points in the first preset number of infrared images and the spatial position information of the plurality of preset points in space, the method further includes: Using the internal parameters to perform correction processing on the infrared image to obtain a corrected image corresponding to the infrared image; Selecting a second preset number of preset points from the plurality of preset points, and obtaining spatial position information of the second preset number of preset points in space and plane position information of the second preset number of preset points in the corrected image; A projection relationship matrix between the spatial position information of the second preset number of preset points in space and the planar position information in the corrected image is calculated as an external parameter of the imaging device.

3. The calibration method according to claim 2, characterized in that: The second preset number of preset points are four vertices of a rectangle on the calibration carrier.

4. The calibration method according to claim 1, characterized in that: Each group of candidate parameters includes a first image center coefficient, a second image center coefficient, a first magnification coefficient, and a second magnification coefficient. Determining the internal parameters of the camera device by using the first preset number of groups of candidate parameters includes: The average values ​​of the first preset number of the first image center coefficient, the second image center coefficient, the first magnification coefficient and the second magnification coefficient are respectively counted as the first image center coefficient, the second image center coefficient, the first magnification coefficient and the second magnification coefficient in the internal parameters of the imaging device.

5. The calibration method according to claim 1, characterized in that: Each group of candidate parameters also includes a first distortion coefficient and a second distortion coefficient, and the method further includes: Acquire a first numerical range between a minimum value and a maximum value of the first preset number of the first distortion coefficients, and acquire a second numerical range between a minimum value and a maximum value of the first preset number of the second distortion coefficients; Obtaining a ratio between a difference between a minimum value and a maximum value in the first distortion coefficient and the first preset number as a first traversal step length, and obtaining a ratio between a difference between a minimum value and a maximum value in the second distortion coefficient and the first preset number as a second traversal step length; Based on the first traversal step size and the second traversal step size, first candidate distortion coefficients and second candidate distortion coefficients meeting preset conditions are respectively selected from the first numerical range and the second numerical range as the first distortion coefficients and the second distortion coefficients in the internal parameters of the imaging device.

6. The calibration method according to claim 5, characterized in that: The first candidate distortion coefficient and the second candidate distortion coefficient that meet the preset conditions are selected from the first numerical range and the second numerical range based on the first traversal step size and the second traversal step size respectively, and the first distortion coefficient and the second distortion coefficient that are used as the internal parameters of the imaging device include: Selecting first candidate distortion coefficients in sequence starting from a minimum value in the first numerical range based on the first traversal step size, and selecting second candidate distortion coefficients in sequence starting from a minimum value in the second numerical range based on the second traversal step size; Using the first image center coefficient, the second image center coefficient, the first magnification coefficient, the second magnification coefficient, the first candidate distortion coefficient, and the second candidate distortion coefficient in the internal parameters to perform correction processing and projective transformation on the infrared image to obtain a preprocessed image; If any four preset points that form a rectangle in the calibration carrier form a parallelogram in the preprocessed image, the currently selected first candidate distortion coefficient and the second candidate distortion coefficient are used as the first distortion coefficient and the second distortion coefficient in the internal parameters.

7. The calibration method according to claim 1, characterized in that: The calibration carrier comprises a ground calibration plate and a side calibration plate connected at a preset angle, the ground calibration plate and the side calibration plate are respectively provided with the plurality of preset points, and the infrared emitters are respectively provided at the plurality of preset points of the ground calibration plate and the side calibration plate; The internal parameters include a first internal parameter of the imaging device on the ground and a second internal parameter of the imaging device not on the ground, and the external parameters include a first external parameter of the imaging device on the ground and a second external parameter of the imaging device not on the ground.

8. An image calibration method, characterized in that: include: Using internal parameters of the imaging device to correct the visible light image captured by the imaging device to obtain a processed image; Performing a projection transformation on the processed image using the external parameters of the imaging device to obtain a texture image; Rendering using the texture image to obtain a model corresponding to the current environment; Wherein, the internal parameters and the external parameters of the imaging device are obtained by the calibration method according to any one of claims 1 to 7.

9. A calibration system, characterized in that: It comprises a calibration carrier, and a processor and a camera device coupled to each other, wherein the calibration carrier is provided with a plurality of preset points, and an infrared transmitter is provided at the preset points for transmitting infrared signals, and the processor is used to execute program instructions to implement the calibration method described in any one of claims 1 to 7, or to implement the image calibration method described in claim 8.

10. The calibration system according to claim 9, characterized in that: The calibration carrier comprises a ground calibration plate and a side calibration plate connected at a preset angle, the ground calibration plate and the side calibration plate are respectively provided with the plurality of preset points, and the infrared emitters are respectively provided at the plurality of preset points of the ground calibration plate and the side calibration plate; And / or, the camera device is also integrated with an infrared receiver for receiving the infrared signal.