The method and apparatus for realizing Multi-angle camera monitoring effect
Technical field
The present invention relates to fish eye lens technical field, more particularly to a kind of method for realizing Multi-angle camera monitoring effect
And device.
Background technology
Current video monitoring system, the general visible angle of camera lens are less than 60 degree;In order to realize a wide range of overall view monitoring, one
As using multi-angle multiple cameras realize.But the monitoring scheme of this multiple cameras of multi-angle, monitoring system can be made
Build it is higher with maintenance cost.In addition, also having at present by camera rotary taking multiple images, one is then spliced into
Panorama sketch, it is in this way, not only troublesome in poeration, and can not monitoring in real time comprehensive in real time.
The content of the invention
The invention provides a kind of method for realizing Multi-angle camera monitoring effect, can reduce overall view monitoring into
This.
Present invention also offers a kind of device for realizing Multi-angle camera monitoring effect, can reduce overall view monitoring into
This.
The technical proposal of the invention is realized in this way:
A kind of method for realizing Multi-angle camera monitoring effect, including:
Panoramic picture is absorbed by panoramic camera;
For panoramic picture, multiple roaming angles are set;
Multiple partial correction figures are obtained according to each roaming angle.
A kind of device for realizing Multi-angle camera monitoring effect, including:
Presetting module, the panoramic picture for being absorbed for panoramic camera set multiple roaming angles;
Correction module, for obtaining multiple partial correction figures according to each roaming angle.
It can be seen that the method and apparatus proposed by the present invention for realizing Multi-angle camera monitoring effect, to panoramic camera institute
The panoramic picture of intake obtains multiple partial correction figures according to multiple different angles that roam respectively, and these partial correction figures can reach
To the monitoring effect of the multiple cameras of multi-angle.
Brief description of the drawings
Fig. 1 is the method implementation process figure for realizing Multi-angle camera monitoring effect that invention proposes;
Fig. 2 is the schematic diagram that fish eye images are transformed to correcting fisheye image figure;
Fig. 3 realizes effect diagram for embodiment one;
Fig. 4 is the apparatus structure schematic diagram for realizing Multi-angle camera monitoring effect that invention proposes.
Embodiment
The present invention proposes a kind of method and apparatus that Multi-angle camera monitoring effect is realized based on panoramic camera.Panorama
Video camera can use fish-eye camera or mirror surface, and wherein mirror surface can be parabola or minute surface Hyperboloidal mirror.
So that panoramic camera uses fish eye camera as an example, fish eye camera can independently be realized and supervised on a large scale without dead angle
Control, its mounting means typically have two kinds, ceiling type and wall-mounted.When being installed using ceiling type, the visual range of fish eye camera
For 360 ° below camera lens;During using in-wall mounting, the visual range of fish eye camera is 180 ° in front of camera lens.The present invention
The panoramic picture (being specially fish eye images) absorbed to fish eye camera carries out the correction of corresponding different roaming angles, Mei Geman
The corresponding one correcting fisheye image figure of angle is swum, its effect is absorbed simultaneously equivalent to using multiple common cameras of multi-angle
The image of different angle.For ceiling type video camera, roaming angle is horizontal, it can be understood as is formed in X-axis and Y-axis
In plane;For wall-mounted video camera, roaming angle is vertical, it can be understood as is in the plane of Y-axis and Z axis composition.
If Fig. 1 is the method implementation process figure proposed by the present invention for realizing Multi-angle camera monitoring effect, including:
Step 101:Panoramic picture is absorbed by panoramic camera;
Step 102:For panoramic picture, multiple roaming angles are set;
Step 103:Multiple partial correction figures are obtained according to each roaming angle.
Wherein, step 103 is specifically as follows:New light according to each roaming angle-determining on panoramic picture respectively
Center;Partial correction is carried out to panoramic picture according to the new optical centre, obtains the panoramic picture of the roaming angle
Correction chart.
Can be according to the mode of new optical centre on roaming angle-determining panoramic picture:
According to it is described roaming angle, angle value set in advance, panoramic camera be imaged projection sphere radius and
Parameter value set in advance determines the coordinate value of the new optical centre;Specific determination mode will be described in detail below.
By said process, for each frame panoramic picture, several panorama sketch for being directed to the frame panoramic picture can be obtained
As correction chart, the corresponding roaming angle of each panoramic picture correction chart;The visual effect of these panoramic picture correction charts is suitable
In multiple common cameras when shooting angle is by different roaming angles the image that absorbs.
For ease of understanding, the general principle of panoramic picture correction is introduced first below.In following citing, by panorama sketch
As specially fish eye images illustrate.
Using space three-dimensional rectangular coordinate system, the spherical projection model of fish eye images is:
From origin O (0,0,0), the ray of pointing space any point (x, y, z), trade shadow sphere x2+y2+z2=R2Yu Yi
Point, 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) there is following relation:
Spatial points (x, y, z) to the projection (u, v) on fixed pan, as fish-eye imaging plane.Profit
With the inverse transformation of this model, the image that fish eye images can be transformed on perspective projection model, that is, the schools of fish eye images is realized
Just.
It is the principles and methods of correcting fisheye image above.Because fish eye images are wide-angle image, have in image border
Obvious distortion, the present invention are improved to the correcting algorithm of fish eye images, make all new optical centres on fish eye images
Point is on a circle in the range of fish eye images, so that the viewing angle of correcting fisheye image figure is natural.
If Fig. 2 is the schematic diagram that fish eye images are transformed to correcting fisheye image figure.Conversion process includes:
Step 1:According to the new optical centre on roaming angle-determining fish eye images, specifically determined using equation below:
Wherein,
P0(u1,v1) for the new optical centre on fish eye images;
For angle value set in advance;Its value can be
θ is the roaming angle;
Viewratio is numerical value set in advance.
So, existIn the case of, θ takes different value values, it is possible to achieve the effect of multiple angle monitorings.Correction
Image-watching angle is natural.Wherein viewratio is used to control new optic center point P on original fish eye images0(u1,v1) position
Put, it is ensured that all P0(u1,v1) positioned at one circle on, radius R*viewratio;Viewratio value is (0,1).
Step 2:Determine P0(u1,v1) the corresponding points P coordinate on the projection sphere of panoramic camera imaging is
Step 3:The distance for making correcting plane to centre of perspectivity O (centre of sphere for projecting sphere) is kR, wherein k>0, R is throwing
The radius of shadow sphere;Determine P0(u1,v1) coordinate of corresponding points P' on correcting plane is
Optical centre using P' as correcting plane;
Step 4:The both direction of plane coordinates axle is determined on correcting plane, is represented with vector α, β, corresponds to flake respectively
U, the positive direction of v coordinate axle on image.Upward tangential direction of the warp in the point that β selections are passing point P on projection sphere.
Vector α and β constraints are:
α is vertical with β;
α, β and OP form left-handed coordinate system.
Wherein,
α=BP × AP,
β=OP × α,
Wherein, BP is the vector that starting point is B and terminal is P, and AP is the vector that starting point is A and terminal is P, and OP is
The vector that point is O and terminal is P, the "×" represent that 2 vectors are multiplied;A and B coordinate is as follows:
Step 5:α and β is unitization, determine the width, height and P' of correcting fisheye image figure in correcting fisheye image figure
Position (i0,j0), typically it is defaulted as the center of image.
Step 6:Determine that each pixel (i, j) is in the correspondence in space in correcting fisheye image figure in such a way successively
Point Q color value, obtain the correcting fisheye image figure of the roaming angle;
Determine that corresponding points Q of the pixel (i, j) in space is (j-j0)α+(i-i0)β+kP;Determine ray OQ and projection ball
The intersection point in face isCorresponding points (u, v) of the Q points in fish eye images are obtained, by the color of point (u, v)
Value carries out interpolation processing, obtains the color value of the Q points.
By the above-mentioned means, after the every bit of correcting fisheye image image has been traveled through, that is, complete an image rectification.
Specific embodiment is lifted below to be discussed in detail:
Embodiment one:
The present embodiment uses 180 ° of fish-eye video cameras, and is installed using ceiling type, the visual model of fish eye camera
Enclose 360 ° below for camera lens.In the present embodiment, 8 roaming angle, θs are set, the value of each roaming angle, θ is respectively:0°、
45 °, 90 °, 135 °, 180 °, 225 °, 270 ° and 315 °.
The fish eye images absorbed for fish eye camera, same frame fish eye images are carried out with corresponding different roaming angles respectively
The correction of degree, 8 corresponding correcting fisheye image figures are obtained, that is, realize the effect of Multi-angle camera monitoring.According to roaming
The new optical centre of angle-determining and the concrete mode of correction as described above, do not go to live in the household of one's in-laws on getting married herein.
If Fig. 3 is that the present embodiment realizes effect diagram, in figure 3, the picture positioned at center is fish eye camera institute
The fish eye images of intake;The 8 width pictures shown picture on the right side of the fish eye images according to sequence counter-clockwise are respectively θ values
For 0 °, 45 °, 90 °, 135 °, 180 °, 225 °, 270 °, 315 ° when corresponding correcting fisheye image figure, it can be seen that fish eye images
The display effect of correction chart meets the angle looked squarely, and watches nature.
Above-described embodiment be for fish eye camera visual range be 360 ° of situations below camera lens implementation;When
During using in-wall mounting, the visual ranges of 180 ° of fish-eye video cameras is 180 ° in front of camera lens, for such case,
The mode proposed by the present invention for realizing Multi-angle camera effect is slightly distinguished, and specifically includes following steps:
By fish eye camera, fish eye images are gathered in real time;
It is horizontal positive for x-axis to the right using the center of circle of fish eye images as xy reference axis origins, positive for y-axis vertically upward, R
For the radius of center of circle image.A new optical centre (u, v) is selected, as the center of new correction chart, u, v span
It is (- R, R).
According to new optical centre, partial correction is carried out to fish eye images, obtains a correcting fisheye image figure.
On fish eye images, as needed, n point is chosen as new optical centre, to same frame circle fisheye image
It is corrected respectively, n correcting fisheye image figures is obtained, that is, the effect captured by n camera.
The method for realizing Multi-angle camera monitoring effect is described above, the present invention also proposes that one kind realizes that multi-angle is taken the photograph
As the device of head monitoring effect, such as Fig. 4 is the structural representation of the device, including:
Presetting module 401, the panoramic picture for being absorbed for panoramic camera set multiple roaming angles;
Correction module 402, for obtaining multiple partial correction figures according to each roaming angle.
In said apparatus, the new light according to each roaming angle-determining on panoramic picture respectively of correction module 402
Center;Partial correction is carried out to panoramic picture according to the new optical centre, obtains the panoramic picture of the roaming angle
Correction chart.
The mode of new optical centre of the correction module 402 according to roaming angle-determining on panoramic picture is:
According to it is described roaming angle, angle value set in advance, panoramic camera be imaged projection sphere radius and
Parameter value set in advance determines the coordinate value of the new optical centre.
Can specifically below equation be used to determine:
Wherein,
P0(u1,v1) for the new optical centre on the panoramic picture;
For angle value set in advance;
θ is the roaming angle;
Viewratio is numerical value set in advance.
Correction module 402 carries out partial correction according to new optical centre to panoramic picture, obtains roaming the panorama of angle
The mode of image rectification figure can be:
Determine P0(u1,v1) the corresponding points P coordinate on the projection sphere of panoramic camera imaging is
The distance for making correcting plane to the centre of sphere O of projection sphere is kR, wherein k>0, R is the radius of projection sphere;It is determined that
P0(u1,v1) coordinate of corresponding points P' on correcting plane isUsing P' as correcting plane
Optical centre;
The both direction of plane coordinates axle is determined on the correcting plane, is represented with vector α, β, wherein,
α=BP × AP,
β=OP × α,
The BP is the vector that starting point is B and terminal is P, and the AP is the vector that starting point is A and terminal is P, institute
It is the vector that starting point is O and terminal is P to state OP, and the "×" represents that 2 vectors are multiplied;The coordinate of the A and B are as follows:
α and β is unitization, determine the position of the width, height and P' of panoramic picture correction chart in panoramic picture correction chart
(i0,j0);
Determine the corresponding points Q of each pixel (i, j) in panoramic picture correction chart in space in such a way successively
Color value, obtain the panoramic picture correction chart of the roaming angle;
Determine that corresponding points Q of the pixel (i, j) in space is (j-j0)α+(i-i0)β+kP;Determine ray OQ and projection ball
The intersection point in face isCorresponding points (u, v) of the Q points in panoramic picture are obtained, by the color value of point (u, v)
Interpolation processing is carried out, obtains the color value of the Q points.
In said apparatus, panoramic camera can use fish eye lens or using mirror surface;Wherein mirror surface can be with
For parabolic mirror or Hyperboloidal mirror.
As fully visible, the method and apparatus proposed by the present invention for realizing Multi-angle camera monitoring effect, respectively according to each
The new optical centre on panoramic picture that individual roaming angle-determining panoramic camera is absorbed, and according to the new optical centre
Panoramic picture is corrected, so as to be corresponded to multiple panoramic picture correction charts of multiple roaming angles, these panoramas respectively
Image rectification figure can reach the monitoring effect of the multiple cameras of multi-angle;Also, when carrying out image rectification, overflow using multiple
Swim optical centre new on the panoramic picture of angle-determining to be located on a circle in the range of panoramic picture, so that panorama sketch
As the viewing angle of correction chart is natural.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
God any modification, equivalent substitution and improvements done etc., should be included within the scope of protection of the invention with principle.