The content of the invention
The present invention proposes a kind of camera calibration method and system for lane shift early warning, when it can shorten demarcation
Between, improve the precision and operating efficiency of camera calibration.
For achieving the above object, the present invention provides a kind of camera calibration method for lane shift early warning, institute
The method of stating comprises the following steps:
The scaling board for including demarcation pattern is positioned over to the first position of vehicle front so that the scaling board
Axis is conllinear with vehicle body axis, carries out shooting to the scaling board by camera to be calibrated and obtains first
Uncalibrated image;
The scaling board is moved to the second place in front of headstock so that the axis of the scaling board and vehicle body axis
Collinearly, shooting is carried out to the scaling board by camera to be calibrated and obtains the second uncalibrated image;
The coordinate of the demarcation pattern acceptance of the bid fixed point is calculated according to first uncalibrated image and the second uncalibrated image
Value, is demarcated according to the coordinate value of the calibration point to the camera to be calibrated.
Further, it is described so that the demarcation in the above-mentioned camera calibration method for lane shift early warning
The axis of the plate step conllinear with vehicle body axis specifically includes:
Adjust the scaling board so that the scaling board is provided with the one side of demarcation pattern perpendicular to ground and the scaling board
Towards vehicle;
Adjust the horizontal level of the scaling board so that the axis of the scaling board is conllinear with vehicle axis.
Further, it is described so that the demarcation in the above-mentioned camera calibration method for lane shift early warning
Plate specifically includes perpendicular to the step of ground:
One air-bubble level is installed in the side of the scaling board;
Rotate the scaling board so that the center position of bubble in the air-bubble level.
Further, it is described so that the demarcation in the above-mentioned camera calibration method for lane shift early warning
Plate specifically includes perpendicular to the step of ground:
One sash weight of installation and iron ring, the sash weight are located at the surface of the iron ring in the middle part of the back side of the scaling board,
And the vertical line of the sash weight passes through the iron ring;
Rotate the scaling board so that the vertical line of the sash weight is placed exactly in the center of circle of the iron ring.
Further, in the above-mentioned camera calibration method for lane shift early warning, the adjustment demarcation
The horizontal level of plate so that the axis of the scaling board step conllinear with vehicle axis specifically includes:
Demarcation personnel on vehicle axis are simple eye to look squarely camera to be calibrated;
Adjust the horizontal level of the scaling board and demarcate the height of personnel's eyes so that the center of the scaling board is with being somebody's turn to do
Camera and eyes are conllinear.
Further, in the above-mentioned camera calibration method for lane shift early warning, the first position and car
The distance between headstock is less than the distance between the second place and vehicle headstock.
Further, in the above-mentioned camera calibration method for lane shift early warning, the demarcation pattern includes
Located at scaling board center center demarcating circle and be symmetrically set in center demarcation
Circle upper and lower the first demarcating circle group, the second demarcating circle group, the first demarcating circle group, the second demarcating circle group by
Set along scaling board length direction and some demarcating circles of equi-spaced apart form.
Further, it is described according to described first in the above-mentioned camera calibration method for lane shift early warning
The demarcation pattern acceptance of the bid fixed point is calculated in uncalibrated image and the second uncalibrated image
Coordinate value the step of specifically include:
Identify the circle of the demarcation pattern respectively according to first uncalibrated image and the second uncalibrated image, calculate
To the central coordinate of circle of the center demarcating circle and each demarcating circle of the first uncalibrated image and the second uncalibrated image.
Further, it is described to be calculated first in the above-mentioned camera calibration method for lane shift early warning
The step of central coordinate of circle of the center demarcating circle and each demarcating circle of uncalibrated image and the second uncalibrated image, specifically includes:
Take the demarcation at the demarcating circle at the first demarcating circle group both ends and the second demarcating circle group center in first uncalibrated image
The round center of circle is as calibration point;
Take the demarcation at the demarcating circle at the second demarcating circle group both ends and the first demarcating circle group center in second uncalibrated image
The round center of circle is as calibration point;
Calculate the coordinate value of above-mentioned calibration point.
In addition, the present invention also provides a kind of camera calibration system for lane shift early warning, it includes:
One includes the scaling board of demarcation pattern;
Mobile control unit, for moving the scaling board in the position of vehicle front, and cause in the scaling board
Axis is conllinear with vehicle axis;
Image acquisition units, for by camera before the scaling board moves and it is mobile after respectively to the scaling board
Shot, obtain the first uncalibrated image and the second uncalibrated image;And
Processing unit is demarcated, for the calibration maps to be calculated according to first uncalibrated image and the second uncalibrated image
The coordinate value of calibration point in case, and the camera to be calibrated is demarcated according to the coordinate value of the calibration point.
The position that the present invention is used for the camera calibration method of lane shift early warning and system passes through a mobile scaling board
Obtain two groups of calibration points, reduce the operand of image procossing and the parameter of manual measurement early stage, simplify demarcation place and
Step, the nominal time is shortened, so as to improve the precision of camera calibration and operating efficiency.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
The invention provides a kind of camera calibration method for lane shift early warning, comprise the following steps:
The scaling board for including demarcation pattern is positioned over to the first position of vehicle front so that the axis of the scaling board
Line is conllinear with vehicle axis, carries out shooting to the scaling board by camera to be calibrated and obtains the first uncalibrated image;Move
The scaling board is moved to the second place of vehicle front so that the axis of the scaling board is conllinear with vehicle axis, passes through
Camera to be calibrated carries out shooting to the scaling board and obtains the second uncalibrated image;According to first uncalibrated image and second
The coordinate value of the demarcation pattern acceptance of the bid fixed point is calculated in uncalibrated image, waits to mark to described according to the coordinate value of the calibration point
Fixed camera is demarcated.So, by two groups of calibration points of position acquisition of a mobile scaling board, image procossing is reduced
Operand and manual measurement early stage parameter, simplify place and the step of demarcation, shorten the nominal time, so as to improve
The precision and operating efficiency of camera calibration.
Referring to Fig. 1, Fig. 1 is the idiographic flow signal for the camera calibration method that the present invention is used for lane shift early warning
Figure;It the described method comprises the following steps:
Step S11:There is provided one and camera to be calibrated is installed(It is not shown)The parallel orbit 200 of vehicle 100 and two, institute
State two parallel orbits 200 and be symmetricly set in the both sides of vehicle 100;
Also referring to Fig. 1 and Fig. 2, in specific implementation, the camera to be calibrated is mountable to the car of vehicle 100
Head, that is, belong to the preceding viewing system of lane shift early warning, certainly, the camera to be calibrated is also mountable to the side of vehicle 100
Face, that is, belong to the side view system of lane shift early warning.In the present embodiment, the camera to be calibrated is installed on vehicle 100
Headstock.
For the ease of the subsequently shooting to scaling board and image procossing, it is necessary to by two parallel orbit 200 along the car
100 axis 300 is symmetrical arranged, that is, causes hanging down for the inner side of two parallel orbit 200 and four wheels of vehicle 100
Straight distance is equal.
Step S12:One scaling board 400 for including demarcation pattern is provided, the scaling board 400 is installed on vehicle front
Two parallel orbits 200 on first position;
Also referring to Fig. 1 to Fig. 3, in specific implementation, at least one side of scaling board 400 is provided with demarcation pattern, will
The scaling board 400 is installed on first position on two parallel orbits 200 of vehicle front, that is, causes two parallel orbit 200
Axis on the scaling board 400 is symmetrical.
It should be noted that before the scaling board 400 is installed, it is also necessary to measure visual in front of camera to be calibrated
Nearest ground from headstock with a distance from, its specific measuring method is:
One end of straight line body is attached on the windshield of camera position to be calibrated, along the axis of vehicle 100
Draw forward in the direction of line 300 so that the other end ground proximity of the straight line body, the stage casing of the straight line body are attached to vehicle 100
Headstock, and the straight line body keeps tightening straight, the distance by measuring the straight line body both ends can obtain in front of camera
Visual nearest ground from headstock with a distance from.
Step S13:Adjust the scaling board 400 so that the scaling board 400 is perpendicular to ground and the scaling board 400
Provided with demarcation pattern one facing to vehicle 100;Adjust the horizontal level of the scaling board 400 so that the scaling board 400
Axis is conllinear with vehicle axis 300;
In specific implementation, because there are regulation and the plate face of horizontal level in the both sides of the plate face of the scaling board 400 respectively
The angular adjustment of front and rear rotation, therefore, the scaling board 400 front and rear can be rotated to adjust the plate face of the scaling board 400 and ground
The angle in face, so that the scaling board 400 is provided with the one of demarcation pattern facing to vehicle perpendicular to ground and the scaling board 400
100, which reduces the error that the deviation because of calibration point under real-world coordinates on three dimensions is brought.
Refer to Fig. 3 and Fig. 4, in order to ensure the scaling board 400 is perpendicular to ground, two methods can be used, i.e., it is described
So that the scaling board 400 specifically includes perpendicular to the step of ground:
One air-bubble level 500 is installed in the side of the scaling board 400;
Rotate the scaling board 400 so that the center position of bubble in the air-bubble level 500.
It is or described so that the scaling board 400 specifically includes perpendicular to the step of ground:
One sash weight 600 of installation and iron ring 700, the sash weight 600 are located at the iron in the middle part of the back side of the scaling board 400
The surface of circle 700, and the vertical line of the sash weight 600 passes through the iron ring 700;
Rotate the scaling board 400 so that the vertical line of the sash weight 600 is placed exactly in the center of circle of the iron ring 700.
Ensureing the scaling board 400 behind ground, it is necessary to adjust the horizontal level of the scaling board 400, so that
The axis for obtaining the scaling board 400 is conllinear with vehicle axis 300.Method of principal axes is taken aim to realize using axis in the present embodiment
It is conllinear with vehicle axis 300 to state the axis of scaling board 400, i.e., the described axis for causing the scaling board 400 and vehicle
The conllinear step in axis 300 specifically includes:
Demarcation personnel on vehicle axis 300 are simple eye to look squarely camera to be calibrated;
Adjust the horizontal level of the scaling board 400 and demarcate the vertical height of personnel's eyes so that the scaling board 400
Center it is conllinear with the camera and eyes.
Or the vehicle is placed on to the centre position of a pair of guide rails, the distance that two wheels arrive track respectively is equal, institute
State the guide rail centre position that scaling board is arranged on vehicle front.
The above method ensure that the axis of the scaling board 400 is conllinear with vehicle axis 300, that is, in the vehicle
Vertical center line where axis 300 through the barycenter of the scaling board 400, eliminate the barycenter and car of measurement scaling board 400
This systematic parameter of the vertical range of axis 300, so as to improve the precision of measurement.
Step S14:Shooting is carried out to the scaling board 400 by camera to be calibrated and obtains the first uncalibrated image;
In specific implementation, before calibration mode is entered, first need to load vehicle shift early warning system demarcation configuration ginseng
Number(Including camera calibration configuration parameter), start the camera and initialized, the camera can be before collection vehicle
Fang Lukuang videos, the scaling board 400 can be shot by the camera, because the scaling board 400 is provided with demarcation
Therefore the one of pattern, can obtain the first uncalibrated image for including demarcation pattern, and preserve to system facing to vehicle 100
In depositing.
Step S15:The scaling board 400 is moved to the second place on two parallel orbits 200 of vehicle front so that institute
The axis for stating scaling board 400 is conllinear with vehicle axis 300;
In specific implementation, in the present embodiment, two parallel orbit 200 is connected with motor 800, and the motor 800 can
Two parallel orbits 200 are driven to be moved along its own orbital direction, so as to by the in front of the mobile vehicle of scaling board 400
Two positions, i.e., it is specific the step of the second place on the described movement scaling board 400 to two parallel orbits 200 of vehicle front
Including:
Drive two parallel orbit 200 to be moved along its own orbital direction by motor 800, drive the scaling board
400 are moved to the second place of vehicle front.
In above-mentioned moving process, keep constant due to the height of the scaling board 400 and with ground angle, therefore,
When the scaling board 400 is moved to the second place, without adjust scaling board 400 horizontal level and with ground angle, you can protect
The axis for demonstrate,proving the scaling board 400 is conllinear with vehicle axis 300.
It is of course also possible to the scaling board 400 is moved to the second place of vehicle front by manual method, but after movement
The operation to the repeat step S13 of scaling board 400 is needed, make it that the axis of the scaling board 400 is common with vehicle axis 300
Line.
It should be noted that the distance of the first position and the second place apart from vehicle 100 is not limited in the present invention, i.e.,
The scaling board 400 can be that relative vehicle 100 from the close-by examples to those far off moves or relative vehicle 100 draws near
Ground moves.
In the present embodiment, the relative vehicle 100 of scaling board 400 from the close-by examples to those far off moves, the first position with
The distance between vehicle headstock l1Less than the distance between the second place and vehicle headstock l2, i.e., described first position distance
Vehicle headstock is nearer, and the second place apart from vehicle headstock farther out.Specifically, the first position is apart from vehicle headstock l1
Scope be 0 ~ 10 meter, the second place is apart from the first position l2Scope be 0.5 ~ 10 meter.
Step S16:Shooting is carried out to the scaling board 400 by camera to be calibrated and obtains the second uncalibrated image;
In specific implementation, the scaling board 400 is shot by the camera, due to the scaling board 400
Provided with demarcation pattern one facing to vehicle 100, therefore, the second uncalibrated image for including demarcation pattern can be obtained, and preserve
Into Installed System Memory.
Step S17:It is fixed that the demarcation pattern acceptance of the bid is calculated according to first uncalibrated image and the second uncalibrated image
The coordinate value of point;
Referring to Fig. 5, in specific implementation, the demarcation pattern on the scaling board can be multiple regular figures, such as
Circle, cross, square etc..Included in the present embodiment using circle, the demarcation pattern located at the center at scaling board center
Demarcating circle(As shown in Fig. 3 black circles)And it is symmetrically set in the first demarcating circle group of the center demarcating circle upper and lower, second
Demarcating circle group, if the first demarcating circle group, the second demarcating circle group along scaling board length direction by setting and equi-spaced apart
Dry demarcating circle composition.
In the present embodiment, the first demarcating circle group, the second demarcating circle group set and waited by along scaling board length direction
Five demarcating circles composition away from interval, five demarcating circles of the first demarcating circle group are with 1,2,3,4,5 signs, second mark
Five demarcating circles of fixed circle group are with 6,7,8,9,10 signs;The radius all same of the center demarcating circle and ten demarcating circles.
, it is necessary to be marked to first uncalibrated image and second after first uncalibrated image and the second uncalibrated image is obtained
Determine image to be handled, the coordinate value of demarcation pattern acceptance of the bid fixed point is obtained with identification demarcation pattern and calculating.For example, this implementation
In example, it can use using the method for image procossing, pattern-recognition to improve the accuracy of detection identification, such as be filtered first using Gauss
Ripple smooth picture, adaptive binary conversion treatment removes ambient interferences, then carries out edge enhancing using Canny algorithms, then uses
Improvement type Hough loop truss algorithm carries out detection circle and its central coordinate of circle, then extracts demarcating circle using neighborhood processing cluster
Group, then further determine that the center of circle of demarcating circle group is sat using the peak value in histogram analysis circular image and trinder operators
The precision of sub-pixel is marked, to efficiently identify in the demarcation pattern for detecting first uncalibrated image and the second uncalibrated image
Demarcating circle and central coordinate of circle.
The step S17 is specifically included:
Identify the circle of the demarcation pattern respectively according to first uncalibrated image and the second uncalibrated image, calculate
To the central coordinate of circle of the center demarcating circle and each demarcating circle of the first uncalibrated image and the second uncalibrated image.
In the step S17 method can be taken to choose the mark in the first uncalibrated image and the second uncalibrated image using intersecting
The center of circle of fixed circle group calculates required calibration point as camera parameter calibration.It is i.e. described that the first uncalibrated image and is calculated
The step of central coordinate of circle of the center demarcating circles of two uncalibrated images and each demarcating circle, specifically includes:
Take the demarcation at the demarcating circle at the first demarcating circle group both ends and the second demarcating circle group center in first uncalibrated image
The round center of circle is as calibration point(1,5,8 demarcating circle is denoted as in Fig. 3, forms lower triangle);
Take the demarcation at the demarcating circle at the second demarcating circle group both ends and the first demarcating circle group center in second uncalibrated image
The round center of circle is as calibration point(3,6,10 demarcating circle is denoted as in Fig. 3, forms upward triangle);
Calculate the coordinate value of above-mentioned calibration point.
So, above-mentioned intersection takes a method can be before limited caliberating device plane space and limited calibration point quantity
Put, as much as possible include more picture pixels in the identification range of demarcation, different directions take point range to increase twice
Add the mutual distance of calibration point, so as to effectively control detection error, increase the reliability of system.
It should be noted that the present invention can also determine area-of-interest in image using automatic ROI localization methods(ROI,
Region Of Interest), the area-of-interest refers in image procossing(Compression of images, rotation, conversion etc.), it is right
Some specific regions(Determined according to specific rule or method)Abbreviation, exactly extracted in the image for wanting pending will
The region of processing.For example, having greenery and flower in a width picture, greenery are done with special processing(Rotation etc.), and these
Greenery are known as ROI.
Also referring to Fig. 6 and Fig. 7, the area-of-interest for determining camera(That is prewarning area)The step of I, is specific
Including:
According to the central coordinate of circle by the center demarcating circle and demarcating circle of first uncalibrated image and the second uncalibrated image
The center of circle carry out line;
The point intersected using the line is vanishing point, using the horizontal line where the vanishing point ordinate as vanishing point line, according to described
Vanishing point line determines the coboundary of the area-of-interest of the first uncalibrated image and the second uncalibrated image, especially, identified top
Boundary, can be in specific design as needed, on the basis of the vanishing point line of foregoing calculatings determination, in upper and lower certain distance
Region determines coboundary;First calibration maps are determined from the horizontal line where with a distance from headstock with visual ground recently in front of camera
The lower boundary of the area-of-interest of picture and the second uncalibrated image, so that it is determined that the sense of the first uncalibrated image and the second uncalibrated image is emerging
Interesting region, effectively to obtain the detection zone of lane shift early warning system within area-of-interest.
For example, setting in the first uncalibrated image two demarcation central coordinate of circle and being respectivelyWith, the second mark
Determining two demarcation central coordinate of circle of this in image is respectivelyWith,Line be,
Line be, then 、Linear equation can be described as
Intersection point be, i.e. vanishing point.
The area-of-interest of two groups of calibration points is so first determined according to the first uncalibrated image and the second uncalibrated image, thus
Reduce the operand of the image procossing of lane shift early warning system, improve the real-time performance of system.
Step S18:Perspective transformation matrix under each coordinate system is calculated according to the coordinate value of the calibration point, treated described in acquisition
The parameter of the camera of demarcation, to be demarcated to the camera to be calibrated.
In specific implementation, i.e., described step S18 is specifically included:
Carry out solving linear camera perspective using the Abdal-Aziz and Karara direct linear transformation's methods proposed
Transformation matrix, the matrix are oneRank matrix, representation space object point and the direct corresponding relation of two-dimentional picture point.It is if true
World coordinates, camera image coordinate, perspective transformation matrix is,
Then the relation between them is
, then it is decomposed into
In order that matrix is fixed, constraint, obtain
By n()The space coordinates of individual calibration point and corresponding image coordinate substitute into above formula, then can obtain 2n line
Property equation group, the form for being expressed as matrix are
Then
Above formula is solved to produce perspective transformation matrix 。
Further, because lane shift early warning system generally gives tacit consent to the lane line on detection ground, therefore detect often only
BeWhen ground XOY plane, soPerspective transformation matrixIt can deteriorate toThe ground world
Perspective transformation matrix of the coordinate system to image coordinate system, derivation is
Similarly, according to above-mentioned direct linear transformation's method, can obtainImage coordinate system to ground world coordinates
The perspective transformation matrix of system, so as to establish the pass mapped one by one of ground world coordinate system and camera image coordinate system
System, the determination for the prewarning area of lane shift early warning system provide theoretical foundation.
Further, the specific steps that the prewarning area that lane shift early warning system is given determines include:
Prewarning area under camera image coordinate system can be as most left where the ordinate of area-of-interest lower boundary
Alarm point and most right alarm point, vanishing point form delta-shaped region to determine, i.e., lane line is then alarmed within delta-shaped region(Such as
Shown in Fig. 6).
The abscissa of most left alarm point is carried out according to coordinate points of the alarming line in ground world coordinate system by perspective transform
Calculate.For example, set the intersection point of left alarming line and area-of-interest lower boundary as, under corresponding image coordinate system
Intersection point be, whereinDetermined by the actual range of alarming line(As shown in Figure 7),For the sense
The ordinate of the lower boundary of interest.
According toThe coordinate value of the most left alarm point under camera image coordinate is calculated.Similarly
The coordinate value of most right alarm point can be calculated.
In addition, referring to Fig. 8, the invention provides a kind of camera calibration system for lane shift early warning, it includes:
One includes scaling board 10, mobile control unit 20, image acquisition units 30 and the demarcation processing unit 40 of demarcation pattern, described
Mobile control unit 20 is used to move the scaling board 10 in the position of vehicle front, and causes the axis of the scaling board 10
It is conllinear with vehicle axis;Described image collecting unit 30 by camera before scaling board movement and after movement for being divided
It is other that the scaling board is shot, obtain the first uncalibrated image and the second uncalibrated image;The demarcation processing unit 40 is used for
The coordinate value of the demarcation pattern acceptance of the bid fixed point, Yi Jigen are calculated according to first uncalibrated image and the second uncalibrated image
The camera to be calibrated is demarcated according to the coordinate value of the calibration point.
Compared to prior art, the present invention is used for the camera calibration method of lane shift early warning and system passes through movement one
Two groups of calibration points of position acquisition of secondary scaling board, reduce the operand of image procossing and the parameter of manual measurement early stage, simplify
The place of demarcation and step, shorten the nominal time, so as to improve the precision of camera calibration and operating efficiency.
Here description of the invention and application are illustrative, are not wishing to limit the scope of the invention to above-described embodiment
In.The deformation and change of embodiments disclosed herein are possible, real for those skilled in the art
The replacement and equivalent various parts for applying example are known.It should be appreciated by the person skilled in the art that the present invention is not being departed from
Spirit or essential characteristics in the case of, the present invention can in other forms, structure, arrangement, ratio, and with other components,
Material and part are realized.In the case where not departing from scope and spirit of the present invention, embodiments disclosed herein can be entered
The other deformations of row and change.