Disclosure of Invention
The invention aims to realize modeling and calibration of a combined optical system combining a vehicle-mounted camera lens and a windshield.
Furthermore, the present invention is also directed to solve or alleviate other technical problems of the prior art.
The present invention solves the above problems by providing a method, a system and a vehicle for joint calibration of a vehicle windshield and a camera lens, and in particular, according to an aspect of the present invention, there are provided:
a method for joint calibration of a windscreen and a camera lens of a vehicle, said camera lens being arranged behind said windscreen, wherein said method comprises the steps of:
s1: jointly modeling an optical system consisting of the windshield and the camera lens, wherein the joint modeling comprises
S11: establishing a three-dimensional rectangular coordinate system OXYZ, wherein an origin O is an optical center of the camera lens, a Z axis is an optical axis of the camera lens and points towards the direction of the vehicle head, an X axis and a Y axis are orthogonal to each other and a formed XOY plane is perpendicular to the Z axis,
s12: the windshield is assumed to be a flat plate having a uniform thickness H, a refractive index of constant n, smooth and parallel surfaces, and having an inclination angle with respect to an imaging plane of the camera lens,
s13: assuming that an object to be imaged has a distance L in the real physical world in the direction of the Z-axis with respect to the optical center of the camera lens,
s2: calculating displacement deviation of imaging pixel points of the object on the camera lens in any direction of the real physical world under the conditions of existence and absence of the windshield, wherein any direction is defined to be perpendicular to an optical axis of the camera lens and comprises
S21: the displacement deviation is calculated taking into account the refraction of the light by the windscreen,
s3: and realizing the joint correction of the optical system by using the original internal reference distortion correction of the camera lens and the obtained displacement deviation.
Optionally, according to an embodiment of the present invention, the displacement deviation includes a projection component displacement deviation Δ X in a direction of an X axis of an object plane described by a coordinate system X, Y, Z ═ L and/or a projection component displacement deviation Δ Y in a direction of a Y axis of the object plane, where X and Y are projection component coordinate values of the object on the X axis and the Y axis of the object plane in the real physical world without the windshield, respectively, and the calculation formulas are:
in the XOZ plane, under the condition that the windshield is not arranged, the object forms a conjugate image relative to the optical center of the camera lens, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is enabled to be thetaxzThe inclined angle between the glass plane of the windshield and the X axis is alphaxzWherein the glass plane is defined as a plane formed by the length and width of the windscreen (G),
in the YOZ plane, under the condition that the windshield is not arranged, the object forms a conjugate image relative to the optical center of the camera lens, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is enabled to be thetayzThe inclined angle between the glass plane of the windshield and the Y axis is alphayzWherein the glass plane is defined as a plane formed by the length and width of the windshield.
Optionally, in accordance with an embodiment of the invention, the camera lens has a focal length f,
the displacement deviation comprises a projection component displacement deviation Δ X in the direction of the X-axis of the image plane and/or a projection component displacement deviation Δ Y in the direction of the Y-axis of the image plane, which are described by a coordinate system X, Y, Z ═ f, wherein X and Y are projection component coordinate values of the object on the X-axis and Y-axis of the image plane without the windshield, respectively, and the calculation formulas are:
in the XOZ plane, under the condition that the windshield is not arranged, the object forms a conjugate image relative to the optical center of the camera lens, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is enabled to be thetaxzThe inclined angle between the glass plane of the windshield and the X axis is alphaxzWherein the glass plane is defined as a plane formed by the length and width of the windshield,
in the YOZ plane, under the condition that the windshield is not arranged, the object forms a conjugate image relative to the optical center of the camera lens, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is enabled to be thetayzThe inclined angle between the glass plane of the windshield and the Y axis is alphayzWherein the glass plane is defined as a plane formed by the length and width of the windscreen (G).
Alternatively, according to an embodiment of the present invention, the distance r 'of the object on the object plane with respect to the optical axis of the camera lens in consideration of the displacement deviation Δ X and the displacement deviation Δ Y is obtained by the following formula'o:
Wherein r isoIs the distance of the object in the real physical world in the object plane relative to the optical axis of the camera lens without the windscreen.
Alternatively, according to an embodiment of the present invention, the distance r 'of the object on the image plane with respect to the optical axis of the camera lens in consideration of the displacement deviation Δ x and the displacement deviation Δ y is obtained by the following formula'i:
Wherein r isiIs the distance of the image of the object in the image plane relative to the optical axis of the camera lens without the windscreen.
Optionally, in step S3, the result of the joint correction is obtained by multiplying the coordinate value of the imaging pixel after the original internal reference distortion correction of the camera lens by the ratio of the distance L to the focal length f of the camera lens, and adding the displacement deviation in step S2.
Optionally, according to an embodiment of the present invention, the method further includes step S4: performing iterative calibration on the joint modeling, wherein the iterative calibration comprises the following steps:
s41: taking a calibration reference image, the refractive index, the thickness and the inclination angle of the calibration glass and the distance L of the calibration reference image relative to the optical center of the camera lens C in the Z-axis direction as input;
s42: performing joint correction of the optical system through steps S2 and S3;
s43: calculating the internal reference of the camera by an internal reference calibration algorithm;
s44: calculating a reprojection error after internal reference calibration;
s45: determining whether the reprojection error is less than a threshold,
if so, S46: outputting the internal parameters of the camera and the refractive index, thickness and inclination angle of the calibration glass;
if not, S47: and adjusting the refractive index, the thickness and the inclination angle of the calibration glass, and re-executing the step S42.
According to another aspect of the present invention, the present invention provides a combined calibration system for a windshield and a camera lens of a vehicle, wherein the combined calibration system is configured to perform any one of the above methods, wherein the combined calibration system has an acquisition module, a calculation module and an execution module, which are in communication connection with each other, the acquisition module acquires the thickness H, the refractive index n, the inclination angle, the distance L, the internal parameters of the camera lens and outputs these parameters to the calculation module, the calculation module receives the output of the acquisition module and performs the combined correction of the optical system according to the method and outputs the result of the combined correction to the execution module, and the execution module acquires the result of the combined correction of the calculation module and outputs the result.
Optionally, according to an embodiment of the invention, the joint calibration system is configured in an ECU of the vehicle.
According to yet another aspect of the present invention, a vehicle is provided, wherein the vehicle has any of the above-described joint calibration systems.
The provided method, system and vehicle for jointly calibrating the windshield and the camera lens of the vehicle have the advantages that: through modeling analysis of a combined optical system of an in-vehicle camera and a windshield which are widely used in ADAS and automatic driving, a method for distortion correction according to camera internal parameters is optimized, accuracy of restoring a real world to 2D plane projection from an image coordinate system under a small-hole imaging model is improved, and a better foundation is laid for subsequent related processing such as computer stereo vision and multi-view geometry based on a projection geometry principle.
Detailed Description
It is easily understood that according to the technical solution of the present invention, a person skilled in the art can propose various alternative structures and implementation ways without changing the spirit of the present invention. Therefore, the following detailed description and the accompanying drawings are merely illustrative of the technical aspects of the present invention, and should not be construed as all of the present invention or as limitations or limitations on the technical aspects of the present invention.
The terms of orientation of up, down, left, right, front, back, top, bottom, and the like referred to or may be referred to in this specification are defined relative to the configuration shown in the drawings, and are relative terms, and thus may be changed correspondingly according to the position and the use state of the device. Therefore, these and other directional terms should not be construed as limiting terms. Furthermore, the terms "first," "second," "third," and the like are used for descriptive and descriptive purposes only and not for purposes of indication or implication as to the relative importance of the respective components.
Reference is made to fig. 1 and 2, which show a flow diagram of a method according to the invention and a modeling diagram of a method according to the invention, respectively.
The method is used for the joint calibration of a windshield G and a camera lens C of a vehicle, wherein the camera lens C is arranged behind the windshield G, and the method comprises the following steps:
s1: jointly modeling an optical system consisting of the windshield G and the camera lens C, wherein the optical system comprises
S11: establishing a three-dimensional rectangular coordinate system OXYZ, wherein an origin O is an optical center of the camera lens C, a Z axis is an optical axis of the camera lens C and points towards the direction of the vehicle head, an X axis and a Y axis are orthogonal to each other and a formed XOY plane is perpendicular to the Z axis,
s12: the windshield G is assumed to be a flat plate having a uniform thickness H, a constant refractive index n, smooth and parallel surfaces, and has an inclination angle with respect to the imaging plane of the camera lens C,
s13: assuming that an object to be imaged has a distance L in the real physical world in the direction of the Z-axis with respect to the optical center of the camera lens C,
s2: calculating the displacement deviation of the imaging pixel points of the object on the camera lens C in any direction of the real physical world under the conditions of the existence of the windshield G and the absence of the windshield G, wherein any direction is defined to be perpendicular to the optical axis of the camera lens C and comprises
S21: the displacement deviation is calculated taking into account the refraction of the light by the windshield G,
s3: and realizing the joint correction of the optical system by utilizing the original internal reference distortion correction of the camera lens C and the obtained displacement deviation.
It should be understood that the camera lens C is arranged behind the windshield G, viewed in the direction of the vehicle head, so that light rays emitted by an object to be observed in the real physical world need to be refracted by the windshield G before being collected by the camera lens C (e.g., its CMOS), and thus distortion correction performed only for the distortion of the camera itself cannot solve the problem of additional distortion caused by refraction of the windshield G. The camera may be an in-vehicle or in-vehicle camera.
The person skilled in the art knows the rules for establishing a rectangular coordinate system in three dimensions, an example of which can be seen in fig. 2. For example, the X-axis and the Y-axis may be the height direction and the width direction of the vehicle, respectively, and the Y-axis is directed outward in fig. 2. Where the point R is a coordinate point of the object in the real physical world, and has coordinate values X, Y, Z (Z ═ L), θxzAnd thetayzAs will be described later. In the present method, since the distance L has been assumed, only the displacement deviation on the plane perpendicular to the L direction needs to be considered. Further, the air refractive index may be set to approximately 1. And the imaging plane of the camera lens C is a plane vertical to the Z axis. In addition, "the coordinate point of the object in the real physical world" does not necessarily mean that the object necessarily needs to be in the objective real physical world to apply the method. But rather, only coordinate data reflecting the position of the object in the real physical world may be obtained. That is, the method can also be used in conjunction with other sensors (e.g., radars) that detect coordinate data of an object from the front-end radar and use it as an input to the method.
In addition, it should be noted that the numbering or naming of the steps herein does not represent the order of the steps, but merely for convenience of description. The order of execution of the steps may be varied, or even performed simultaneously, without significant conflict between steps.
Through the technical scheme, not only the intrinsic lens distortion of the camera due to the intrinsic properties (such as light converging of the convex lens and light diverging of the concave lens) is considered, but also the distortion influence caused by the refraction of the light by the windshield of the vehicle is considered, and the combined distortion correction of the whole optical system is realized. The resulting correction can be output to appropriate software or algorithms for subsequent processing, such as computer stereo vision and multi-view geometry.
The displacement deviation in the plane perpendicular to the L direction is exemplified herein by the displacement deviation in the X-axis and Y-axis directions exemplarily. Reference is made to fig. 3 and 4, which show a schematic representation of X-axis displacement deviation and a schematic representation of Y-axis displacement deviation, respectively, according to one method of the invention. In particular, the displacement deviation comprises a projection component displacement deviation Δ X in the direction of the X-axis of the object plane OP described in the coordinate system X, Y, Z ═ L and/or a projection component displacement deviation Δ Y in the direction of the Y-axis of the object plane OP. X and Y are projection component coordinate values of the object on the X axis and the Y axis of the real physical world on the object plane OP without the windshield G, respectively.
The reflection of the light reflected by the object through the windshield G can be seen. In the XOZ plane, under the condition that the windshield G is not arranged, the object forms a conjugate image x relative to the optical center of the camera lens C, and the object inclination angle of a connecting line Xx of the conjugate image and the object relative to the Z axis is thetaxzThe inclined angle between the glass plane of the windshield G and the X axis is alphaxzWherein the glass plane is defined as a plane formed by the length and width of the windshield G, f is the focal length of the camera lens, βxzIs an angle of incidence of line Xx at the glass plane, from point A into the glass plane, through'xzExits from point B on the opposite side after refraction as an angle of refraction at the glass plane. X' is a virtual image of an imaging pixel point of the object on the camera lens C in the real physical world after displacement deviation, dxzIs the distance between the BX' line and the xX line.
Fig. 4 can also be similarly interpreted. Wherein, in a YOZ plane, the object is relative to the camera lens without the windshield GC forms a conjugate image y with the optical center, and the object inclination angle of the connecting line Yy of the conjugate image and the object relative to the Z axis is thetayzThe inclined angle between the glass plane of the windshield G and the Y axis is alphayzWherein the glass plane is defined as a plane formed by the length and width of the windshield G, f is the focal length of the camera lens, βyzIs an angle of incidence of line Yy at the glass plane, incident into the glass plane from point A, via β'yzExits from point B on the opposite side after refraction as an angle of refraction at the glass plane. Y' is a virtual image of an imaging pixel point of the object on the camera lens C in the real physical world after displacement deviation, dyzIs the distance between the BY' line and the yY line.
The following expressions can be made from fig. 3:
dxz=AB*Sin(βxz-β′xz) Wherein, in the step (A),ABi.e. the distance of the points a and B,
Sinβxz=nSinβ′xz,
βxz=αxz-θxz,
thus, the displacement deviation Δ X is calculated by the formula:
similarly, the following expression can be made from FIG. 4:
dyz=AB*Sin(βyz-β′yz),
Sinβyz=nSinβ′yz,
βyz=αyz-θyz,
thus, the displacement deviation Δ Y is calculated by the formula:
after knowing the displacement deviation, the distortion compensation caused by the refraction of light by the windshield G can be realized by mapping the corresponding point position on the object plane by the point position on the image plane for application to the real physical world.
It is noted that the displacement deviation on the object plane OP is taken as an example in the present description, however, similarly, the present invention may also be implemented by displacement deviation on the image plane IP, for which reference is made to fig. 5, which shows a schematic diagram of the X-axis displacement deviation according to another method of the present invention.
In the method described above, the derivation is performed by taking an image plane point corresponding to two object plane points as an example, and in the method, the derivation is performed by taking an object plane point corresponding to two image plane points as an example. The principle is similar and therefore will not be described in detail.
In this method, the displacement deviation comprises a projection component displacement deviation Δ X in the direction of the X-axis of the image plane IP and/or a projection component displacement deviation Δ Y in the direction of the Y-axis of the image plane IP, which are described in a coordinate system X, Y, Z ═ -f, where X and Y are projection component coordinate values of the object on the X-axis and Y-axis of the image plane IP without the windshield G, respectively,
the formula is also used here:
Δx=-(f/L)*ΔX,
therefore, the calculation formula is:
wherein, in the XOZ plane, under the condition of not having the windshield G, the object forms a conjugate image relative to the optical center of the camera lens C, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is thetaxzThe inclined angle between the glass plane of the windshield G and the X axis is alphaxzWherein the glass plane is defined as a plane formed by the length and width of the windshield G,
and/or
Similarly, the calculation formula of the projection component displacement deviation Δ y is as follows:
wherein, in the YOZ plane, under the condition of not having the windshield G, the object forms a conjugate image relative to the optical center of the camera lens C, and the object inclination angle of the connecting line of the conjugate image and the object relative to the Z axis is thetayzThe inclined angle between the glass plane of the windshield G and the Y axis is alphayzWherein the glass plane is defined by the barrierThe length and width of the windshield G.
Referring to FIG. 6, a schematic diagram illustrating the principle of distance calculation from the origin for imaging an object under X-axis and Y-axis displacement bias according to one method of the present invention is shown. Wherein r isoIs the distance R' of the object from the origin X-0, Y-0, Z-L to the point R (i.e. where the object is located) of the object plane OP without the windshield G.oWhen the displacement deviation Δ X and the displacement deviation Δ Y are considered, the virtual image of the object is R ', X and Y are coordinate values of the object in the real physical world on the X axis and the Y axis, respectively, R is a distance between the object in the real physical world and the original point X of the camera lens object plane, Y is 0, Z is L, phi is an angle between a connecting line of the point R and the original point and the X axis, and phi ' is an angle between a connecting line of the point R ' and the original point and the X axis. This gives:
the following formula is finally obtained:
similarly, the distance r 'of the object from the optical axis of the camera lens C on the image plane IP in consideration of the displacement deviation Δ x and the displacement deviation Δ y'i:
Wherein r'iThe object is under the condition of considering the displacement deviation delta x and the displacement deviation delta yA distance, r, on the image plane IP relative to an optical axis of the camera lens CiIs the distance of the image of the object in the image plane relative to the optical axis of the camera lens C without the windscreen G.
The specific implementation manner of step S3 may be: the coordinate value of the imaging pixel point after the original internal reference distortion correction of the camera lens C is multiplied by the ratio of the distance L to the focal length f of the camera lens C, and the displacement deviation in the step S2 is added to obtain the result of the joint correction. In this example, the respective coordinate values after the distortion correction of the camera lens are x 'and y'. This makes it possible to obtain:
wherein x' ═ x; y ═ y. Thereby completing the distortion correction of the optical system combining the camera lens and the windshield.
In order to further improve the modeling accuracy of the method and the accuracy of the result of the distortion correction, the method may further include step S4: and carrying out iterative calibration on the combined modeling. Referring specifically to fig. 7, a flow diagram of iterative calibration according to one method of the present invention is shown.
S41: taking a calibration reference image, the refractive index, the thickness and the inclination angle of the calibration glass, and the distance L of the calibration reference image relative to the optical center of the camera lens C in the Z-axis direction as input;
s42: performing joint correction of the optical system through steps S2 and S3;
s43: calculating the internal reference of the camera by an internal reference calibration algorithm;
s44: calculating a reprojection error after internal reference calibration;
s45: determining whether the reprojection error is less than a threshold,
if so, S46: outputting the internal parameters of the camera and the refractive index, thickness and inclination angle of the calibration glass;
if not, S47: and adjusting the refractive index, the thickness and the inclination angle of the calibration glass, and re-executing the step S42.
It should be understood that a calibration reference image, i.e. a standardized reference image dedicated to camera lens calibration, having known coordinate values, may typically be used with a calibration plate. For example, a calibration board having a plurality of constituent matrices is used to represent respective positions of objects on the real physical world, and the calibration room formed by the calibration board is three-dimensional, and particularly, a sufficient number of and dense calibration boards are arranged on the front side, the left side, and the right side of the camera lens for comprehensively calibrating the camera lens. The calibration glass is the reference glass used for checking the physical parameters of the glass in the method.
Step S42 is used to convert the calibration reference image into an image without the influence of the windshield G. And calibrating the internal reference of the camera according to the existing calibration algorithm. The algorithm may be, for example, a gnomon scaling method. The reprojection error in S44 is the difference between two projections, where the first projection is the projection of a three-dimensional space point onto an image plane when the camera takes a picture or records a video. Then, the images are used for carrying out triangulation positioning on the characteristic points, a triangle is constructed by using geometric information to determine the position of the three-dimensional space point, and finally, the calculated three-dimensional point coordinates and the calculated camera pose are used for carrying out secondary projection (namely, re-projection). At this time, the difference between the projection of the real three-dimensional space point on the image plane (i.e., the pixel point on the image) and the re-projection (the virtual pixel point obtained by the previous calculation). The smaller this difference, the better. And when the reprojection error is smaller than a threshold value, outputting the internal parameters of the camera, the refractive index, the thickness and the inclination angle of the calibration glass as the input of the method, and realizing a more excellent comprehensive distortion correction effect.
Referring to FIG. 8, a block schematic diagram of a joint calibration system 100 according to the present invention is shown. Since the specific shape and connection of the various components are not the subject of the present invention, all of the components are schematically shown in the form of structural modules for the sake of clarity and conciseness, and those skilled in the art can select the appropriate module shape and connection mode at will based on the teaching of the structural diagram. In addition, the structural diagram is given as an embodiment of the invention, and those skilled in the art can make various modifications without departing from the spirit of the invention after referring to the diagram, and the modifications are also within the scope of the invention.
The joint calibration system 100 is used for a windshield G and a camera lens C of a vehicle, wherein the joint calibration system 100 is configured to execute any one of the above methods, wherein the joint calibration system 100 has an acquisition module 1, a calculation module 2 and an execution module 3 which are in communication connection with each other, the acquisition module 1 acquires the thickness H, the refractive index n, the inclination angle, the distance L, and the internal parameters of the camera lens C and outputs these parameters to the calculation module 2, the calculation module 2 receives the output of the acquisition module 1 and executes joint correction of the optical system according to the method and outputs the result of the joint correction to the execution module 3, and the execution module 3 acquires the result of the joint correction of the calculation module 2 and outputs the result. For a review of the description of the method above, reference is made to the embodiments and features of the system.
It should additionally be mentioned that the joint calibration system 100 may be built into the ECU (also referred to as electronic control unit, running computer) of the vehicle. This makes it possible to seamlessly integrate the method and system without affecting the existing structure of the vehicle.
In addition, the combined calibration system can be arranged on various vehicles, including gasoline vehicles, diesel vehicles, cars, trucks, passenger cars, hybrid vehicles, pure electric vehicles and the like. Accordingly, the subject matter of the present invention is also intended to protect various vehicles equipped with the joint calibration system 100 of the present invention.
In summary, the present invention provides a model for joint modeling of an optical system composed of an optical lens of a camera and glass, where the model describes, through analysis of refractive characteristics of the glass, a relationship of an object in the real world imaged on the lens (such as a CMOS) with and without a windshield, or conversely, a relationship of any point on the lens corresponding to incident light rays at different angles and positions in the real world with and without a windshield, and based on such a corresponding relationship, internal parameters of the original camera can be corrected after the windshield is added.
It should be understood that all of the above preferred embodiments are exemplary and not restrictive, and that various modifications and changes in the specific embodiments described above, which would occur to persons skilled in the art upon consideration of the above teachings, are intended to be within the scope of the invention.