Embodiment
Below in conjunction with embodiment, the present invention is described in detail.
The present invention includes following steps:
1) the vertical fault image by collecting obtains the calibration point on the general fault image and does not contain mapping relations between the virtual point of distortion, i.e. distortion formula, and set up one with the corresponding distortion correction enquiry form of distortion formula.Its concrete steps are as follows:
1. take the vertical fault image of scaling board: adopt one to have the scaling board of standard size and chequered with black and white grid, and this scaling board is vertically put upright, make its center perpendicular to the camera optical axis, the pitch angle of camera is 0 degree, takes the vertical image of scaling board then.
2. as shown in Figure 1, calibration point picks up: on the vertical image of scaling board, choose point that n black grid and white grid intersect as calibration point, i.e. and hollow dots among Fig. 1, and be (X with the coordinate record of all calibration points
d, Y
d).
3. as shown in Figure 2, set up virtual grid: according to the distortion in images degree, set up a virtual grid, the virtual point on it is corresponding one by one with calibration point.Virtual point is the ideal point that calibration point obtains through pinhole imaging system, and the virtual point coordinate record is (X
u, Y
u), it is not for containing the new coordinate points of distortion, i.e. Fig. 2 hollow core point.
4. calculate distortion formula: according to the characteristics of camera distortion, calibration point and virtual point satisfy the mapping relations of camera as can be known, both satisfied a high order surface equation, this curved surface can be described with 4 times or 5 times or 6 surface equations, empirical tests, 5 equation of n th order n can be accelerated computing velocity, therefore set up a quintic surface equation:
(1) a in the formula
iAnd b
i(i=0~18) are the parameter relevant with camera and camera lens.Calibration point (X
d, Y
d) and virtual point (X
u, Y
u) number to be n=(r+1) * (c+1) individual, wherein r is the number of the vertical grid of scaling board, c is the number of the horizontal grid of scaling board.With calibration point (X
d, Y
d) and virtual point (X
u, Y
u) coordinate substitution successively, try to achieve the coefficient a of equation
iAnd b
i, can try to achieve distortion formula.N=35 in the embodiments of the invention, so calibration point (X
d, Y
d)={ (X
D1, Y
D1) ..., (X
D35, Y
D35), virtual point (X
u, Y
u)={ (X
U1, Y
U1) ..., (X
U35, Y
U35).A then
iAnd b
iConcrete method for solving is as follows:
(1) first equation in the formula, X
u, Y
u, X
dAnd Y
dBe known, at first with a
iAs unknown number, then make X
c={ a
0... a
18}
TBe 18 dimensional vectors, again will with a
iThe item that multiplies each other is set up coefficient matrices A as coefficient.Because i=0~18 are so A is the n*19 matrix.At last with n X
uAs the right-hand member constant of equation, b={X
U1... X
Un, set up following Linear Equations thus:
AX
c=b (2)
In this example, be 35 because the demarcation of selecting on the scaling board is counted, substitution (1) formula can get 35 equations.And unknown number a
iOnly there are 19, therefore can form an overdetermined equation group by 35 equations.When finding the solution the overdetermined equation group, make its residual error r=b-AX
cThe 2-norm reach minimalization, can try to achieve the approximate solution of square error least meaning.Two ends in (2) formula are multiplied by the transposed matrix A of A
TCan get:
A
TAX
c=A
Tb (3)
Because A
TTherefore A is the symmetry square matrix on n rank, when R (A)=n, all there is Ay ≠ 0 any y ≠ 0, so,
As seen A
TA is a positive definite matrix, and det (A)>0 then must be arranged, so separating of equation (2) exists and unique.This system of equations is the normal equations group, so available square-root method or SOR (Successive Over Relaxation, successive overelaxation process of iteration) method solves very easily.
In like manner, the coefficient b of second equation in (1) formula
iAlso can use the above-mentioned a of finding the solution
iMethod try to achieve, be not repeated at this.
Distortion correction method of the present invention is actual to be to adopt repeatedly surface equation that the various distortion of camera lens are weighted on average, combine various distortion, and not needing to know the correlation parameter of camera lens, is a distortion correction method practical, simple to operation therefore.And the distortion correction method is basis of the present invention, and only on the basis of distortion correction, camera calibration just can obtain mapping relations accurately, and then backing track just can reflect on image really.
5. according to distortion formula, set up a distortion correction enquiry form.The distortion correction enquiry form is meant the enquiry form of new images point corresponding after fault image point and its correction.Utilize the distortion correction enquiry form, handling in the image process in real time, every two field picture be need not to do complicated Equation for Calculating at each point again, only need corresponding distortion correction enquiry form, the image coordinate that collects directly is interpolated into to send to show behind the new coordinate position gets final product.Like this can be so that calculated amount reduce a plurality of orders of magnitude, so the present invention can high-speed real-time operation on the DSP of lower cost (digital singnalprocessor, digital signal processor) processing platform.
2) the horizontal fault image by collecting obtains the mapping relations of road surface coordinate system and image coordinate system according to the distortion correction form, with information truth ground, the geometric position mapping of backing track under the coordinate system of road surface and be shown to image coordinate and fasten.It specifically may further comprise the steps:
1. take the horizontal fault image of scaling board, and set up as shown in Figure 3 a road surface coordinate system and as shown in Figure 4 an image coordinate system: identical scaling board in horizontal positioned and the step 1) on smooth road surface 1, the limit that black, the white grid on the scaling board is intersected is set at y, x direction respectively; Make along the wherein straight line of y direction to overlap, take the horizontal fault image of scaling board then with the camera optical axis center.The longitudinal axis of road surface coordinate system and X direction are respectively y, the x direction of setting; The transverse axis of image coordinate system and the longitudinal axis are respectively takes image two adjacent edges that obtain, and is respectively u axle and v axle.
2. according to the distortion correction enquiry form of trying to achieve in the step 1), the horizontal fault image of the scaling board that photographs is carried out distortion correction, do not contained scaling board horizontal image after the correction of distortion.
3. as shown in Figure 5, on scaling board horizontal image after the correction, promptly in image coordinate system, choose three the straight line L in left, center, right
L, L
CAnd L
RAs the reference line; Article three, straight line L
L, L
CAnd L
RHorizontal ordinate in the coordinate system of road surface is recorded as x respectively
L, x
CAnd x
R
4. as shown in Figure 5, at straight line L
COn choose point that m black grid and white grid intersect as calibration point, represent with hollow dots in the image that m calibration point is designated as v at the ordinate under the image coordinate system, and the ordinate under the coordinate system of road surface is designated as y.Try to achieve the mapping relations of v and y: according to the distortion correction enquiry form as can be known, the close of the axial road surface of camera light coordinate y and image coordinate v seemingly is the second-degree parabola relation, and is different para-curve in the different distance.Simultaneously according to the focal length of camera and the distance behind the required car of reversing, with straight line L
CBe divided into three sections according to v, every section all has parabolic equation separately:
With the straight line L that picks up
COn the above system of equations of m calibration point coordinate substitution, try to achieve the corresponding relation of v and y in the different phase.
5. at two straight line L
LAnd L
ROn, pick up a black grid and the point that white grid intersects respectively, calculate straight line L
LAnd L
RStraight-line equation under image coordinate system is respectively LINE
1And LINE
r
6. 1 p (x under the coordinate system of given road surface
p, y
p), with y
pSubstitution formula (4) is tried to achieve the v under the correspondence image coordinate system
p, with v
pSubstitution straight-line equation LINE
1And LINE
rIn, try to achieve the p point at straight line L
LAnd L
ROn abscissa value u
1And u
r, (x at this moment
p, y
p), (u
1, v
p) and (u
r, v
p) be positioned at in the delegation.According to the last three point (x of delegation
p, y
p), (u
1, v
p) and (u
r, v
p), try to achieve x, the relation between the u is as follows:
Try to achieve
3) utilize step 2) in the mapping relations of road surface coordinate system and image coordinate system, i.e. equation (4), with the reversing expection that the calculates backing track of advancing, the index wire of promptly moveing backward mapping also is shown to proofreaies and correct on the scaling board horizontal image of back, moves backward to guide the driver:
Because for same car, when its steering wheel angle changed, its equation of locus under the coordinate system of road surface also changed.And under image coordinate system, the change of steering wheel for vehicle corner is shown as the degree of crook of geometric locus and the variation of curve location.Can think that for the variation of image upper curve the u value on each row changes, consider that the driver only needs the environmental information in the rear view of vehicle certain distance when reversing.Therefore can calculate the general scope in image after the interior road surface imaging of this distance according to above-mentioned mapping relations, only in the image range of stipulating, the backing track of vehicle be shown.The backing track curve just becomes a line number of given image to the mapping of image like this, the extended line 2 that goes to ask backing track to be mapped to 2 left and right trailing wheels of vehicle on the image (be as graticule among Fig. 62 line), article 2, the u value of the expected trajectory index wire 3 of the left and right trailing wheel of vehicle (be as graticule among Fig. 63 line) on this row gets final product, and it specifically may further comprise the steps:
1. as shown in Figure 7, set up the reversing model under the coordinate system of road surface, i.e. the backing track equation: (x
L, y
L) be left side trailing wheel centre coordinate, (x
R, y
R) be the right side rear wheel centre coordinate, φ is a front axle center point corner, and L is the distance between front axle and the rear axle, and w is the distance between the two-wheeled of back, and then the backing track equation of vehicle is:
The left side trailing wheel:
Right side rear wheel:
And the extended line of left and right sides trailing wheel is:
Because the steering angle φ of front axle center point is known in the above-mentioned backing track equation, but in fact, the steering angle φ of front axle center point also is not easy to measure affirmation, therefore needs calculate with the steering angle α of the near front wheel and the steering angle β of off-front wheel.The present invention has adopted Ackermam corner method of geometry, and the pass of trying to achieve between the steering angle β of the steering angle α of the steering angle φ of front axle center point and the near front wheel and off-front wheel is:
The speed of front axle center point is:
(9) in the formula, v is the front axle center spot speed, and v ' is the front-wheel tangential velocity.In the demarcation of reality, can further locate the correction relationship of trying to achieve steering wheel angle λ and front axle center point corner φ, and set up the relational expression of the two with equation of linear regression by four-wheel:
φ=a·λ+b (12)
A wherein, b is constant, all can obtain in correction test.
Thus, can try to achieve the backing track equation that tallies with the actual situation under the coordinate system of road surface:
2. according to backing track equation and step 2) in the road surface coordinate system of trying to achieve and the mapping relations of image coordinate system, under the computed image coordinate system, the backing track scope that shows on the image: because the mapping relations of road surface coordinate system and image coordinate are calculated is to be based upon on the basis of image distortion correction, and the image behind the distortion correction can be thought approximate ideal pinhole imaging system model, therefore can calculate the location point of backing track on image directly according to the mapping relations of backing track under the coordinate of road surface and image coordinate system.Owing to only need on image, shine upon the backing track in the certain distance, therefore a maximum critical value y of backing track length under the coordinate system of given road surface
Max, substitution formula (2) calculates that the maximum along slope coordinate of backing track is v on the image
Max, then show the scope v of backing track on the image
Max~H
Img, H wherein
ImgHeight for image.
3. according to step 2) in the road surface coordinate system of trying to achieve and the mapping relations of image coordinate system, v under the computed image coordinate system
Max~H
ImgThe u value of each point correspondence, i.e. abscissa value on the backing track in the scope: at first, v in the computed image
iThe tracing point coordinate of row is with v
iSubstitution formula (4) is obtained the coordinate y under the corresponding road surface coordinate system
iThen, with y
iSubstitution formula (13) obtains that the track horizontal ordinate of left rear wheel and off hind wheel is respectively x under the coordinate system of road surface
IL, x
IRAnd the trajectory coordinates x of extended line
IeL, x
IeR, with the x coordinate x of these four tracing points
IL, x
IR, x
IeLAnd x
IeRIn the substitution formula (5), obtain the trajectory coordinates u of left rear wheel and off hind wheel under the image coordinate system
IL, u
IRWith extended line trajectory coordinates u
IeL, u
IeR
4. as shown in Figure 6, left rear wheel and off hind wheel tracing point that image coordinate system is discrete down adopt the curve fit method to couple together, and obtain level and smooth continuous vehicle extended line 2 and backing track index wire 3.