[summary of the invention]:
The purpose of this invention is to provide a kind of fish eye images method of deploying that restores according to the equidistant projection principle based on the sphere imaging model, restore the image of any range in the fish eye images accurately with realization, and then splice correction and the recovery that realizes the distortion fish eye images; Can launch simultaneously the pairing fish eye images of expansion window at the arbitrary orientation angle, space, fish eye lens place and the elevation angle.
The present invention is a kind of method of deploying of the fish eye images based on sphere equidistant projection model, and it is realized on following hardware carrier: PC, flake video camera, support.The flake video camera is made up of super large wide-angle fish eye lens and high resolution camera.Support is used for supporting and fixing flake camera; The flake camera is gathered the spatial information of structured environment in real time, and PC launches to handle by method of the present invention in real time, utilizes the information after launching can carry out other effective processing, as car body navigation, monitoring, video conference etc.
The present invention is a kind of method of deploying of the fish eye images based on sphere equidistant projection model, makes fixed fish eye lens realize being equivalent to the function of mobile camera.Its implementation flow process as shown in Figure 2, its concrete steps are as follows:
1st, set up the sphere imaging model of square projection theories such as meeting of fish eye images;
The the 1.1st: set up the fish eye images coordinate system.Center o (x with fish eye images
0, y
0) set up fish eye images coordinate system xoy for initial point.
The the 1.2nd: set up camera coordinates system.Camera coordinates is x
cy
cz
cIt is a three-dimensional system of coordinate.x
c, y
cOverlap z with the x axle y axle of fish eye images coordinate system respectively
cAxle and fish-eye optical axis coincidence, and meet at the O point with the fish eye images coordinate system.
The 1.3rd: with the O point is the center, and the radius R of fish eye images is that radius is done hemisphere, hemisphere and z
cThe axle meet at O ' point (0,0, R).
The the 1.4th: suppose 1 P in the camera coordinates system, be ray OP, meet at P ' (x with hemisphere face
Cp ', y
Cp ', z
Cp ') point, the coordinate of this intersection point in camera coordinates system is:
(x
cp′,y
cp′,z
cp′)=(Rsinθcosφ,Rsinθsinφ,Rcosθ) (1)
Wherein, OP and z
cThe angle theta of axle is an incident angle; The projection OP of OP on xoy " is defined as the position angle with the included angle of x axle; The elevation angle of OP is β=90 °-θ.Then according to waiting square projection theory:
||OP″||=Kθ (2)
Wherein k is for waiting distortion factor of square projection.
2nd, set up expansion window coordinates system and unfolded image coordinate system, and obtain the relation between these two coordinate systems.
The the 2.1st: cross the tangent plane U that P ' does sphere
wV
w, this plane is and launches window coordinates is the plane at place, the visual angle of launching window coordinates system is γ; P ' V
wWith OZ, OP ' coplane and its positive dirction are perpendicular to OP ' sensing OZ; P ' U
wPositive dirction by P ' V
wCross product decision with OP '; The position angle that defines this tangent plane is the position angle φ of OP, and the elevation angle is same as the elevation angle of OP:
β=90°-θ (3)
2.2nd, the unfolded image coordinate is U
wV
w, unfolded image coordinate system U
wV
wInitial point (0,0) in the lower left corner of unfolded image; If the wide and height of unfolded image is respectively w, h.
2.3rd, launch the point that window coordinates fasten and have one-to-one relationship with the pixel on the unfolded image coordinate system, so a pixel wide on the unfolded image corresponding to the size on the expansion plane is:
Pixel coordinate on the unfolded image and the point coordinate that launches on the plane can be mapped one by one according to the 2.2nd; As the point coordinate on the unfolded image is that (m, n), the then corresponding coordinate launching on the window plane is Q ' (mw to Q
Pixel, nw
Pixel);
3rd, set up the relation of unfolded image coordinate system and camera coordinates system.
The the 3.1st: set up the relation of launching window coordinates system and camera coordinates system.Launching window coordinates system along P ' U
wThe whenever mobile w of positive dirction
PixelThe time variable quantity fastened in camera coordinates be:
X direction variable quantity
dxu=-w
pixel*sin(φ) (5)
Y direction variable quantity
dyu=w
pixel*cos(φ) (6)
The variable quantity of z direction is
dzu=0 (7)
In like manner launching window coordinates system along P ' V
wThe whenever mobile w of positive dirction
PixelThe time variable quantity fastened in camera coordinates be:
At x direction variable quantity
dxv=w
pixel*cos(θ)*cos(φ) (8)
Y direction variable quantity is
dyv=w
pixel*cos(θ)*sin(φ) (9)
Variable quantity on the z direction is
dzv=w
pixel*sin(θ) (10)
The 3.2nd: obtain unfolded image mid point Q (m, n) the corresponding coordinate Q in camera coordinates system ":
(x
cp+mdxu+ndxv,y
cp+mdyu+ndyv,z
cp+mdzu+ndzv)
=R×w
pixel×(sinθcosφ-msinφ+ncosθcosφ (11)
,sinθsin+mcosφ+ncosθsinφ
,cosθ+nsinθ)
4th, obtain relation between unfolded image coordinate system and the fish eye images coordinate system.
4.1st, we have obtained the coordinate Q of some Q coordinate in camera coordinates system in the unfolded image in the 3rd step (11) formula ".We can obtain Q " the imaging Q in fish eye images " ' according to the equidistant projection principle.Q " incident angle be:
(12)
The position angle is:
(13)
With getting: Q according to (2) formula equidistant projection principle " ' be r=k α to the length of central point.So Q " ' coordinate be:
x
Q″′=rcosλ+x
0
(14)
y
Q″′=rsinλ+y
0
X wherein
0, y
0Be the centre coordinate of fish eye images, with α and λ substitution can try to achieve any point Q that recovers on the image of back (m, n) corresponding point coordinate on fish eye images:
Q″′(rcosλ+x
0,rsinλ+y
0) (15)
4.2nd, the " ' (rcos λ+x that will put Q
0, rsin λ+y
0) pixel value compose that (m n), draws unfolded image after the group to Q.
ValueQ(m,n)=ValueQ″′(rcosλ+x
0,rsinλ+y
0) (16)
5th, pointwise obtains whole unfolded images
According to the method in the 2nd to the 4th step, pointwise obtains the image of each point in the unfolded image, obtains whole unfolded images at last.
6th, the expansion of fish eye lens place space three-dimensional scene.
At first, according to the cube strategy, as launching window, the definition on these several planes is as follows respectively with hemispherical external half cubical five faces in the 1st step model:
6.1st, fish-eye top: get sphere top and z
cThe axle intersection point (0,0, R) cook tangent plane P
UpCan recover the image at fish eye lens top for launching window.The size of launching window is 2R * 2R (wide * height), and the visual angle is 90 °, and no position angle, the elevation angle are 90 °.Try to achieve relation between unfolded image and the fish eye images according to the method pointwise of the 4th step described in (16) formula.
6.2nd, fish-eye the place ahead: get sphere and y
cThe intersection point (0, R, 0) of axle is cooked tangent plane P
FrontFor the expansion window in the place ahead can recover the image in fish eye lens the place ahead, the size on plane is 2R * R, and the visual angle is 90 °, and the position angle is 90 °, and the elevation angle is 0 °.Try to achieve relation between unfolded image and the fish eye images according to the method pointwise of the 4th step described in (16) formula.
6.3rd, fish-eye rear: get sphere y
cThe intersection point (0 ,-R, 0) of axle is cooked tangent plane P
BackFor the expansion window at rear can recover the image at fish eye lens rear, the size on plane is 2R * R, and the visual angle is 90 °, and the position angle is 270 °, and the elevation angle is 0 °.Try to achieve relation between unfolded image and the fish eye images according to the method pointwise of the 4th step described in (16) formula.
6.4th, the fish-eye left side: get sphere and x
cThe intersection point (R, 0,0) of axle is cooked tangent plane P
LeftFor the expansion window on the left side can recover the image on the fish eye lens left side, the size on plane is R * 2R, and the visual angle is 90 °, and the position angle is 180 °, and the elevation angle is 0 °.Try to achieve relation between unfolded image and the fish eye images according to the method pointwise of the 4th step described in (16) formula.
6.5th, the fish-eye right side: get sphere and x
cThe intersection point (R, 0,0) of axle is cooked tangent plane P
RightFor the expansion window on the right side can recover the image on the fish eye lens right side, the size on plane is R * 2R, and the visual angle is 90 °, and the position angle is 0 °, and the elevation angle is 0 °.Try to achieve relation between unfolded image and the fish eye images according to the method pointwise of the 4th step described in (16) formula.
7th, specify the unfolded image of any direction.
With any one direction in the space, fish eye lens place is the center, and fish eye images is launched, and the expansion of any direction needs 5 parameters, the elevation angle, and the position angle, the wide and high of back image recovered at the visual angle.Given these 5 parameters can be launched according to the 1st step to the 4th step.
8th, launch the roaming of window.
To launch window and on sphere, move, and launch, can obtain the roaming figure of fish eye images according to the 1st method that went on foot for the 5th step.
Advantage of the present invention and good effect:
● the present invention is based on fish-eye sphere imaging model, promptly be adapted to wait the fish eye lens of square projection theory, also be applicable to the fish eye lens of other projection theory.
● the present invention has remedied other can only launch the defective of fish eye lens top information approach, not only can restore the information at top, also can restore the information of side any direction, as two sides, the left and right sides.
● the present invention can launch " the expansion window " on any direction axle, and the extracting of sensitive information in the image is had good effect.
● expansion effect of the present invention has been eliminated the existing picture that other restoration methods edge " is pullled ", also can obtain the effect near real world at the edge.
● the present invention is having positive effect and application prospects based on fields such as fish-eye image tracking, monitoring and video conferences.
[embodiment]:
Below in conjunction with drawings and Examples the multidimensional method of deploying that fish eye lens of the present invention restores is elaborated.
Embodiment 1
Image resolution ratio is 1280 * 1024, and the center of fish eye images is (504,508), and calibrated radius is R=498, and distortion is k=5.9.Given position angle is φ=45 °, elevation angle β=45 °, and visual angle γ=90 °, recovering back image size requirements is 400 * 400.
The first step: set up fish eye images coordinate system xy, camera coordinates is x
cy
cz
c, the initial point of coordinate system is the central point (504,508) of fish eye images; Do the hemisphere face of radius R=498, hemisphere face and z
cIntersection point be (0,0,498).
Second step: obtain 45 ° at position angle, the ray at 45 ° at the elevation angle and the point of intersection S of sphere:
S(R?sin(45)*cos(45),R?sin(45)*sin(45),R?cos(45))=S(249.0,249.0,352.086)。
The 3rd step: S selects and cooks tangent plane P excessively
SFor launching window, the visual angle is 90 °, and coordinate axis is U
S, V
SU
SPositive dirction point to x
cThe positive dirction of axle, V
SPositive dirction point to z
cPositive dirction, initial point is S, so the S point is at P
SOn coordinate be S (0,0).Calculate on the unfolded image pixel corresponding to P
SOn size be:
The 4th step: calculate P
SOn whenever mobile w
PixelThe variation that in camera coordinates system, causes.
No U
SPositive dirction moves w
PixelThe time in camera coordinates system, cause be changed to:
x
cDirection: dxu=w
PixelSin φ=1.760
y
cDirection: dyu=-w
PixelCos φ=-1.760
z
cDirection: dzu=0
Along V
SPositive dirction moves w
PixelThe time in camera coordinates system, cause be changed to:
x
cDirection: dxv=-w
Pixel* cos (θ) * cos (φ)=-1.245
y
cDirection: dyv=-w
Pixel* cos (θ) * sin (φ)=-1.245
z
cDirection: dzv=w
Pixel* sin (θ)=1.760
The 5th step: set up the unfolded image coordinate system.Launching back image size is 400 * 400, the initial point of coordinate system is located at the center (200,200) of image, so first pixel coordinate on the image is (200 ,-200).
The 6th step: calculate (200 ,-200) at P
SOn coordinate.According to formula (11) be:
(-200w
pixel,-200w
pixel)=(-498,-498)
The 7th step: calculate (200 ,-200) coordinate in camera coordinates system.Calculate according to the 3rd in summary of the invention step.
x=x
s-200×dxu+(-200)×dxv=249.0+103.0=352.0
y=y
s-200×dyu+(-200)×dyv=249.0+601.0=850.0
z=z
s-200×dxu+(-200)×dxv=352.086-352=0.086
The 8th step: according to waiting square projection theory to calculate the coordinate that is projected on the fish eye images.According to the calculating of the step of the 4th in the summary of the invention.
Incident angle
The square that arrives mid point is from r=k α=5.9 * 90=531
So coordinates computed is x
Q " '=rcos λ+x
0=531 * cos67.5+504=203.2+504=707
y
Q″′=rsinλ+y
0=531×sin67.5+508=490.6+508=999
To just having calculated in the unfolded image first pixel (0,0) here corresponding to the coordinate in the fish eye images.
The 9th step: other pixel is for the coordinate in the fish eye images in the calculating unfolded image, and the rgb value of this point is (109,204,63), so the value of first pixel on the unfolded image is (109,204,63) just.Coordinate pointwise in the unfolded image is calculated, just can obtain whole unfolded image.Fig. 4 is image and original image after launching.
Fig. 3 is the stretch-out view that " back " launches window.Fig. 5 is cube strategy stretch-out view and splicing.
By the specific descriptions of above embodiment, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprises that some instructions are in order to realize method of the present invention.
More than disclosed only be a specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.