Summary of the invention
In order to solve problems in the prior art, the present invention provides a kind of camera calibrations for pilotless automobile
Method and apparatus.Technical solution is as follows:
In a first aspect, the present invention provides a kind of method of camera calibration for pilotless automobile, the method
Include:
Default working face is acquired by video camera, obtains image, described image includes known to the first known point and second
Point;
In described image, image pixel coordinates system is established;
According to the optical axis and described image of the video camera, camera coordinate system is established;
It determines the first position relationship between the camera coordinate system and world coordinate system, is closed according to the first position
System, determines the outer parameter of the video camera;
Obtain first known point and second known point respectively the first coordinate in the world coordinate system and
Second coordinate;
Determine the second position relationship between the camera coordinate system and described image pixel coordinate system;
According to first coordinate, second coordinate and the second position relationship, the internal reference of the video camera is determined
Number.
In a kind of possible design, the optical axis and described image according to the video camera establishes camera coordinates
System, comprising:
The optical axis center for obtaining the video camera, using the optical axis center as origin, with the horizontal direction right of described image
To for X-axis positive direction, to be parallel to the optical axis of the video camera, and it is directed toward by the video camera side of the default working face
The camera coordinates are established to for Z axis positive direction with direction is Y-axis positive direction perpendicular to described image, and straight up
System.
It is described that the outer parameter of the video camera is determined according to the first position relationship in a kind of possible design, packet
It includes:
Determine any first position point of described image in institute by following formula one according to the first position relationship
State the relationship of the coordinate and coordinate of the first position point in the camera coordinate system in world coordinate system:
Formula one:
Wherein, MoutFor the outer parameter of the video camera, (Xw, Yw, Zw) for described image any first position point in institute
State the coordinate in world coordinate system, (Xc, Yc, Zc) it is coordinate of the first position point in the camera coordinate system, R is
Spin matrix, p are translation matrix.
In a kind of possible design, between the determination camera coordinate system and described image pixel coordinate system
Second position relationship, comprising:
Image physical coordinates system is established, determines between described image pixel coordinate system and described image physical coordinates system
Three positional relationships;
According to the third place relationship, by following formula two, determine that any second position point in described image exists
The relationship of coordinate and coordinate of the second position point in the camera coordinate system in described image pixel coordinate system:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in described image pixel coordinate system in described image,
(Xc, Yc, Zc) it is coordinate of the second position point in the camera coordinate system, kxFor the first amplification coefficient, kyIt is second
Amplification coefficient, (u0, v0) it is coordinate of the coordinate origin of described image physical coordinates system in described image pixel coordinate system.
It is described to be closed according to first coordinate, second coordinate and the second position in a kind of possible design
System, determines the intrinsic parameter of the video camera, comprising:
According to first coordinate, second coordinate and the second position relationship, obtained known to described first respectively
Point and third coordinate and 4-coordinate of second known point in described image pixel coordinate system;
According to first coordinate, second coordinate, the third coordinate and the 4-coordinate, pass through following formula
Three, determine the intrinsic parameter of the video camera:
Formula three:
Wherein, (Xw1, Yw1, 0) and it is first coordinate of first known point in the world coordinate system, (Xw2, Yw2, 0)
For second coordinate of second known point in the world coordinate system, (u1, v1) it is first known point in described image
Third coordinate in pixel coordinate system, (u2, v2) it is second known point 4-coordinate in described image pixel coordinate system.
Second aspect, the present invention provides a kind of device of camera calibration for pilotless automobile, described devices
Include:
Acquisition module obtains image, described image includes known to first for acquiring default working face by video camera
Point and the second known point;
First establishes module, for establishing image pixel coordinates system in described image;
Second establishes module, for the optical axis and described image according to the video camera, establishes camera coordinate system;
First determining module, for determining the first position relationship between the camera coordinate system and world coordinate system,
According to the first position relationship, the outer parameter of the video camera is determined;
Module is obtained, for obtaining first known point and second known point respectively in the world coordinate system
The first coordinate and the second coordinate;
Second determining module, for determining the second between the camera coordinate system and described image pixel coordinate system
Set relationship;
Third determining module, for determining according to first coordinate, second coordinate and the second position relationship
The intrinsic parameter of the video camera.
In a kind of possible design, described second establishes module, is also used to obtain the optical axis center of the video camera, with
The optical axis center is origin, using the direction horizontally to the right of described image as X-axis positive direction, to be parallel to the light of the video camera
Axis, and being directed toward the direction of the default working face by the video camera is Z axis positive direction, with perpendicular to described image, and it is perpendicular
Straight upward direction is Y-axis positive direction, establishes the camera coordinate system.
In a kind of possible design, first determining module is also used to according to the first position relationship, by with
Lower formula one determines coordinate of any first position point of described image in the world coordinate system and the first position point
The relationship of coordinate in the camera coordinate system:
Formula one:
Wherein, MoutFor the outer parameter of the video camera, (Xw, Yw, Zw) for described image any first position point in institute
State the coordinate in world coordinate system, (Xc, Yc, Zc) it is coordinate of the first position point in the camera coordinate system, R is
Spin matrix, p are translation matrix.
In a kind of possible design, second determining module, comprising:
First determination unit determines described image pixel coordinate system and described image for establishing image physical coordinates system
The third place relationship between physical coordinates system;
Second determination unit, for being determined in described image according to the third place relationship by following formula two
Coordinate of any second position point in described image pixel coordinate system and the second position point are in the camera coordinate system
In coordinate relationship:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in described image pixel coordinate system in described image,
(Xc, Yc, Zc) it is coordinate of the second position point in the camera coordinate system, kxFor the first amplification coefficient, kyIt is second
Amplification coefficient, (u0, v0) it is coordinate of the coordinate origin of described image physical coordinates system in described image pixel coordinate system.
In a kind of possible design, the third determining module, comprising:
Acquiring unit, for being obtained respectively according to first coordinate, second coordinate and the second position relationship
The third coordinate and 4-coordinate of first known point and second known point in described image pixel coordinate system;
Third determination unit, for according to first coordinate, second coordinate, the third coordinate and the described 4th
Coordinate determines the intrinsic parameter of the video camera by following formula three:
Formula three:
Wherein, (Xw1, Yw1, 0) and it is first coordinate of first known point in the world coordinate system, (Xw2, Yw2, 0)
For second coordinate of second known point in the world coordinate system, (u1, v1) it is first known point in described image
Third coordinate in pixel coordinate system, (u2, v2) it is second known point 4-coordinate in described image pixel coordinate system.
In the present invention, the image that computer is shot by obtaining video camera establishes camera coordinate system, image pixel
Coordinate system and image physical coordinates system obtain the first coordinate of the first known point and the second known point in world coordinate system respectively
With the third coordinate and 4-coordinate of the second coordinate and the first known point and the second known point in image pixel coordinates system,
It will substitute into the formula determined according to the positional relationship between camera coordinate system, world coordinate system and image pixel coordinates system,
The outer parameter and intrinsic parameter that the video camera can be found out, are omitted cumbersome calculating process, simple to operation, improve video camera mark
Fixed working efficiency.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
The embodiment of the invention provides a kind of method of camera calibration for pilotless automobile, the execution of this method
Main body can be computer, and computer can be car-mounted terminal.
Referring to Fig. 1, this method comprises:
Step 101: default working face being acquired by video camera, obtains image, image includes the first known point and second
Known point.
Step 102: in the images, establishing image pixel coordinates system.
Step 103: according to the optical axis and image of video camera, establishing camera coordinate system.
Step 104: the first position relationship between the camera coordinate system and world coordinate system is determined, according to this first
Relationship is set, determines the outer parameter of the video camera.
Step 105: obtain first known point and second known point respectively the first coordinate in world coordinate system and
Second coordinate.
Step 106: determining the second position relationship between the camera coordinate system and the image pixel coordinates system.
Step 107: according to first coordinate, second coordinate and the second position relationship, determining the intrinsic parameter of video camera.
Optionally, according to the optical axis of video camera and image, camera coordinate system is established, comprising:
The optical axis center for obtaining video camera, using optical axis center as origin, using the direction horizontally to the right of image as X-axis pros
To, to be parallel to the optical axis of video camera, and be Z axis positive direction by the direction that video camera is directed toward default working face, with perpendicular to
Image, and direction is Y-axis positive direction straight up, establishes camera coordinate system.
Optionally, according to first position relationship, the outer parameter of video camera is determined, comprising:
Determine any first position point of described image in institute by following formula one according to the first position relationship
State the relationship of the coordinate and coordinate of the first position point in the camera coordinate system in world coordinate system:
Formula one:
Wherein, MoutFor the outer parameter of video camera, (Xw, Yw, Zw) it is any first position point of image in world coordinate system
In coordinate, (Xc, Yc, Zc) it is coordinate of the first position point in camera coordinate system, R is spin matrix, and p is translation matrix.
Optionally, the second position relationship between camera coordinate system and image pixel coordinates system is determined, comprising:
Image physical coordinates system is established, determines that the third place between image pixel coordinates system and image physical coordinates system is closed
System;
According to the third place relationship, by following formula two, determine any second position point in image in image pixel
The relationship of coordinate and coordinate of the second position point in camera coordinate system in coordinate system:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in image pixel coordinates system in image, (Xc, Yc, Zc)
For coordinate of the second position point in camera coordinate system, kxFor the first amplification coefficient, kyFor the second amplification coefficient, (u0, v0) be
Coordinate of the coordinate origin of image physical coordinates system in image pixel coordinates system.
Optionally, according to the first coordinate, the second coordinate and second position relationship, the intrinsic parameter of video camera is determined, comprising:
According to the first coordinate, the second coordinate and second position relationship, the first known point is obtained respectively and the second known point exists
Third coordinate and 4-coordinate in image pixel coordinates system;
Video camera is determined by following formula three according to the first coordinate, the second coordinate, third coordinate and 4-coordinate
Intrinsic parameter:
Formula three:
Wherein, (Xw1, Yw1, 0) and it is first coordinate of first known point in world coordinate system, (Xw2, Yw2, 0) and it is second
Know the second coordinate a little in world coordinate system, (u1, v1) it is third coordinate of first known point in image pixel coordinates system,
(u2, v2) it is the second known point 4-coordinate in image pixel coordinates system.
In the embodiment of the present invention, the image that computer is shot by obtaining video camera establishes camera coordinate system, figure
As pixel coordinate system and image physical coordinates system, the of the first known point and the second known point in world coordinate system is obtained respectively
The third coordinate and the 4th of one coordinate and the second coordinate and the first known point and the second known point in image pixel coordinates system
Coordinate will substitute into the public affairs determined according to the positional relationship between camera coordinate system, world coordinate system and image pixel coordinates system
In formula, the outer parameter and intrinsic parameter of the video camera can be found out, cumbersome calculating process is omitted, it is simple to operation, it improves and takes the photograph
The working efficiency of camera calibration.
The embodiment of the invention provides a kind of method of camera calibration for pilotless automobile, the execution of this method
Main body can be computer, and computer can be car-mounted terminal.
Referring to fig. 2, this method comprises:
Step 201: computer acquires default working face by video camera, obtains image, which includes known to first
Point and the second known point.
It should be noted that default working face is the working face of the intrinsic parameter for determining video camera and outer parameter,
Include at least two position known points in default working face, is referred to as the first scene point and the second scene point.Camera light
Axis is vertical with the default working face, and the position of camera position and the default working face is fixed, and is shot by video camera
The default working face, obtains image;Computer obtains the image from the video camera.
Wherein, the first scene point, the second scene point in working face are preset and respectively corresponds the first known point in the image
With the second known point.
Step 202: in the images, computer establishes image pixel coordinates system.
Referring to Fig. 3, computer obtains image top left corner apex o0, with top left corner apex o0For image pixel coordinates system
Coordinate origin, using direction horizontally to the right as the u axis positive direction of image pixel coordinates system, using direction vertically downward as image
The v axis positive direction of pixel coordinate system, establishes image pixel coordinates system uo0v。
Further, since the position for presetting working face and video camera is fixed, the computer acquisition preset plane is being taken the photograph
After image in camera, camera coordinate system need to be first established, according to the positional relationship of camera coordinate system and world coordinate system, really
The outer parameter for determining video camera is realized especially by following steps 203-204.
Step 203: computer establishes camera coordinate system according to the optical axis and the image of video camera.
Specifically, computer obtains the optical axis center of video camera, using optical axis center as origin, with the horizontal direction right of image
It to be parallel to the optical axis of video camera, and is that Z axis is square by the direction that video camera is directed toward default working face to for X-axis positive direction
To with perpendicular to image, and direction is Y-axis positive direction straight up, establishes camera coordinate system.
For the ease of being distinguished with subsequent world coordinate system, the X-axis, Y-axis and Z axis of camera coordinate system are claimed respectively
For XcAxis, YcAxis and ZcAxis;The X-axis, Y-axis and Z axis of world coordinate system are referred to as XwAxis, YwAxis and ZwAxis.
Referring to fig. 4, computer obtains the optical axis center O of the video cameracAnd pass through camera light axis center OcLight
Axis, optical axis center OcThe center of lens i.e. in the video camera, computer is with OcFor the origin of camera coordinate system, with the water of image
Flat right direction is the X of camera coordinate systemcAxis positive direction to be parallel to the optical axis of video camera, and is directed toward by video camera and is preset
The direction of working face is the Z of camera coordinate systemcAxis positive direction, with direction is video camera perpendicular to image, and straight up
The Y of coordinate systemcAxis positive direction establishes camera coordinate system OcXcYcZc。
Referring to fig. 4, computer obtains the optical axis of video camera and the intersection point O of default working facew, obtain the camera coordinates
The X of systemcAxis positive direction, YcAxis positive direction, ZcAxis positive direction chooses OwFor the origin of world coordinate system, camera coordinate system is chosen
XcAxis positive direction, YcAxis positive direction, ZcAxis positive direction is the X of world coordinate systemwAxis positive direction, YwAxis positive direction, ZwAxis is square
To determining world coordinate system OwXwYwZw。
Wherein, the X in camera coordinate systemcAxis, YcAxis is respectively parallel to the X in world coordinate systemwAxis, YwAxis, video camera
Z in coordinate systemcZ in axis and world coordinate systemwAxis is on camera optical axis, and direction is consistent.
Step 204: computer determines the first position relationship between camera coordinate system and world coordinate system, according to first
Positional relationship determines the outer parameter of video camera.
It should be noted that since camera optical axis is perpendicular to default working face, and video camera and default working face
Position immobilizes, and therefore, the outer parameter of video camera determines, step 204 can be with are as follows:
Computer determines any first position point of described image by following formula one according to the first position relationship
In the relationship of coordinate and coordinate of the first position point in the camera coordinate system in the world coordinate system:
Formula one:
Wherein, MoutFor the outer parameter of video camera, (Xw, Yw, Zw) it is any first position point of image in world coordinate system
In coordinate, (Xc, Yc, Zc) it is coordinate of the first position point in camera coordinate system, R is spin matrix, and p is translation matrix.
It should be noted that the outer parameter of video camera is imaged for describing position of the video camera in world coordinate system
The first position relationship of machine coordinate system and world coordinate system, since camera coordinate system and world coordinate system determine, camera shooting
The outer parameter of machine determines, specifically, the X known to step 203 in camera coordinate systemcAxis, YcAxis is respectively parallel to world coordinates
X in systemwAxis, YwAxis, and the X in camera coordinate systemcAxis, YcX in axis and world coordinate systemwAxis, YwAxis direction is consistent, takes the photograph
Z in camera coordinate systemcZ in axis and world coordinate systemwAxis is on camera optical axis, and direction is consistent, therefore, video camera
Outer parameterWherein, R is spin matrix,P is translation
Matrix, p=[00d], d are distance of the optical axis center to working face.
Therefore, coordinate (X of any first position point in world coordinate system in image can be obtainedw, Yw, Zw) and first
Set the coordinate (X a little in camera coordinate systemc, Yc, Zc) relationship are as follows:
Further, after computer determines the outer parameter of video camera, the intrinsic parameter for determining video camera is also needed, in video camera
Parameter describes the optics and geometrical property of video camera, the i.e. focal length of video camera, optical axis center etc., due to the internal reference of video camera
Several related with the internal structure of video camera, and therefore, computer determines the second of camera coordinate system and image pixel coordinates system
Positional relationship obtains coordinate of the first known point, the second known point in default working face in world coordinate system, according to this
Second position relationship and the coordinate, and then determine the intrinsic parameter of video camera, specifically, can be real by following steps 205-207
It is existing.
Step 205: computer obtains the first known point and the second known point the first coordinate in world coordinate system respectively
With the second coordinate.
For example, computer obtains the first coordinate of the first known point and the second known point in world coordinate system respectively is
(Xw1, Yw1, 0), the second coordinate be (Xw2, Yw2, 0).
Step 206: computer determines the second position relationship between camera coordinate system and image pixel coordinates system.
This step is realized by following steps 2061-2062.
Step 2061: computer establishes image physical coordinates system, determines image pixel coordinates system and image physical coordinates system
Between the third place relationship.
It should be noted that in the corresponding image of default working face that computer obtains, due to image pixel coordinates
It is uo0The u axis and v axis of v as unit of the pixel of the image, i.e., the coordinate at any point in image pixel coordinates system (u,
V) only indicate that the columns and line number that the point is located in array of pixels, computer cannot describe the picture by the image pixel coordinates system
The physical location of vegetarian refreshments in the picture.It, should therefore, it is necessary to establish the image physical coordinates system indicated with physical unit in the picture
The unit of reference axis is millimeter in image physical coordinates system.
The unit of reference axis, which can according to need, in the image physical coordinates system is configured and changes, and implements in the present invention
The unit of reference axis in the image physical coordinates system is not especially limited in example;For example, coordinate in the image physical coordinates system
The unit of axis can also be centimetre, micron etc..
Wherein, computer establish the step of image physical coordinates system can be with are as follows:
Referring to Fig. 3, computer obtains the optical axis center of video camera and the intersection point o of the image1, with o1For image physical coordinates
The origin of system is sat using the u axis positive direction of image pixel coordinates system as the positive direction of image physical coordinates system x-axis with image pixel
The v axis positive direction of mark system is the positive direction of image physical coordinates system y-axis, establishes image physical coordinates system xo1y。
It therefore, can be by determining coordinate (u, v) of any the third place point in image in image pixel coordinates system
With the relationship of the coordinate (x, y) of the third place point in image physical coordinates system, and then image pixel coordinates system and figure are determined
As the third place relationship between physical coordinates system is as follows:
Wherein, αxAnd αyRespectively image from image pixel coordinates system into image physical coordinates system in image physical coordinates
The sampling frequency of the x-axis of system and the amplification factor in y-axis direction, i.e. video camera in the x-axis and y-axis direction of image physical coordinates system
Rate, (u0, v0) it is coordinate of the coordinate origin of image physical coordinates system in image pixel coordinates system, meanwhile, (u0, v0)
It is coordinate of the camera light axis center in image pixel coordinates system.
Step 2062: computer is according to the third place relationship, by following formula two, determines any second in image
Set the relationship of the coordinate and coordinate of the second position point in camera coordinate system a little in image pixel coordinates system:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in image pixel coordinates system in image, (Xc, Yc, Zc)
For coordinate of the second position point in camera coordinate system, kxFor the first amplification coefficient, kyFor the second amplification coefficient, (u0, v0) be
Coordinate of the coordinate origin of image physical coordinates system in image pixel coordinates system.
It should be noted that computer obtains the imaging geometry model of video camera, i.e. pin-point model, according to the small casement
Type determines that camera coordinate system and the proportionate relationship of image physical coordinates system are as follows:Wherein, f
For the focal length of video camera.
It willIt substitutes intoIn, by determining in image
The pass of any second position point coordinate in image pixel coordinates system and coordinate of the second position point in camera coordinate system
System, in turn, determines that the second position relationship between camera coordinate system and image pixel coordinates system is as follows:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in image pixel coordinates system in image, (Xc, Yc, Zc)
For coordinate of the second position point in camera coordinate system, kxFor the first amplification coefficient, kyFor the second amplification coefficient, (u0, v0) be
Coordinate of the coordinate origin of image physical coordinates system in image pixel coordinates system.
207: computer determines the intrinsic parameter of video camera according to the first coordinate, the second coordinate and second position relationship.
It should be noted that computer obtains the first known point and the second known point respectively and sits in the world by step 205
The first coordinate (X in mark systemw1, Yw1, 0), the second coordinate (Xw2, Yw2, 0), by step 206, computer obtains camera coordinates
Second position relationship between system and image pixel coordinates system, then, computer is according to the first coordinate, the second coordinate, second
Relationship is set, determines camera intrinsic parameter.Specifically, this step can be realized by following steps 2071-2072:
Step 2071: computer obtains the first known point according to the first coordinate, the second coordinate and second position relationship respectively
With third coordinate and 4-coordinate of second known point in image pixel coordinates system;
Computer is according to the first coordinate (Xw1, Yw1, 0) and the second coordinate (Xw2, Yw2, 0), respectively determine the first known point and
The first position and the second position of second known point in the picture;According to first position and the second position, the first known point is determined
With third coordinate (u of second known point in image pixel coordinates system1, v1) and 4-coordinate (u2, v2)。
Step 2072: computer passes through following formula according to the first coordinate, the second coordinate, third coordinate and 4-coordinate
Three, determine the intrinsic parameter of video camera:
Formula three:
Wherein, (Xw1, Yw1, 0) and it is first coordinate of first known point in world coordinate system, (Xw2, Yw2, 0) and it is second
Know the second coordinate a little in world coordinate system, (u1, v1) it is third coordinate of first known point in image pixel coordinates system,
(u2, v2) it is the second known point 4-coordinate in image pixel coordinates system.
It should be noted that since computer has obtained the first known point and the second known point in world coordinate system respectively
In the first coordinate (Xw1, Yw1, 0), the second coordinate (Xw2, Yw2, 0), the first known point and the second known point are in image pixel coordinates
Third coordinate (u in system1, v1), 4-coordinate (u2, v2), therefore, by the first coordinate (Xw1, Yw1, 0), the second coordinate (Xw2,
Yw2, 0), third coordinate (u1, v1) and 4-coordinate (u2, v2) substitute into formula three respectively, that is, it can determine the intrinsic parameter of video camera.It takes the photograph
The intrinsic parameter of camera includes: the first amplification coefficient kx, the second amplification coefficient ky, camera light axis center is in image pixel coordinates system
In coordinate (u0, v0)。
Wherein, the first amplification coefficient kx, the second amplification coefficient kyIt is respectively as follows: kx=αx× f, ky=αy× f, f are video camera
Focal length, therefore, kx、kyFor describing the focal length in external parameters of cameras.
In the embodiment of the present invention, the image that computer is shot by obtaining video camera establishes camera coordinate system, figure
As pixel coordinate system and image physical coordinates system, the of the first known point and the second known point in world coordinate system is obtained respectively
The third coordinate and the 4th of one coordinate and the second coordinate and the first known point and the second known point in image pixel coordinates system
Coordinate will substitute into the public affairs determined according to the positional relationship between camera coordinate system, world coordinate system and image pixel coordinates system
In formula, the outer parameter and intrinsic parameter of the video camera can be found out, cumbersome calculating process is omitted, it is simple to operation, it improves and takes the photograph
The working efficiency of camera calibration.
The embodiment of the invention provides a kind of device of camera calibration for pilotless automobile, which can be answered
With on computers, computer can be car-mounted terminal.Method for executing above-mentioned camera calibration.
Referring to Fig. 5, which includes:
Acquisition module 301 obtains image, image includes known to first for acquiring default working face by video camera
Point and the second known point;
First establishes module 302, in the picture, establishing image pixel coordinates system;
Second establishes module 303, for the optical axis and image according to video camera, establishes camera coordinate system;
First determining module 304, for determining the first position relationship between camera coordinate system and world coordinate system, root
According to first position relationship, the outer parameter of video camera is determined;
Module 305 is obtained, for obtaining the first seat of the first known point and the second known point respectively in world coordinate system
Mark and the second coordinate;
Second determining module 306, for determining that the second position between camera coordinate system and image pixel coordinates system is closed
System;
Third determining module 307, for determining video camera according to the first coordinate, the second coordinate and second position relationship
Intrinsic parameter.
Optionally, second module 303 is established, is also used to obtain the optical axis center of video camera, using optical axis center as origin, with
The direction horizontally to the right of image is X-axis positive direction, to be parallel to the optical axis of video camera, and is directed toward default working face by video camera
Direction be Z axis positive direction, with perpendicular to image, and direction is Y-axis positive direction straight up, establishes camera coordinate system.
Optionally, the first determining module 304 is also used to, by following formula one, determine institute according to the first position relationship
Coordinate of any first position point of image in the world coordinate system and the first position point is stated to sit in the video camera
The relationship of coordinate in mark system:
Formula one:
Wherein, MoutFor the outer parameter of video camera, (Xw, Yw, Zw) it is any first position point of image in world coordinate system
In coordinate, (Xc, Yc, Zc) it is coordinate of the first position point in camera coordinate system, R is spin matrix, and p is translation matrix.
Optionally, the second determining module 306, comprising:
First determination unit determines image pixel coordinates system and image physical coordinates for establishing image physical coordinates system
The third place relationship between system;
Second determination unit, for by following formula two, determining any second in image according to the third place relationship
The relationship of coordinate of the location point in image pixel coordinates system and coordinate of the second position point in camera coordinate system:
Formula two:
Wherein, (uc, vc) it is coordinate of any second position point in image pixel coordinates system in image, (Xc, Yc, Zc)
For coordinate of the second position point in camera coordinate system, kxFor the first amplification coefficient, kyFor the second amplification coefficient, (u0, v0) be
Coordinate of the coordinate origin of image physical coordinates system in image pixel coordinates system.
Optionally, third determining module 307, comprising:
Acquiring unit, for according to the first coordinate, the second coordinate and second position relationship, obtain respectively the first known point and
Third coordinate and 4-coordinate of second known point in image pixel coordinates system;
Third determination unit, for passing through following public affairs according to the first coordinate, the second coordinate, third coordinate and 4-coordinate
Formula three determines the intrinsic parameter of video camera:
Formula three:
Wherein, (Xw1, Yw1, 0) and it is first coordinate of first known point in world coordinate system, (Xw2, Yw2, 0) and it is second
Know the second coordinate a little in world coordinate system, (u1, v1) it is third coordinate of first known point in image pixel coordinates system,
(u2, v2) it is the second known point 4-coordinate in image pixel coordinates system.
In the embodiment of the present invention, the image that computer is shot by obtaining video camera establishes camera coordinate system, figure
As pixel coordinate system and image physical coordinates system, the of the first known point and the second known point in world coordinate system is obtained respectively
The third coordinate and the 4th of one coordinate and the second coordinate and the first known point and the second known point in image pixel coordinates system
Coordinate will substitute into the public affairs determined according to the positional relationship between camera coordinate system, world coordinate system and image pixel coordinates system
In formula, the outer parameter and intrinsic parameter of the video camera can be found out, cumbersome calculating process is omitted, it is simple to operation, it improves and takes the photograph
The working efficiency of camera calibration.
It should be understood that the device of the camera calibration provided by the above embodiment for pilotless automobile is being used for
It, only the example of the division of the above functional modules, can in practical application when the camera calibration of pilotless automobile
To be as needed completed by different functional modules above-mentioned function distribution, i.e., the internal structure of device is divided into different
Functional module, to complete all or part of the functions described above.In addition, provided by the above embodiment be used for unmanned vapour
The device of the camera calibration of vehicle and the embodiment of the method for the camera calibration for pilotless automobile belong to same design,
Specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.