Embodiment
The following more detailed description of specific embodiments of the present invention being made with reference to Figure of description:
Because the circle monumented point has rotational invariance, easy to identify, when bearing accuracy height and Flame Image Process to advantage such as threshold value is insensitive, so the circle monumented point is widely used in various Camera Positioning occasions, but behind the process perspective projection transformation, the circular ellipse that in image, becomes in the space, and the centre point of circle is through the position of the real subpoint in image behind the perspective projection transformation in the center of circle that this moment is oval and the non-space, as shown in Figure 4, the origin cause of formation of circle center error is at document " A Four step Camera CalibrationProcedure with Implicit Image Correction " in the perspective projection transformation. (Janne Heikkila, Olli Silven, IEEE Proceedings of Computer Society Conference on Computer Vision andPattern Recognition, 1997:1106 ~ 1112) the 1109-1110 page or leaf has provided detailed description in, and can obtain conclusion: when video camera imaging plane and object plane irrelevancy are capable, in the image in the oval center of circle and the non-space circular centre point through the position of the real subpoint in image behind the perspective projection transformation.The present invention provides a kind of method of asking for centre point circular in the space through the real subpoint position in image behind the perspective projection transformation.
One, the setting of circular index point
The method to set up of circular index point is: concentric circles is set, this concentric circles is made up of a great circle and a roundlet, big radius of a circle is 1.5 times to 2 times of little radius of a circles, roundlet inside is provided with an incircle that is inscribed within roundlet in concentric circles, and the length of inscribe diameter of a circle is identical with the length of the medium and small radius of a circle of concentric circles, the color of great circle in roundlet in the incircle of roundlet in the concentric circles and the concentric circles and the concentric circles is set, make the color of the incircle of roundlet in the concentric circles differ from the color of roundlet in the concentric circles, the color of roundlet differs from the color of great circle in the concentric circles in the concentric circles, the color of great circle differs from the color of the residing background of circular index point in the concentric circles, such as the color that roundlet in the concentric circles can be set is black, the color of great circle is a white in the concentric circles, the color of the incircle of roundlet is a white in the concentric circles, the color of background is a black, as shown in Figure 1.
Two, the subpoint location acquiring method of the circular index point center of circle in image is: video camera is taken circular index point, obtain image, image is carried out filtering, the noise that is produced during with the removal image taking, improve result's precision, then image is carried out Threshold Segmentation, because the color of incircle differs from the color of roundlet in the concentric circles, the color of roundlet differs from the color of great circle in the concentric circles in the concentric circles, the color of great circle differs from the color of the residing background of circular index point in the concentric circles, and method to set up is: the color of roundlet is a black in the concentric circles, the color of great circle is a white in the concentric circles, the color of the incircle of roundlet is a white in the concentric circles, the color of background is a black, by bimodal method or process of iteration, can obtain a threshold value, this threshold value can distinguish black region in the image and white portion, and the process of iteration threshold segmentation method is:
At first, obtain the maximum gradation value and the minimum gradation value of image, be designated as Z respectively
MaxAnd Z
Min, make initial threshold S
0=(Z
Min+ Z
Max)/2; And then according to threshold value S
k, S
kInitial value is S
0, the size of k equals iterations, is prospect and background with image segmentation, and prospect is a white, and background is a black, obtains the average gray value Z of prospect and background respectively
oAnd Z
bObtain new threshold value S
K+1=(Z
o+ Z
b)/2; If S
k=S
K+1, gained S then
kBe threshold value; Otherwise according to threshold value S
K+1Image is divided into prospect and background, iterative computation once more.
Image after the Threshold Segmentation is carried out rim detection and profile extraction, obtain the profile of the ellipse in the pairing image of incircle of the profile of the ellipse in the pairing image of great circle in the concentric circles, roundlet and roundlet respectively, employing least square method ellipse fitting method is carried out match to the edge contour of the ellipse in the corresponding image of great circle, roundlet in the concentric circles, the centre point of the ellipse in the acquisition concentric circles in great circle and the pairing image of roundlet
The least square method ellipse fitting method is:
As shown in Figure 2, for any one ellipse in the plane.The known standard elliptic equation is
A wherein
LongBe long axis of ellipse, b
ShortBe the minor axis of ellipse,
Utilize following two formulas to carry out coordinate transform and coordinate translation respectively to the standard ellipse equation:
Obtaining plane arbitrary ellipse equation is:
To these five yuan of four nonlinear equations, do linear transformation and make x
0, y
0Very little, contain x to omit
0, y
0High-order term, thereby make the equation linearization.
Equation after the linearization gets:
x
2+A
sxy+B
sy
2+C
sx+D
sy+E
s=0
A wherein
s, B
s, C
s, D
s, E
sCoefficient for equation:
If P
i(x
i, y
i) (i=1,2 ..., N) being the individual measurement point of N (N 〉=5) on the elliptic contour, the desirable elliptic equation in optional position, plane is x
2+ A
sXy+B
sy
2+ C
sX+D
sY+E
s=0.According to the principle of least square, ask objective function:
Minimum value determine A
s, B
s, C
s, D
s, E
sKnow that by extremum principle it is minimum desiring to make F, then must have:
Can get following normal equations group thus:
Can get center of circle data after finding the solution:
Horizontal ordinate:
Ordinate:
Major axis:
Minor axis:
Angle:
(x
0, y
0) the center of circle of ellipse in the image that comes out for match.
Circle becomes oval process through perspective projection transformation in image from the space, and the process of generation circle center error is as follows:
1, at first set up four coordinate systems: (1) is the computer picture coordinate system of unit with the pixel, definition rectangular coordinate system u-v on image, and (u v) is respectively columns and the line number of this pixel in image to the coordinate of each pixel.(u v) is to be the image coordinate system coordinate of unit with the pixel; (2) video camera imaging plane coordinate system, be arranged in the columns and the line number of image owing to a computer picture coordinate system remarked pixel that with the pixel is unit, do not express the position of this pixel in image with physical unit, therefore need to set up imaging plane coordinate system x-y with physical unit (millimeter mm commonly used) expression, (x, y) expression is with the coordinate of the imaging plane coordinate system of object metric unit.Then any one pixel is that the conversion relational expression of computer picture coordinate system of unit is expressed as being tied to the pixel from the imaging plane coordinate with the object metric unit in the image:
And then be expressed as with the form of homogeneous coordinates and matrix:
U, v are to be two-dimensional coordinate in the computer picture coordinate system of unit with the pixel, and wherein the abscissa axis of image coordinate system and axis of ordinates are called u axle and v axle,
Be intrinsic parameters of the camera matrix, wherein f
x, f
yRepresent the scale factor of u axle and v axle respectively, claim effective focal length again, s represents the u axle and the v axle between centers out of plumb factor, because the raising of camera lens precision at present, the s value is 0, (u
0, v
0) represent with the pixel to be the principal point coordinate of the image of unit, also claim optical centre.
(3) camera coordinate system, definition camera coordinate system (O
C-X
CY
CZ
C).The initial point of camera coordinate system is positioned at video camera photocentre place, X
CAxle and Y
CAxle is parallel with the y axle with the x axle of video camera imaging plane coordinate system, Z
CAxle is the optical axis of video camera, Z
CAxle is vertical with the video camera imaging plane.The intersection point on optical axis and video camera imaging plane is the figure principal point; (4) world coordinate system is selected a frame of reference to describe the position that video camera is placed in real world, and is described the position of any object in the world environments with it, and this coordinate is a world coordinate system, and it is by reference observation initial point O
WAnd X
W, Y
W, Z
WAxle is formed.Available rotation matrix R of relation between camera coordinate system and the world coordinate system and translation matrix T describe.If the homogeneous coordinates of certain 1 P under world coordinate system and camera coordinate system are respectively (X in the hypothesis space
W, Y
W, Z
W, 1)
T, (X
C, Y
C, Z
C, 1)
T, then there is following relation:
Wherein, R is 3 * 3 quadrature unit matrixs; T=(t
x, t
y, t
z)
TBe the D translation vector; M
1Be 4 * 4 matrix, claim R, T is an external parameter.
2, the foundation of the equation of circular edge under the world coordinate system in the space
The expression formula of supposing the edge of any one space circle in the space is:
(X
W-X
i)
2+(Y
W-Y
i)
2=η
i 2
Wherein, X
W, Y
WBe the coordinate points at round edge, X
i, Y
iBe the coordinate of the center of circle under world coordinate system of this circle, η
iFor being somebody's turn to do the real radius of circle in the world coordinate system.
3, through pinhole imaging system, round edge circle expression formula equation is transformed under the camera coordinate system by world coordinate system
The pinhole imaging system model as shown in Figure 3, by formula (3) as can be known, coordinate (X under the world coordinate system
W, Y
W, Z
W) through R, the T matrix conversion is under camera coordinate system, its coordinate becomes (X
C, Y
C, Z
C), following transformational relation is then arranged.
Wherein, because circle is positioned at same plane in the space, so establish coordinate Z under its world coordinate system
W=0, so
Z wherein
W=0.
With (X
C, Y
C, Z
C) normalization obtains following formula
With formula (5) substitution formula (4), obtain following formula
In formula (6), with Z
CTwo formulas above in the substitution equation obtain following formula
Abbreviation formula (7) obtains following formula (8)
Further abbreviation gets formula (9)
In formula (9),
a=(r
8t
y-r
5t
z),b=(r
2t
z-r
8t
x),c=(r
5t
x-r
2t
y)
d=(r
5r
7-r
4r
8),e=(r
1r
8-r
2r
7),f=(r
2r
4-r
1r
5)
h=(r
7t
y-r
4t
z),j=(r
1t
z-r
7t
x),k=(r
4t
x-r
1t
y)
With formula (9) substitution formula (X
W-X
i)
2+ (Y
w-Y
i)
2=η
i 2In, obtain following formula
[(a-X
id)X
n+(b-X
ie)Y
n+(c-X
if)]
2+[(h+Y
id)X
n+(j+Y
ie)Y
n+(k+Y
if)]
2
=η
i 2(dX
n+eY
n+f)
2
(10)
Order
m=(a-X
id),n=(b-X
ie),w=(c-X
if)
o=(h+Y
id),p=(j+Y
ie),q=(k+Y
if)
Then formula (10) but abbreviation become
Following formula can be expressed as: circle, ellipse, hyperbolic curve, para-curve, represent ellipse in the present invention in conjunction with actual conditions.
According to given least square method ellipse fitting formula, the central coordinate of circle of asking for the pairing ellipse of formula (11) is:
Because the point in the space is through still being a point behind the perspective projection transformation, and this point is this point through real subpoint behind perspective projection transformation, so the middle space radius of a circle η of suppositive mood (12)
i=0, obtain new centre point coordinate,
(13)
X when video camera imaging plane and space object plane are parallel to each other
0=x '
0, y
0=y '
0And when video camera imaging plane and space object plane irrelevancy are capable x
0≠ x '
0, y
0≠ y '
0, this moment, these two points were formed straight line on the video camera imaging plane, and the slope of this straight line is:
With (12) (13) formula substitutions (14) formula, and carry out abbreviation, obtain following result:
Can be obtained by formula (15), the size of radius of a circle is irrelevant in slope k and the space at this moment, can obtain as drawing a conclusion:
Concentric circles in the space, behind the process perspective projection transformation, the center of circle of the ellipse that is become on the video camera imaging plane is located on the same line, and the concentrically ringed centre point in this straight-line pass space is through the true subpoint of perspective projection transformation on the video camera imaging plane.
4, to be transformed into the pixel be the computer picture coordinate system of unit to the video camera imaging planimetric coordinates
By formula (1) and formula (2) as can be known,
Wherein
Be the inner parameter matrix of video camera, (u v) is to be the computer picture coordinate system coordinate of unit with the pixel, and s represents the u axle and the v axle between centers out of plumb factor, because the raising of camera lens precision at present, the s value is 0, (X
n, Y
n, 1)
TBe coordinate under the video camera imaging plane coordinate system after the normalization of process formula (5).
So can obtain by (16), on the computer picture plane
Formula (17) substitution formula (11) can be obtained circle in the space, with the pixel be the ellipse that is become on the computer picture plane of unit, its equation is:
A
1u
2+B
1uv+C
1v
2+D
1u+E
1v+F
1=0(18)
A wherein
1=(m
2+ o
2-η
2 id
2)/f
x 2
(u, v) representing with the pixel is the coordinate of the point on the computer picture of unit.
Adopt the method for least square fitting ellipse, can obtain oval home position this moment, in the distortion of lens distortion that does not have video camera or camera lens hour, from the video camera imaging plane to being that conversion the computer picture of unit can be thought linear transformation with the pixel, be in the computer picture of unit this moment with the pixel, and two centre points of the ellipse that concentric circles became still are located on the same line.
Under the situation of the lens distortion that has video camera, according to the model of camera lens distortion,
U wherein
i, v
iFor with the pixel being the position of the pixel when not distorting in the computer picture of unit,
For being the position of the pixel in the computer picture of unit with the pixel after the distortion, (u
0, v
0) be the subpoint position of photocentre in the computer picture that with the pixel unit of video camera, k
1, k
2Be single order and second order coefficient of radial distortion.
Because ideally, two centre point distances of two ellipses that the concentric circles in the space is become on the video camera imaging plane are approaching, so after adding distortion, the change amount of these two positions of centre point in image can be thought to equate, be that the centre point of the ellipse that concentric circles became still is located on the same line in the computer picture of unit this moment with the pixel.In solving image, do not contain after the subpoint in the concentric circles center of circle of circle center error of perspective projection transformation, carry out the correction of lens distortion again.
So can obtain as drawing a conclusion:
Concentric circles in the space, behind the process perspective projection transformation, in the center of circle that with the pixel is the ellipse that become under the computer picture coordinate system of unit, be located on the same line, and the concentrically ringed centre point in this straight-line pass space is through the true subpoint of perspective projection transformation in the computer picture that with the pixel is unit.
Extract in the computer picture edge of great circle in the concentric circles and the pairing ellipse of roundlet, and the center of circle of adopting the least square ellipse fitting to ask for two ellipses in two images, judge, if the distance between the center of circle of two ellipses less than setting value (as 10
-1Individual pixel), think that then the center of circle of two ellipses overlaps, this moment is in computer picture, the mean value of the horizontal ordinate of the centre point of pairing two ellipses of concentric circles and the pairing point of the mean value of ordinate are the true subpoint of concentrically ringed centre point in the computer picture that is unit with the pixel, if the distance between the center of circle of two ellipses is greater than this setting value, then two centre points are formed a line, because concentrically ringed centre point is arranged in the edge of the incircle of concentric circles roundlet in the space, so through behind the perspective projection transformation, the subpoint of this centre point in the computer picture that with the pixel is unit also is arranged in the edge of the incircle of concentric circles roundlet at the pairing ellipse of image, the intersection point at the edge of the ellipse in known line and the concentric circles in the pairing image of the incircle of roundlet has two, and the approaching intersection point of the centre point of the ellipse in the image corresponding with great circle in the concentric circles is the position of the real subpoint of centre point in the computer picture that is unit of great circle and roundlet in the concentric circles with the pixel.
Because when Threshold Segmentation, tend to cause in the image convergent-divergent at circular edge, be: the internal edge point and the external margin point that extract the marginal point after the Threshold Segmentation simultaneously so extract the method at edge oval in the incircle corresponding image of roundlet in the concentric circles.The marginal point of fitted ellipse then obtains in the concentric circles elliptic equation at oval edge in the pairing image of the incircle of roundlet.
Suppose great circle in the concentric circles and roundlet pairing be that the centre point position of two ellipses that ellipse simulated in the computer picture of unit is with the pixel:
(u
b,v
b)、(u
s,v
s)
Then in the image be through this straight line of 2:
(u, v) representing with the pixel is the coordinate of the point on the computer picture of unit.
The edge equation of the ellipse in the pairing image of the incircle of the roundlet in the concentric circles is:
A
qu
2+B
quv+C
qv
2+D
qu+E
qv+F
q=0(20)
Simultaneous equations (19) (20) obtain a system of equations, find the solution this system of equations, can obtain two groups and separate, and separate corresponding two intersection points of straight line with elliptical edge for these two groups, and selection is wherein from (u
b, v
b) the near point of distance, this point is the pairing position through the subpoint in the computer picture that with the pixel is unit behind the perspective projection transformation of centre point of great circle in the concentric circles and roundlet.
The process flow diagram of asking for the subpoint of centre point in image as shown in Figure 5.