The present disclosure relates to the field of image processing technology, in particular to a method and a device for building a camera imaging model, and an automated driving system for a vehicle.
Usually, an imaging system of a camera consists of lenses and an image sensor. An imaging procedure is very complex, so there are many distortions between a real physical space and a digital image space, e.g., a distortion of an aspect ratio (caused by different sampling intervals of the image sensor), a distortion of planar perspective projection (caused by an imaging angle) and an optical distortion (caused by a distortion of the lenses). For a conventional imaging system, its distortions are acquired by superimposing linear distortions and nonlinear distortions, and these distortions form a camera imaging model. During the calibration of the camera, unknown parameters are calculated in accordance with the camera imaging model. It is able to, merely through the camera imaging model, describe a conversion relationship between the digital image space (i.e., a digital image coordinate system) and the real physical space (i.e., a world coordinate system) as follows: Image (x,y)<<P(a, b, c . . . )<<World(X,Y,Z).
In the above formula, World(X,Y,Z) represents three-dimensional coordinate values (X,Y,Z) of a certain spatial point in the world coordinate system, Image(x,y) represents two-dimensional coordinate values (x,y) of the digital image coordinate system, P represents the camera imaging model, and a, b, c . . . represent parameters in the camera imaging model. During the calibration of the camera, the parameters a, b, c . . . are solved after the camera imaging model P has been determined. For a certain spatial point in the world coordinate system, the digital image coordinates of the spatial point may be acquired in accordance with the three-dimensional coordinates of the spatial point and the camera imaging model.
Different imaging models may be adopted by different imaging systems (e.g., imaging systems of a fisheye camera, an underwater camera, a wide-viewing-angle camera and a narrow-viewing-angle camera). After the imaging models have been built, the parameters in these models (called as interior and exterior parameters of the cameras) are calculated during the calibration, so as to finally acquire the interior and exterior parameters for describing the imaging systems. The accuracy of the description about the imaging system directly depends on the camera imaging model.
There are such problems in the related art where the calibration of the camera is relatively slow due to an unscientific imaging model, and the camera imaging system is described inaccurately through the interior and exterior parameters acquired after the calibration.
An object of the present disclosure is to provide a method and a device for building a camera imaging model, and an automated driving system for a vehicle, so as to solve the problem in the related art where the camera imaging system is described inaccurately through the interior and exterior parameters acquired after the calibration due to the unscientific imaging model.
In one aspect, the present disclosure provides in some embodiments a method for building a camera imaging model, including: converting world coordinate values of a random point P into camera coordinate values of a target camera in accordance with a predetermined mode; converting the camera coordinate values into image coordinate values of the target camera; and converting the image coordinate values into digital image coordinate values and building the camera imaging model. The converting the image coordinate values into the digital image coordinate values includes performing a spatial sampling operation on the random point P, and adjusting coordinate values of an origin to image coordinate values through the following formula:
where ku=1/dx, kv=1/dy, dx and dy represent a horizontal sampling interval and a longitudinal sampling interval of an image sensor of the target camera respectively, (u0,v0) represents a translational amount between two origins in an image coordinate system and a digital image coordinate system, (x,y) represents the image coordinate values of the random point P, and (u,v) represents the digital image coordinate values of the random point P.
In another aspect, the present disclosure provides in some embodiments a device for building a camera imaging model, including: a first conversion module configured to convert world coordinate values of a random point P into camera coordinate values of a target camera in accordance with a predetermined mode; a second conversion module configured to convert the camera coordinate values into image coordinate values of the target camera; and a building module configured to convert the image coordinate values into digital image coordinate values and build the camera imaging model. The building module is further configured to perform a spatial sampling operation on the random point P, and adjust coordinate values of an origin to image coordinate values through the following formula:
where ku=1/dx, kv=1/dy, dx and dy represent a horizontal sampling interval and a longitudinal sampling interval of an image sensor of the target camera respectively, (u0,v0) represents a translational amount between two origins in an image coordinate system and a digital image coordinate system, (x,y) represents the image coordinate values of the random point P, and (u,v) represents the digital image coordinate values of the random point P.
In yet another aspect, the present disclosure provides in some embodiments an automated driving system for a vehicle, including the above-mentioned device.
Usually, in the case that an optical distortion of a lens is not taken into consideration, the world coordinate values of a spatial point on an object are capable of being converted into the digital image coordinate values through four steps, i.e., the conversion from the world coordinate values (Xw,Yw,Zw) into the camera coordinate values (Xc,Yc,Zc), the conversion from the camera coordinate values into normalized image coordinate values (xu,yu), the conversion from the normalized image coordinate values into the image coordinate values (x,y), and the conversion from the image coordinate values into the digital image coordinate values (u,v). In actual case, the influence of the optical distortion of the lens and a tangential distortion of the image sensor on the imaging may also be taken into consideration. Hence, the world coordinate values of the spatial point on the object may be converted into the digital image coordinate values through five steps, i.e., the world coordinate values—the camera coordinate values—the normalized image coordinate values—distorted normalized image coordinate values—the image coordinate values—the digital image coordinate values. A building procedure of the camera imaging model is complex and the imaging may be adversely affected by the distortion. In the embodiments of the present disclosure, the above five conversion steps are optimized, and a tangential distortion model is built in accordance with a rotating coordinate system when the imaging coordinate values are converted into the digital image coordinate values, so it is able to build the camera imaging model in an accurate and rapid manner.
In order to illustrate the technical solutions of the present disclosure or the related art in a clearer manner, the drawings desired for the present disclosure or the related art will be described hereinafter briefly. Obviously, the following drawings merely relate to some embodiments of the present disclosure, and based on these drawings, a person skilled in the art may obtain the other drawings without any creative effort.
In order to make the objects, the technical solutions and the advantages of the present disclosure more apparent, the present disclosure will be described hereinafter in a clear and complete manner in conjunction with the drawings and embodiments. Obviously, the following embodiments merely relate to a part of, rather than all of, the embodiments of the present disclosure, and based on these embodiments, a person skilled in the art may, without any creative effort, obtain the other embodiments, which also fall within the scope of the present disclosure.
An imaging procedure of a camera will be described as follows. A light beam from an object passes through a lens and imaged on an image plane. An optical signal is converted by an image sensor (e.g., a Charge Coupled Device (CCD)) into an electric signal. The electric signals are amplified and adjusted, and then converted into a digital image through sampling and quantification. Then, the digital image is output through a data output unit.
In the case that the optical distortion of the lens is not taken into consideration, the world coordinate values of the spatial point on the object are capable of being converted into the digital image coordinate values through four steps, i.e., the conversion from the world coordinate values (Xw,Yw,Zw) into the camera coordinate values (Xc,Yc,Zc), the conversion from the camera coordinate values into the normalized image coordinate values (xu,yu), the conversion from the normalized image coordinate values into image coordinate values (x,y), and the conversion from the image coordinate values into digital image coordinate values (u,v).
In actual case, the influence of the optical distortion of the lens and a tangential distortion of the image sensor on the imaging may also be taken into consideration. Hence, the world coordinate values of the spatial point on the object may be converted into the digital image coordinate values as shown in
The present disclosure provides in some embodiments a method for building a camera imaging model which, as shown in
The converting the image coordinate values into the digital image coordinate values includes performing a spatial sampling operation on the random point P, and adjusting coordinate values of an origin to image coordinate values through the following formula:
where ku=1/dx, kv=1/dy, dx and dy represent a horizontal sampling interval and a longitudinal sampling interval of an image sensor of the target camera respectively, (u0,v0) represents a translational amount between two origins in an image coordinate system and a digital image coordinate system, (x,y) represents the image coordinate values of the random point P, and (u,v) represents the digital image coordinate values of the random point P.
In the embodiments of the present disclosure, in Step S101, the world coordinate values of the random point P may be converted into the camera coordinate values of the target camera as follows:
where (Xw,Yw,Zw) represents the world coordinate values of the random point P, (Xc,Yc,Zc) represents the camera coordinate values of the point P,
represents a rotation matrix, and
represents a translation vector. A position and a direction of the camera in a world coordinate system have been described in the above conversion formula, and the rotation matrix R and the translation vector t are collectively called as exterior parameters of the camera.
As shown in
where sϕ represents a sine of ϕ, and cϕ represents a cosine of ϕ. The rotation matrix R may be expressed as follows:
Step S103 of converting the camera coordinate values into the image coordinate values of the target camera may include the following conversion procedures as shown in
1. A conversion procedure from the camera coordinate values to normalized image coordinate values
The conversion procedure from the camera coordinate values to the normalized image coordinate values may be mathematically expressed as follows:
where (xu,yu) represents ideal normalized image coordinate values of the random point P, and (Xc,Yc,Zc) represents the corresponding camera coordinate values of the random point P. A normalized image plane is actually an image plane perpendicular to an optical axis and spaced apart from a lens center by a unit distance. Point coordinate values on the normalized image plane are aurally homogeneous coordinate values of the random point P in the three-dimensional camera coordinate system. An origin of the normalized image coordinate system is an intersection between the optical axis and the normalized image plane.
2. A conversion procedure from the normalized image coordinate values to distorted normalized image coordinate values
The optical distortion mainly occurs during the transmission protection conversion, and it is a non-linear conversion procedure. The optical distortion may be mathematically expressed as follows:
where (xd,yd) represents distorted normalized image coordinate values of the random point P, (xu,yu) represents ideal normalized image coordinate values of the random point P, and k1, k2 and k3 represent radial distortion coefficients of the lens respectively.
As shown in
3. A conversion procedure from the distorted normalized image coordinate values to the image coordinate values
This conversion procedure may be mathematically expressed as follows:
where (x,y) represents image coordinate values of the spatial point P, (xd, yd) represents the distorted normalized image coordinate values of the spatial point P. The normalized image plane is actually an image plane perpendicular to the optical axis and spaced apart from the lens center by an image distance f, where f represents a focal length of the lens), and the origin of the image plane coordinate system is an intersection between the optical axis and the normalized image plane. The reason why the image distance v for an imaging point is approximately represented by the focal length f of the lens lies in that an operating distance (i.e., an object distance) of the imaging system is far greater than the focal length f.
In Step S105, the image coordinate values may be converted into the digital image coordinate values, and then the camera imaging model may be built.
The image coordinate values may be converted into the digital image coordinate values through performing a spatial sampling operation on the random point P, and adjusting coordinate values of the origin to image coordinate values through the following formula:
where ku=1/dx, kv=1/dy, dx and dy represent a horizontal sampling interval and a longitudinal sampling interval of an image sensor of the target camera respectively, (u0,v0) represents a translational amount between two origins in an image coordinate system and a digital image coordinate system, (x,y) represents the image coordinate values of the random point P, and (u,v) represents the digital image coordinate values of the random point P.
Actually, due to a manufacture process of the camera, it is impossible for a plane where the image sensor is located to completely coincide with an ideal image plane, so there is a tangential distortion between the two coordinate systems, as shown in
where φ represents a tangential distortion angle between the image coordinate system and the digital image coordinate system, and a counter-clockwise direction is positive.
In a word, the five conversion procedures in
Through the above steps, the camera imaging model may be expressed as:
where s represents a scaling factor and has a value of 1/Zc, the formula (a) is used to describe the conversion from the world coordinate values to the normalized image coordinate values, the formula (b) is used to describe the conversion from the normalized image coordinate values to the distorted normalized image coordinate values, k1, k2 and k3 represent radial distortion coefficients of the lens respectively, the formula (c) is used to describe the conversion from the distorted normalized image coordinate values to the digital image coordinate values, matrix A represents an exterior parameter of the camera and includes five degrees of freedom, i.e., two components of scaling, one components of rotation and two components of translation.
The present disclosure further provides in some embodiments a device for building a camera imaging model which, as shown in
where ku=1/dx, kv=1/dy, dx and dy represent a horizontal sampling interval and a longitudinal sampling interval of an image sensor of the target camera respectively, (u0,v0) represents a translational amount between two origins in an image coordinate system and a digital image coordinate system, (x,y) represents the image coordinate values of the random point P, and (u,v) represents the digital image coordinate values of the random point P.
In a possible embodiment of the present disclosure, the first conversion module 80 includes a rotation module (not shown) configured to rotate a world coordinate system OwXwYwZw of the random point P about its X-axis, Y-axis and Z-axis, and translate the origin to Oc, so as to acquire a camera coordinate system OcXcYcZc, where (Xw,Yw,Zw) represents the world coordinate values of the random point (Xc,Yc,Zc) represents the camera coordinate values of the random point P, Ow represents the origin of the random point P in the world coordinate system, and Oc represents the origin of the random point P in the camera coordinate system.
In a possible embodiment of the present disclosure, the second conversion module 82 includes: a first conversion submodule (not shown) configured to convert the camera coordinate values into normalized image coordinate values; a second conversion submodule (not shown) configured to convert the normalized image coordinate values into distorted normalized image coordinate values; and a third conversion submodule (not shown) configured to convert the distorted normalized image coordinate values into the image coordinate values.
The present disclosure further provides in some embodiments an automated driving system for a vehicle, which includes the above-mentioned device. The vehicle can be, e.g., an automobile such as a bus, a car, or a truck.
Usually, apart from the four conversion procedures, i.e., the conversion from the world coordinate values (Xw,Yw,Zw) into the camera coordinate values (Xc,Yc,Zc), the conversion from the camera coordinate values into normalized image coordinate values (xu,yu), the conversion from the normalized image coordinate values into the image coordinate values (x,y), and the conversion from the image coordinate values into the digital image coordinate values (u, v), the optical distortion of the lens and the tangential distortion of the image sensor may also be taken into consideration, so the camera imaging model may be built through the five conversion procedures. Through the optimization of the five conversion procedures, it is able to build the tangential distortion model in accordance with the rotating coordinate system when the imaging coordinate values are converted into the digital image coordinate values, thereby to build the camera imaging model in an accurate and rapid manner.
The above embodiments are for illustrative purposes only, but the present disclosure is not limited thereto. Obviously, a person skilled in the art may make further modifications and improvements without departing from the spirit of the present disclosure, and these modifications and improvements shall also fall within the scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2018 1 0823524 | Jul 2018 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
20050089213 | Geng | Apr 2005 | A1 |
Number | Date | Country | |
---|---|---|---|
20200034987 A1 | Jan 2020 | US |