Embodiment
The present invention proposes a kind of method and apparatus realizing Multi-angle camera monitoring effect based on panoramic camera.Panoramic camera can adopt fish-eye camera or mirror surface, and wherein mirror surface can be parabola or minute surface Hyperboloidal mirror.
Adopt flake video camera for panoramic camera, flake video camera can independently realize monitoring without dead angle on a large scale, and its mounting means generally has two kinds, ceiling type and wall-hanging.When adopting ceiling type to install, the visual range of flake video camera is 360 ° below camera lens; When adopting wall-hanging installation, the visual range of flake video camera is 180 ° of camera lens front.The panoramic picture (being specially fish eye images) that the present invention absorbs flake video camera carries out the correction of corresponding different roaming angle, the correcting fisheye image figure that each roaming angle is corresponding one, its effect is equivalent to adopt multiple common camera of multi-angle to absorb the image of different angles simultaneously.For ceiling type video camera, roaming angle is level, and can be understood as is in the plane that forms in X-axis and Y-axis; For wall-hanging video camera, roaming angle is vertical, and can be understood as is in the plane that forms at Y-axis and Z axis.
If Fig. 1 is the method realization flow figure realizing Multi-angle camera monitoring effect that the present invention proposes, comprising:
Step 101: absorb panoramic picture by panoramic camera;
Step 102: multiple roaming angle is set for panoramic picture;
Step 103: obtain multiple partial corrections figure according to each roaming angle.
Wherein, step 103 is specifically as follows: determine the new optical centre on described panoramic picture respectively according to each roaming angle; According to described new optical centre, partial correction is carried out to panoramic picture, obtain the panoramic picture correction chart of described roaming angle.
Mode according to the new optical centre on roaming angle determination panoramic picture can be:
The coordinate figure of described new optical centre is determined according to the radius of the projection sphere of described roaming angle, the angle value preset, panoramic camera imaging and the parameter value that presets; Concrete determination mode will in following detailed introduction.
By said process, for each frame panoramic picture, several panoramic picture correction charts for this frame panoramic picture can be obtained, the corresponding roaming angle of each panoramic picture correction chart; The visual effect of these panoramic picture correction charts is equivalent to multiple common camera at the image of shooting angle for absorbing during different roaming angle.
For ease of understanding, first introduce the general principle that panoramic picture corrects below.In following citing, panoramic picture is specially fish eye images and is described.
Adopt space three-dimensional rectangular coordinate system, the spherical projection model of fish eye images is:
From initial point O (0,0,0), the ray of pointing space any point (x, y, z), trade shadow sphere x
2+ y
2+ z
2=R
2in a bit, then this point is projected on a fixed pan vertical with z-axis, obtain planar point (u, v).Planar point (u, v) and (x, y, z) have following relation:
Spatial points (x, y, z) to the projection (u, v) on fixed pan, be fish-eye imaging plane.Utilize the inverse transformation of this model, fish eye images can be transformed to the image on perspective projection model, namely realize the correction of fish eye images.
More than be the principles and methods of correcting fisheye image.Because fish eye images is wide-angle image, obvious distortion is had in image border, the correcting algorithm of the present invention to fish eye images improves, make on all new optic center point on a fish eye images circle within the scope of fish eye images, thus make the viewing angle nature of correcting fisheye image figure.
If Fig. 2 is the schematic diagram that fish eye images is transformed to correcting fisheye image figure.Conversion process comprises:
Step 1: according to the new optical centre on roaming angle determination fish eye images, the following formula of concrete employing is determined:
wherein,
P
0(u
1, v
1) be the new optical centre on fish eye images;
for the angle value preset; Its value can be
θ is this roaming angle;
Viewratio is the numerical value preset.
Like this, exist
when, θ gets different value values, can realize the effect of multiple angle monitoring.Correcting image viewing angle nature.Wherein viewratio is for controlling new optic center point P on original fish eye images
0(u
1, v
1) position, guarantee all P
0(u
1, v
1) be positioned on a circle, radius is R*viewratio; The value of viewratio is (0,1).
Step 2: determine P
0(u
1, v
1) coordinate of corresponding points P on the projection sphere of panoramic camera imaging is
Step 3: make correcting plane be kR to the distance of centre of perspectivity O (centre of sphere of the sphere that namely projects), wherein k>0, R are the radius of projection sphere; Determine P
0(u
1, v
1) coordinate of corresponding points P' on correcting plane is
using the optical centre of P' as correcting plane;
Step 4: the both direction determining plane coordinates axle on correcting plane, represents with vector α, β, the positive direction of u, v reference axis on the corresponding fish eye images of difference.β is chosen as on projection sphere through the upwards tangential direction of the warp of some P at this point.
The constraints of vector α and β is:
α and β is vertical;
α, β and OP form left-handed coordinate system.
Wherein,
α=BP×AP,
β=OP×α,
Wherein, BP is that starting point is B and terminal is the vector of P, and AP is that starting point is A and terminal is the vector of P, and OP is that starting point is O and terminal is the vector of P, and described "×" represents that 2 vectors are multiplied; The coordinate of A and B is as follows:
Step 5: α and β is unitization, determines the wide, high of correcting fisheye image figure and the position (i of P' in correcting fisheye image figure
0, j
0), be generally defaulted as the center of image.
Step 6: determine that in correcting fisheye image figure, each pixel (i, j) is at the color value of the corresponding points Q in space successively in such a way, obtain the correcting fisheye image figure of this roaming angle;
Determine that pixel (i, j) is (j-j at the corresponding points Q in space
0) α+(i-i
0) β+kP; Determine that ray OQ with the intersection point of projection sphere is
obtain the corresponding points (u, v) of Q point in fish eye images, the color value of point (u, v) is carried out interpolation processing, obtains the color value of described Q point.
By the way, when after the every bit having traveled through correcting fisheye image image, namely complete an image rectification.
Below lift specific embodiment to introduce in detail:
Embodiment one:
The present embodiment uses 180 ° of fish-eye video cameras, and adopts ceiling type to install, and the visual range of flake video camera is 360 ° below camera lens.In the present embodiment, arrange 8 roaming angle θ, the value of each roaming angle θ is respectively: 0 °, 45 °, 90 °, 135 °, 180 °, 225 °, 270 ° and 315 °.
For the fish eye images that flake video camera absorbs, same frame fish eye images is carried out respectively to the correction of corresponding different roaming angle, obtain 8 corresponding correcting fisheye image figure, namely achieve the effect of Multi-angle camera monitoring.Determine that the concrete mode of new optical centre and correction is described above according to roaming angle, do not go to live in the household of one's in-laws on getting married at this.
As Fig. 3 be the present embodiment realize effect schematic diagram, in figure 3, the fish eye images that the picture being positioned at center absorbs for flake video camera; Correcting fisheye image figure corresponding when θ value is 0 °, 45 °, 90 °, 135 °, 180 °, 225 °, 270 °, 315 ° is respectively according to 8 width pictures of sequence counter-clockwise display from the picture on the right side of fish eye images, can see that the display effect of correcting fisheye image figure meets the angle of looking squarely, viewing nature.
Above-described embodiment is be the implementation of 360 ° of situations below camera lens for the visual range of flake video camera; When adopting wall-hanging installation, the visual range of 180 ° of fish-eye video cameras is 180 ° of camera lens front, and for this situation, the mode realizing Multi-angle camera effect that the present invention proposes slightly is distinguished, and specifically comprises the following steps:
By flake video camera, Real-time Collection fish eye images;
With the center of circle of fish eye images for xy reference axis initial point, level is to the right x-axis forward, and be y-axis forward vertically upward, R is the radius of center of circle image.A selected new optical centre (u, v), as the center of new correction chart, the span of u, v is (-R, R).
According to new optical centre, partial correction is carried out to fish eye images, obtain a correcting fisheye image figure.
On fish eye images, as required, choose n point as new optical centre, correct respectively same frame circle fisheye image, obtaining n opens correcting fisheye image figure, is namely equivalent to the effect captured by n camera.
Be described above the method realizing Multi-angle camera monitoring effect, the present invention also proposes a kind of device realizing Multi-angle camera monitoring effect, if Fig. 4 is the structural representation of this device, comprising:
Presetting module 401, the panoramic picture for absorbing for panoramic camera arranges multiple roaming angle;
Correction module 402, for obtaining multiple partial corrections figure according to each roaming angle.
In said apparatus, correction module 402 determines the new optical centre on described panoramic picture respectively according to each roaming angle; According to described new optical centre, partial correction is carried out to panoramic picture, obtain the panoramic picture correction chart of described roaming angle.
Correction module 402 according to the mode of the new optical centre that roaming angle is determined on described panoramic picture is:
The coordinate figure of described new optical centre is determined according to the radius of the projection sphere of described roaming angle, the angle value preset, panoramic camera imaging and the parameter value that presets.
Following formula specifically can be adopted to determine:
wherein,
P
0(u
1, v
1) be the new optical centre on described panoramic picture;
for the angle value preset;
θ is this roaming angle;
Viewratio is the numerical value preset.
Correction module 402 carries out partial correction according to new optical centre to panoramic picture, and the mode obtaining the panoramic picture correction chart roaming angle can be:
Determine P
0(u
1, v
1) coordinate of corresponding points P on the projection sphere of panoramic camera imaging is
Make correcting plane be kR to the distance of the centre of sphere O of projection sphere, wherein k>0, R are the radius of projection sphere; Determine P
0(u
1, v
1) coordinate of corresponding points P' on correcting plane is
using the optical centre of P' as correcting plane;
Described correcting plane is determined the both direction of plane coordinates axle, represents with vector α, β, wherein,
α=BP×AP,
β=OP×α,
Described BP is that starting point is B and terminal is the vector of P, and described AP is that starting point is A and terminal is the vector of P, and described OP is that starting point is O and terminal is the vector of P, and described "×" represents that 2 vectors are multiplied; The coordinate of described A and B is as follows:
α and β is unitization, determine the wide, high of panoramic picture correction chart and the position (i of P' in panoramic picture correction chart
0, j
0);
Determine that in panoramic picture correction chart, each pixel (i, j) is at the color value of the corresponding points Q in space successively in such a way, obtain the panoramic picture correction chart of this roaming angle described;
Determine that pixel (i, j) is (j-j at the corresponding points Q in space
0) α+(i-i
0) β+kP; Determine that ray OQ with the intersection point of projection sphere is
obtain the corresponding points (u, v) of Q point in panoramic picture, the color value of point (u, v) is carried out interpolation processing, obtains the color value of described Q point.
In said apparatus, panoramic camera can adopt fish eye lens or adopt mirror surface; Wherein mirror surface can be parabolic mirror or Hyperboloidal mirror.
As fully visible, the method and apparatus realizing Multi-angle camera monitoring effect that the present invention proposes, new optical centre on the panoramic picture absorbed according to each roaming angle determination panoramic camera respectively, and the optical centre new according to this corrects panoramic picture, thus obtaining multiple panoramic picture correction charts of corresponding multiple roaming angle respectively, these panoramic picture correction charts can reach the monitoring effect of the multiple camera of multi-angle; Further, when carrying out image rectification, on the panoramic picture utilizing multiple roaming angle to determine, new optical centre is positioned on a circle of panoramic picture scope, thus makes the viewing angle nature of panoramic picture correction chart.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.