CN108681987A - The method and apparatus for generating panorama slice map - Google Patents
The method and apparatus for generating panorama slice map Download PDFInfo
- Publication number
- CN108681987A CN108681987A CN201810454739.8A CN201810454739A CN108681987A CN 108681987 A CN108681987 A CN 108681987A CN 201810454739 A CN201810454739 A CN 201810454739A CN 108681987 A CN108681987 A CN 108681987A
- Authority
- CN
- China
- Prior art keywords
- panorama
- sphere
- spherical
- view
- spherical panorama
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000000007 visual effect Effects 0.000 claims abstract description 114
- 239000000463 material Substances 0.000 claims description 31
- 230000000694 effects Effects 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 4
- 238000009877 rendering Methods 0.000 claims description 3
- 230000009467 reduction Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 22
- 230000008569 process Effects 0.000 description 14
- 238000003384 imaging method Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000010422 painting Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 244000062793 Sorghum vulgare Species 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 235000019713 millet Nutrition 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000009738 saturating Methods 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/006—Mixed reality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention discloses the method and apparatus for generating panorama slice map, wherein the method includes:Obtain spherical panorama;According to the spherical panorama sphere model is created in the virtual three-dimensional world;The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;The view image for obtaining the sphere displaying view on target slice direction and in default visual angle using the center of the sphere model as viewpoint, as panorama slice map of the spherical panorama on the target slice direction.Scheme using the present invention can be obtained slice map by will be affixed in spherical panorama inside sphere model and obtain view image from some direction, simple and convenient, not need the software outside purchase volume, reduction obtains slice map cost.
Description
Technical field
The present invention relates to image processing fields, especially generate the method and device of panorama slice map.
Background technology
Spherical panorama can be analogous to a covering of the fan perpendicular to ground and revolve the institute's shape that turns around for semicircular fan
At figure, since covering of the fan is a semicircle covering of the fan, in vertical direction be in 180 degree, due to covering of the fan rotation turn around, in level
It is in 360 degree on direction, that is, spherical panorama is in the horizontal direction in 360 degree, in vertical direction in the picture of 180 degree.It will
The longitude and latitude of spherical panorama are mapped on flat network topology, and two, the north and south pole of spherical panorama is stretched as top
It is 2 that can form length-width ratio with lower edge:1 spherical panorama.
Spherical panorama is usually that (i.e. length-width ratio is 2 with flat state:1 state) it is saved in various equipment.One
In the case of a little, the spherical panorama to flat state is needed to be sliced to obtain panorama slice map in a certain direction, this is complete
Scape slice map is that a part for spherical panorama can only obtain if directly intercepted to the spherical panorama of flat state
Some slice maps in horizontal direction, cannot obtain the slice map in vertical direction, also, due to the image of, flat state be through
What overstretching obtained, so directly carrying out intercepting obtained image being a kind of figure of deformation to the spherical panorama of flat state
Picture has a certain distance with true image.Currently, can only could be realized pair by buying slice clients of some professions
Spherical panorama is sliced to obtain to feed back the panorama slice map of real scene, obtains paying required for panorama slice map
Cost is larger;In addition, since the slice client of these professions not publicly generates the technology of slice map, it can not also determine these specially
How the client of industry specifically generates panorama slice map.
Invention content
The present invention implements to provide the method and apparatus for generating panorama slice map, by will be affixed on sphere mould in spherical panorama
It inside type and obtains view image from some direction and can be obtained panorama slice map, it is simple and convenient, it does not need soft outside purchase volume
Part, reduction obtain the cost of panorama slice map.
On the one hand the embodiment of the present invention provides a kind of method generating panorama slice map, it may include:
Obtain spherical panorama;
According to the spherical panorama sphere model is created in the virtual three-dimensional world;
The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;
Acquisition on target slice direction and is presetting the sphere in visual angle using the center of the sphere model as viewpoint
The view image for showing view, as panorama slice map of the spherical panorama on the target slice direction.
In one possible implementation, the acquisition is viewpoint in target slice side using the center of the sphere model
The sphere shows the view image of view upwards and in default visual angle, including:
Virtual camera is created at the center of the sphere model, and the shooting direction of the virtual camera is set for institute
Target slice direction is stated, and, the visual angle that the virtual camera is arranged is the default visual angle;
The sphere, which is shot, by the virtual camera shows that view obtains the view image.
In one possible implementation, described that sphere is created in the virtual three-dimensional world according to the spherical panorama
Model includes:
Determine that the picture traverse of the spherical panorama, the image length-width ratio of the spherical panorama are more than one;
Sphere model, the sphere model are created in the virtual three-dimensional world according to the picture traverse of the spherical panorama
Great circle perimeter half be equal to the spherical panorama picture traverse.
In one possible implementation, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains
View is shown to sphere, including:
By determining the picture point in the spherical panorama and the sphere mould based on the inverse operation of cylindrical equidistant projection
The correspondence of umbilical point in the Internal Spherical Surface of type, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain ball
Body display view.
In one possible implementation, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains
View is shown to sphere, including:
It is determined according to the pixel characteristic of the target image point in the spherical panorama corresponding with the target image point
The material effect of target umbilical point;
The Internal Spherical Surface of the sphere model is rendered according to the material effect of each umbilical point to obtain the sphere exhibition
Show view.
In one possible implementation, the method further includes:
Slice map download instruction is obtained, the slice map download instruction includes picture visual angle and view directions;
According to the slice map download instruction by visual angle with the picture visual angle corresponding and slice direction and the visual angle
The corresponding panorama slice map in direction is saved in local.
On the one hand the embodiment of the present invention provides a kind of device generating panorama slice map, it may include:
Acquisition module, for obtaining spherical panorama;
Creation module, for creating sphere model in the virtual three-dimensional world according to the spherical panorama;
Textures module, the Internal Spherical Surface for the spherical panorama to be affixed on to the sphere model obtain sphere displaying and regard
Figure;
Slice map determining module, for obtain using the center of the sphere model as viewpoint on target slice direction and
The view image of the sphere displaying view in default visual angle, as the spherical panorama on the target slice direction
Panorama slice map.
In one possible implementation, the slice map determining module, including:
Video camera creating unit for creating virtual camera at the center of the sphere model, and is arranged described virtual
The shooting direction of video camera is the target slice direction, and, the visual angle that the virtual camera is arranged is that described preset regards
Angle;
Shooting unit shows that view obtains the view image for shooting the sphere by the virtual camera.
In one possible implementation, the creation module includes:
Picture traverse determination unit, the picture traverse for determining the spherical panorama, the figure of the spherical panorama
As length-width ratio is more than one;
Creating unit, for creating sphere mould in the virtual three-dimensional world according to the picture traverse of the spherical panorama
Type, the half of the great circle perimeter of the sphere model are equal to the picture traverse of the spherical panorama.
In one possible implementation, the textures module is specifically used for:
By determining the picture point in the spherical panorama and the sphere mould based on the inverse operation of cylindrical equidistant projection
The correspondence of umbilical point in the Internal Spherical Surface of type, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain ball
Body display view.
In one possible implementation, the textures module includes:
Material effect determination unit, for according to the pixel characteristic of the target image point in the spherical panorama determine with
The material effect of the corresponding target umbilical point of the target image point;
Rendering unit, for the Internal Spherical Surface of the sphere model render according to the material effect of each umbilical point
View is shown to the sphere.
In one possible implementation, described device further includes:
Download instruction acquisition module, for obtaining slice map download instruction, the slice map download instruction includes that picture regards
Angle and view directions;
Slice map preserving module, for according to the slice map download instruction by visual angle it is corresponding with the picture visual angle and
Slice direction panorama slice map corresponding with the view directions is saved in local.
On the one hand the embodiment of the present invention provides a kind of computer storage media, the computer storage media is stored with more
Item instructs, and described instruction is suitable for being loaded by processor and executing above-mentioned method and step.
On the one hand the embodiment of the present invention provides a kind of terminal, it may include:Processor and memory;Wherein, the storage
Device is stored with computer program, and the computer program is suitable for being loaded by the processor and executing following steps:
Obtain spherical panorama;
According to the spherical panorama sphere model is created in the virtual three-dimensional world;
The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;
Acquisition on target slice direction and is presetting the sphere in visual angle using the center of the sphere model as viewpoint
The view image for showing view, as panorama slice map of the spherical panorama on the target slice direction.
In embodiments of the present invention, it is regarded by the way that the inner surface for being affixed on sphere model in spherical panorama is obtained spherical displaying
Then figure obtains the view figure on the target slice direction at the center of sphere model at the center of sphere model with a visual angle
Picture, which is panorama slice map of the spherical panorama in target slice direction, simple and convenient, does not need to buy profession
Slice Software reduces to obtain the cost of panorama slice map.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Fig. 2 is the spherical panorama showed with flat state;
Fig. 3 is the schematic diagram provided in an embodiment of the present invention with the three-dimensional system of coordinate characterization virtual three-dimensional world;
Fig. 4 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Fig. 5 is the example schematic of great circle;
Fig. 6 is the schematic diagram of the sphere model provided in an embodiment of the present invention created by Three.js;
Fig. 7 is the schematic diagram of cylindrical equidistant projection provided in an embodiment of the present invention;
Fig. 8 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Fig. 9 is the schematic diagram at visual angle provided in an embodiment of the present invention;
Figure 10 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Figure 11 is the schematic diagram of spherical panorama and panorama slice map provided in an embodiment of the present invention;
Figure 12 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Figure 13 is a kind of view interface display schematic diagram provided in an embodiment of the present invention;
Figure 14 is a kind of flow diagram of method generating panorama slice map provided in an embodiment of the present invention;
Figure 15 is a kind of view interface display schematic diagram provided in an embodiment of the present invention;
Figure 16 is a kind of structural schematic diagram of device generating panorama slice map provided in an embodiment of the present invention;
Figure 17 is a kind of structural schematic diagram of device generating panorama slice map provided in an embodiment of the present invention;
Figure 18 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this
Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
Below in conjunction with attached drawing 1- attached drawings 15, the method provided in an embodiment of the present invention for generating panorama slice map is carried out detailed
It is thin to introduce.
Fig. 1 is referred to, for an embodiment of the present invention provides a kind of flow diagrams for the method generating panorama slice map.Such as
Shown in Fig. 1, the embodiment of the present invention the method may include following steps S101-S104.
S101 obtains spherical panorama.
In the embodiment of the present invention, spherical panorama is the spherical panorama showed with flat state, that is, in the form of rectangle
The spherical panorama showed.For example, can be as shown in Figure 2, spherical panorama is the picture of a rectangle, the rectangle picture
Image length is 2 times of picture traverse, and longer two length of sides L1 and L2 are by the spherical panorama of three-dimensional state in spherical panorama
Two, the north and south pole of figure stretches to obtain.S102 creates sphere model according to the spherical panorama in the virtual three-dimensional world.
In the embodiment of the present invention, the virtual three-dimensional world refers to being present in the world in computer, and the virtual three-dimensional world is in planar
The virtual solid space that direction vector is constituted is added in system, can be characterized with three-dimensional system of coordinate, it specifically can be such as Fig. 3
Shown, three-dimensional system of coordinate respectively includes x-axis, y-axis and z-axis, wherein the center in coordinate (0,0,0) virtual three-dimensional world, x-axis
Indicate that left and right space, y-axis indicate that upper down space, z-axis indicate front and back space, each point in the virtual three-dimensional world can use three-dimensional
Coordinate points in coordinate system indicate, for example, (1,0,0) indicates one, the right unit at the center in the virtual three-dimensional world
Point.The virtual three-dimensional world can be created in a computer based on 3-D view standard, 3-D view standard for example can be webpage
Shape library drawing (Web Graphics Library, WebGL) standard.
In the embodiment of the present invention, sphere model refers to the centre of sphere created at the center in the virtual three-dimensional world and virtual three-dimensional generation
The spherical model that the center on boundary overlaps.Point can be with the coordinate points in three-dimensional system of coordinate come table each of on the spherical surface of sphere model
Show.
In a kind of specific implementation, as shown in figure 4, it is described according to the spherical panorama in the virtual three-dimensional world
Creating sphere model may include:
S1021 determines that the picture traverse of the spherical panorama, the image length-width ratio of the spherical panorama are more than one;
In the embodiment of the present invention, the unit of the picture traverse of spherical panorama can be pixel, in the specific implementation, can pass through
Detect spherical panorama size so that it is determined that spherical panorama picture traverse, for example, the size of spherical panorama be 540*
1080 pixels, it is determined that the picture traverse of spherical panorama is 540 pixels.
S1022 creates sphere model, the ball according to the picture traverse of the spherical panorama in the virtual three-dimensional world
The half of the great circle perimeter of body Model is equal to the picture traverse of the spherical panorama.
In the embodiment of the present invention, great circle refers to the circle that spherical surface is intercepted by the plane by the centre of sphere.For example, sphere model is as schemed
Shown in 5, then great circle is as shown in the circle a in Fig. 5, and each point of great circle is all on the spherical surface of sphere model, the center of circle of great circle and ball
The centre of sphere of body Model overlaps, and the half of the perimeter of great circle is as shown in the line segment L in Fig. 5, i.e. the length of half arc of great circle.
Since the half of the perimeter of the great circle of sphere model is equal to the picture traverse of spherical panorama, it is assumed that spherical panorama
Picture traverse be d, and the half of great circle perimeter be L, then by 2 π r=2L and L=d of formula it is found that r=d/ π, that is, sphere
The sphere diameter of model is equal to the quotient of the picture traverse and pi of spherical panorama.
Optionally, the image length of the spherical panorama can also be determined, then according to the figure of the spherical panorama
As length creates sphere model in the virtual three-dimensional world, the great circle perimeter of the sphere model is equal to the spherical panorama
Image length.
Similarly, can also can by detect spherical panorama size so that it is determined that spherical panorama image length, example
Such as, the size of spherical panorama is 540*1080 pixels, it is determined that the image length of spherical panorama is 1080 pixels.
Since the perimeter of the great circle of sphere model is equal to the image length of spherical panorama, it is assumed that the image of spherical panorama
Width is e, then by 2 π r=great circles perimeters of formula and great circle perimeter=e it is found that r=e/2 π, that is, the sphere diameter etc. of sphere model
In the quotient of the image length of spherical panorama and 2 times of pis.
In the specific implementation, sphere model can be created at the center in the virtual three-dimensional world by d engine, for example, can lead to
It crosses Three.js and creates sphere model in the virtual three-dimensional world.If creating ball in the virtual three-dimensional world by Three.js
Body Model, then can be by calling the SphereGeometry in Three.js to create sphere model.For example, passing through var
Geometry=new THREE.SphereGeometry (3,18,12) can create the longitude that a sphere diameter is 3 and be divided into
18 parts and latitude are divided into 12 parts of sphere model, and the sphere model is as shown in Figure 6.When 18 and 12 value is larger,
Sphere model is visually closer to true spherical shape.In the embodiment of the present invention, by Three.js in virtual three-dimensional generation
It, can be by setting sphere diameter to the picture traverse of spherical panorama and the quotient of pi in void when creating sphere model in boundary
The half of establishment great circle perimeter is equal to the spherical model of the picture traverse of spherical panorama in quasi- three-dimensional world, alternatively, by sphere diameter
The quotient of the image length and 2 times of pis that are set as spherical panorama is equal to create great circle perimeter in the virtual three-dimensional world
The spherical model of the picture traverse of spherical panorama.It should be noted that can also be by other d engines virtual three
The center for tieing up the world creates sphere model, and the embodiment of the present invention is not limited.
S103, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere displaying view.
It is understood that sphere displaying view is the spherical panorama showed with three-dimensional state, the panorama sketch of flat state is
It is mapped on flat network topology by longitude and latitude by the spherical panorama of three-dimensional state and is formed by figure, equidistant cylinder can be passed through
The spherical panorama of three-dimensional state is converted to the spherical panorama of flat state by the process of projection, it is possible to pass through equidistant cylinder
The spherical panorama of flat state is converted to the spherical panorama of three-dimensional state by the inverse process of projection.It, can be in the embodiment of the present invention
By determining the picture point in spherical panorama and the Internal Spherical Surface of the sphere model based on the inverse operation of cylindrical equidistant projection
Correspondence, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere displaying view.
Below come to determining picture point in spherical panorama and sphere model based on the inverse operation of cylindrical equidistant projection
The correspondence of Internal Spherical Surface is specifically described.For ease of understanding, the process for introducing cylindrical equidistant projection first, referring to Fig. 7,
The process of cylindrical equidistant projection is that the warp and weft of sphere are converted to the process of cartesian grid, in cartesian grid,
The warp (referring to the semicircle that the perimeter in the vertical direction of sphere is equal to the half of great circle) and weft of sphere (refer on sphere
The circle parallel with horizontal plane) intersected with 90 degree, two, the north and south pole of sphere (refers to the ball that all warps on sphere pass through
Millet cake) it is stretched as the top edge and lower edge of cartesian grid.The inverse process of cylindrical equidistant projection is by cartesian grid
Lattice revert to the process of warp and weft, and the top edge and lower edge in cartesian grid are compressed to two, north and south pole
Point divides spherical panorama according to cartesian grid, then according to point and sphere in cartesian grid point pair
It should be related to, then can determine the correspondence of the picture point and the umbilical point on sphere model inner surface in spherical panorama.
It, can be by sphere model after the correspondence of the Internal Spherical Surface of picture point and sphere model in determining spherical panorama
In each umbilical point be rendered into the identical image of corresponding with umbilical point picture point, show view to obtain sphere.In one kind
In specific implementation, as shown in figure 8, the inner surface that the spherical panorama is affixed on to the sphere model obtains sphere
Show that view includes:
S201 is determined and the target image point pair according to the pixel characteristic of the target image point in the spherical panorama
The material effect for the target umbilical point answered.
In the embodiment of the present invention, the pixel characteristic of target image point refers to color, brightness, the vision of the target image point
Element composition etc. can embody the target image point and the difference of other pixels or the feature of similarity degree.
Here, if target umbilical point and target image point are one-to-one relationships, if target umbilical point is sphere
Point on equator (referring to the great circle parallel with horizontal plane on sphere), it is determined that the material effect of the target umbilical point and target figure
The pixel characteristic of picture point is identical, i.e. the color of the material effect of target umbilical point, brightness, visual element composition and target image point
Color, brightness, visual element composition etc. it is identical.If target umbilical point and target image point are not one-to-one relationships,
It, then can be with the corresponding multiple target image points of integration objective umbilical point if target umbilical point is the pole at north and south the two poles of the earth on sphere
Pixel characteristic determine with the material effect of the target image point, for example, can multiple target images corresponding to target umbilical point
Color, brightness, the visual element etc. of point do handling averagely, and target umbilical point is determined according to the result that handling averagely obtains
Material effect.
S202 renders the Internal Spherical Surface of the sphere model according to the material effect of each umbilical point to obtain the ball
Body display view.
It, can also be by calling the MeshBasicMaterial in Three.js will in another specific implementation
The Internal Spherical Surface that spherical panorama is affixed on sphere model obtains sphere displaying view, for example, can pass through
Var material=new THREE.MeshBasicMaterial ({ map:newTHREE.TextureLoader
().load('tupian.jpg')});Mesh=newTHREE.Mesh (geometry, material) is entitled by one
It is affixed in the spherical panorama of tupian on the spherical surface of sphere model and obtains the corresponding sphere displaying view of spherical panorama.
S104 is obtained on target slice direction and described in default visual angle using the center of the sphere model as viewpoint
Sphere shows the view image of view, as panorama slice map of the spherical panorama on the target slice direction.
In the embodiment of the present invention, visual angle refers to from the center of sphere model, onto the vertical direction of imaging plane
Subtended angle, the schematic diagram at visual angle can using as shown in figure 9, i.e. visual angle as the top edge at the center of sphere model to imaging plane first
Point line and sphere model center to imaging plane lower edge between the line of first point of corresponding second point
Angle, wherein the line of first point and second point is perpendicular to horizontal plane.
In the embodiment of the present invention, target slice direction is using the center of sphere model as the direction of starting point, for example, target slice
Direction is front, refers to the front at the center of sphere model.
In a kind of specific implementation, as shown in Figure 10, the acquisition is existed using the center of the sphere model as viewpoint
The sphere shows that the view image of view includes on target slice direction and in default visual angle:
S301 creates virtual camera at the center of the sphere model, and the shooting side of the virtual camera is arranged
To for the target slice direction, and, the visual angle that the virtual camera is arranged is the default visual angle.
In the embodiment of the present invention, virtual camera is to be present in the virtual three-dimensional world to meet near big and far smaller imaging rule
Rule is so that the view image of shooting meets the video camera of natural view.
In the specific implementation, can be by calling the perspective projection video camera (Perspective Camera) in Three.js to exist
Shooting is completed in the virtual three-dimensional world.Can by camera=new THREE.PerspectiveCamera (fov, aspect,
Near, far) create perspective projection video camera, wherein fov is set as default visual angle to which the visual angle of virtual camera to be arranged
To preset visual angle;The position of virtual camera can be set by camera position.set (x, y, z), wherein will (x, y,
Z) (0,0,0) is set as to set the position of virtual camera at the center of sphere model;Camera.lookAt can be passed through
(scene.position) shooting direction of virtual camera is set, wherein sets scene.position to target slice
Direction is to set the shooting direction of virtual camera to target slice direction.
The shooting direction of virtual camera is illustrated below.Due in the virtual three-dimensional world, coordinate (0,0,0) table
Show that the center in the virtual three-dimensional world, x-axis indicate that left and right space, y-axis indicate that upper down space, z-axis indicate front and back space, then virtually take the photograph
The shooting direction of camera can be indicated with three-dimensional coordinate, for example, shooting direction is front, then can be used
Camera.lookAt (0,0,1) come indicate front, wherein camera.lookAt (0,0,1) indicate be from virtual three-dimensional
The center (0,0,0) in the world is set out the front at the center to the direction of three-dimensional coordinate (0,0,1) namely the virtual three-dimensional world.
S302 shoots the sphere by the virtual camera and shows that view obtains the view image.
Optionally, different visual angles or different shooting direction can also be obtained by adjusting the shooting direction of video camera and visual angle
Under view image to get the panorama slice map to spherical panorama under different visual angles or different shooting direction.For example, spherical
For panorama sketch as shown in the p in Figure 11, currently to obtain visual angle is 90 degree, and shooting direction is respectively front, dead astern, a positive left side
Side, front-right, surface, underface panorama slice map, then can be 90 by the way that fov is arranged, then camera.lookAt is set
(scene.position) be respectively (0,0,1), (0,0, -1), (1,0,0), (- 1,0,0), (0,1,0), (0, -1,0) to
Shooting direction is respectively set to front, dead astern, front-left, front-right, surface, underface, and then by virtually taking the photograph
Camera shoots to obtain spherical panorama in front, dead astern, front-left, front-right, the view image of surface, underface,
Respectively such as p1, p2, p3, p4, the p5 in Figure 11, shown in p6, p1~p6 in Figure 11 be spherical panorama in front, just after
Side, front-left, front-right, surface, the panorama slice map on underface.It is 90 degree to obtain visual angle by virtual camera,
Shooting direction is front, dead astern, front-left, front-right, the view image of surface, underface, be can be obtained nonoverlapping
And it can fully reflect the panorama slice map of the details of spherical panorama all directions.
In the embodiment of the present invention, regarded by the way that the inner surface for being affixed on sphere model in spherical panorama is obtained spherical displaying
Then figure obtains the view figure on the target slice direction at the center of sphere model at the center of sphere model with a visual angle
Picture, which is panorama slice map of the spherical panorama in target slice direction, simple and convenient, does not need to buy profession
Slice Software reduces to obtain the cost of panorama slice map.
Figure 12 is referred to again, for an embodiment of the present invention provides a kind of flow signals of method generating panorama slice map
Figure, as shown in figure 11, the embodiment of the present invention the method may include following steps S401-S406.
S401 obtains spherical panorama.
S402 creates sphere model according to the spherical panorama in the virtual three-dimensional world.
S403, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere displaying view.
Here, the specific implementation of step S401~S403 can refer to step S101 in the corresponding embodiments of Fig. 1~
The description of S104, details are not described herein again.
S404 obtains slice map download instruction, and the slice map download instruction includes picture visual angle and view directions.
In the embodiment of the present invention, picture visual angle refers to the shooting visual angle that user wishes the picture preserved, and view directions refer to using
Wish the shooting direction of the picture preserved in family.
In the specific implementation, slice map download instruction can be obtained by input interface, for example, passing through mouse, keyboard, touch
Screen etc. obtains slice map download instruction.
For example, as shown in figure 13, while showing the spherical panorama of three-dimensional state to user, go back display view angle it is specified and
Direction designated button, visual angle is specified and direction designated button inputs wish that the shooting of the picture preserved regards respectively by clicking by user
Angle and view directions are referred to by getting slice map download after the specified input for getting user with direction designated button in visual angle
It enables.
S405, it is viewpoint in the view directions and the institute in the picture visual angle to obtain using the center of the sphere model
The view image for stating sphere displaying view, as panorama slice map of the spherical panorama in the view directions.
Here, the specific implementation of step S405 can refer to the description of step S104, and details are not described herein again.
The panorama slice map is saved in local by S406.
In the embodiment of the present invention, the panorama slice map got in step S405 is view image, is in view image
In the case of picture format, the view image got is directly saved in local;It is not picture lattice in the format of view image
In the case of formula, view image can be converted to picture and be saved in local, for example, view image is by saturating in Three.js
Depending on the image that projection video camera is shot, view image is the content in canvas labels, then can be turned by painting canvas picture
Exchange the letters number (convertedCanvasToImage), will by the view image that the content transformation in canvas labels is picture format
It is saved in local.
In the embodiment of the present invention, according in slice map download instruction picture visual angle and view directions generate visual angle and the figure
Piece visual angle is identical and slice direction panorama slice map identical with the view directions, meets user demand, need not be additional
Purchase profession cuts figure software, reduces the cost that user obtains slice map.
Figure 14 is referred to again, for an embodiment of the present invention provides a kind of flow signals of method generating panorama slice map
Figure, as shown in figure 14, the embodiment of the present invention the method may include following steps S501-S506.
S501 obtains spherical panorama.
S502 creates sphere model according to the spherical panorama in the virtual three-dimensional world.
S503, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere displaying view.
S504 is obtained on target slice direction and described in default visual angle using the center of the sphere model as viewpoint
Sphere shows the view image of view, as panorama slice map of the spherical panorama on the target slice direction.
Here, the specific implementation of step S501~S504 can refer to the description of step S101~S104, herein no longer
It repeats.
S505 obtains slice map download instruction, and the slice map download instruction includes picture visual angle and view directions.
In the embodiment of the present invention, picture visual angle refers to the shooting visual angle that user wishes the slice map preserved, and view directions refer to
User wishes the shooting direction of the slice map preserved.
In the specific implementation, slice map download instruction can be obtained by input interface, for example, passing through mouse, keyboard, touch
Screen etc. obtains slice map download instruction.
For example, as shown in figure 15, the panorama slice map (p1~p6 in such as Figure 11) currently got is being shown to user
While, go back that display view angle is specified and direction designated button, user by click that visual angle is specified and direction designated button distinguish it is defeated
Enter to wish the shooting visual angle and view directions of the slice map preserved, gets user's with direction designated button by the way that visual angle is specified
Slice map download instruction is got after input.
S506, in the panorama slice map currently got by visual angle with the picture visual angle corresponding and slice direction with
The corresponding panorama slice map of the view directions is saved in local.
If there are visual angles in the view image currently got, identical and slice direction is regarded with described with picture visual angle
The identical panorama slice map in angular direction, then by the visual angle and the picture visual angle and slice direction it is identical as the view directions
Panorama slice map be saved in local.For example, the view image currently got is as shown in figure 11, there is p1~p6 totally six respectively
View image, it is assumed that the picture visual angle of user's panorama slice map to be obtained is 90 degree, and view directions are front, then by p1 institutes
The view image shown is saved in local.
If in the view image currently got there is no visual angle is identical as picture visual angle and slice direction with it is described
The identical panorama slice map of view directions, then by visual angle in the view image currently got and the picture visual angle closest to simultaneously
And slice direction is saved in local with the immediate view image of the view directions.For example, the view image currently got
As shown in figure 11, there are p1~p6 totally six view images respectively, it is assumed that the picture visual angle of user's panorama slice map to be obtained is
90 degree, view directions are front to 50 degree of left avertence, and the view image of front-left is immediate for slice direction and view directions
View image shown in p3 is then saved in local by view image.
It is picture format in view image since the panorama slice map got is view image in the embodiment of the present invention
In the case of, determining view image is directly saved in local;In the case where the format of view image is not picture format,
Determining view image can be converted to picture and be saved in local, for example, view image is to be thrown by the perspective in Three.js
The image that shadow video camera is shot, view image are the content in canvas labels, then can convert letter by painting canvas picture
Number (convertedCanvasToImage) is protected the view image that the content transformation in canvas labels is picture format
It is stored to local.
In the embodiment of the present invention, according in slice map download instruction picture visual angle and view directions from currently getting
The local that corresponding view image is downloaded is found in view image, meets user demand, does not need extra purchase profession
Figure software is cut, the cost that user obtains slice map is reduced.
It is situated between in detail to the device provided in an embodiment of the present invention for generating panorama slice map below in conjunction with Figure 16-Figure 18
It continues.It is described generate panorama slice map device can be have calculation processing, image processing function terminal.It needs to illustrate
It is device shown in Figure 16-Figure 18, the method for executing Fig. 1-embodiment illustrated in fig. 15 of the present invention, for convenience of description, only
It shows and is not disclosed with the relevant part of the embodiment of the present invention, particular technique details, please referred to shown in Fig. 1-Figure 15 of the present invention
Embodiment.
Figure 16 is referred to, for an embodiment of the present invention provides a kind of structural schematic diagrams for the device generating panorama slice map.
As shown in figure 16, the device 60 of the generation panorama slice map of the embodiment of the present invention may include:Acquisition module 61 creates mould
Block 62, textures module 63 and slice map determining module 64, wherein:
Acquisition module 61, for obtaining spherical panorama.
In the embodiment of the present invention, spherical panorama is the spherical panorama showed with flat state, that is, in the form of rectangle
The spherical panorama showed.For example, can with as shown in Fig. 2, spherical panorama be a rectangle picture, the figure of the rectangle picture
As 2 times that length is picture traverse, longer two length of sides L1 and L2 are by the spherical panorama of three-dimensional state in spherical panorama
Two, north and south pole stretch to obtain.
Creation module 62, for creating sphere model in the virtual three-dimensional world according to the spherical panorama.The present invention
In embodiment, the virtual three-dimensional world refers to being present in the world in computer, and the virtual three-dimensional world is added in planar system
Enter the virtual solid space that direction vector is constituted, can be characterized with three-dimensional system of coordinate, specifically can with as shown in figure 3,
Three-dimensional system of coordinate respectively includes x-axis, y-axis and z-axis, wherein the center in coordinate (0,0,0) virtual three-dimensional world, x-axis indicate left
Right space, y-axis indicate that upper down space, z-axis indicate that front and back space, each point in the virtual three-dimensional world can use three-dimensional system of coordinate
In coordinate points indicate, for example, (1,0,0) indicates the point in one, the right unit at the center in the virtual three-dimensional world.It creates
Module 62 can create the virtual three-dimensional world in a computer based on 3-D view standard, and 3-D view standard for example can be net
Page shape library drawing (Web Graphics Library, WebGL) standard.
In the embodiment of the present invention, sphere model refers to the centre of sphere created at the center in the virtual three-dimensional world and virtual three-dimensional generation
The sphere model that the center on boundary overlaps.Each of on the spherical surface of sphere model point can with the coordinate points in the virtual three-dimensional world come
It indicates.
In a kind of specific implementation, the creation module 62 may include:
Picture traverse determination unit, the picture traverse for determining the spherical panorama, the figure of the spherical panorama
As length-width ratio is more than one;
In the embodiment of the present invention, the unit of the picture traverse of spherical panorama can be pixel, in the specific implementation, image is wide
Spend determination unit can by detect spherical panorama size so that it is determined that spherical panorama picture traverse, for example, spherical complete
The size of scape figure is 540*1080 pixels, then picture traverse determination unit determines that the picture traverse of spherical panorama is 540 pixels.
Creating unit, for creating sphere mould in the virtual three-dimensional world according to the picture traverse of the spherical panorama
Type, the half of the great circle perimeter of the sphere model are equal to the picture traverse of the spherical panorama.
In the embodiment of the present invention, great circle refers to the circle that spherical surface is intercepted by the plane by the centre of sphere.For example, sphere model is as schemed
Shown in 5, then great circle is as shown in the circle a in Fig. 5, and each point of great circle is all on the spherical surface of sphere model, the center of circle of great circle and ball
The centre of sphere of body Model overlaps, and the half of the perimeter of great circle is as shown in the line segment L in Fig. 5, i.e. the length of half arc of great circle.
Since the half of the perimeter of the great circle of sphere model is equal to the picture traverse of spherical panorama, it is assumed that spherical panorama
Picture traverse be d, then by 2 π r=2L and L=d of formula it is found that r=d/ π, that is, the sphere diameter of sphere model is equal to spherical complete
The picture traverse of scape figure and the quotient of pi.
Optionally, creation module 62 can also determine the image length of the spherical panorama, then according to the spherical shape
The image length of panorama sketch creates sphere model in the virtual three-dimensional world, and the great circle perimeter of the sphere model is equal to the ball
The image length of shape panorama sketch.
Similarly, creation module 62 can also can by detect spherical panorama size so that it is determined that spherical panorama figure
As length, for example, the size of spherical panorama is 540*1080 pixels, it is determined that the image length of spherical panorama is 1080 pictures
Element.
Since the perimeter of the great circle of sphere model is equal to the image length of spherical panorama, it is assumed that the image of spherical panorama
Width is e, then by 2 π r=great circles perimeters of formula and great circle perimeter=e it is found that r=e/2 π, that is, the sphere diameter etc. of sphere model
In the quotient of the image length of spherical panorama and 2 times of pis.
In the specific implementation, creation module 62 can create sphere mould by d engine at the center in the virtual three-dimensional world
Type, for example, creation module 62 can create sphere model by Three.js in the virtual three-dimensional world.If creation module 62 is logical
It crosses Three.js and creates sphere model in the virtual three-dimensional world, then creation module 62 can be by calling in Three.js
SphereGeometry creates sphere model.For example, creation module 62 passes through var geometry=new
THREE.SphereGeometry (3,18,12) can create the longitude that a sphere diameter is 3 and be divided into 18 parts and latitude quilt
It is divided into 12 parts of sphere model, the sphere model is as shown in Figure 6.When 18 and 12 value is larger, sphere model is in vision
On closer to true spherical shape.In the embodiment of the present invention, sphere mould is being created in the virtual three-dimensional world by Three.js
When type, the creating unit of creation module 62 can by set sphere diameter to the quotient of the picture traverse of spherical panorama and pi from
And the half that great circle perimeter is created in the virtual three-dimensional world is equal to the spherical model of the picture traverse of spherical panorama, alternatively,
Sphere diameter is set to the image length of spherical panorama and the quotient of 2 times of pis to create big circumference in the virtual three-dimensional world
The spherical model of the long picture traverse equal to spherical panorama.It should be noted that creation module 62 can also pass through others
D engine creates sphere model at the center in the virtual three-dimensional world, and the embodiment of the present invention is not limited.
Textures module 63, the Internal Spherical Surface for the spherical panorama to be affixed on to the sphere model obtain sphere displaying and regard
Figure.
It is understood that sphere displaying view is the spherical panorama showed with three-dimensional state, the panorama sketch of flat state is
It is mapped on flat network topology by longitude and latitude by the spherical panorama of three-dimensional state and is formed by figure, equidistant cylinder can be passed through
The spherical panorama of three-dimensional state is converted to the spherical panorama of flat state by the process of projection, then can pass through cylindrical equidistant projection
Inverse process the spherical panorama of flat state is converted to the spherical panorama of three-dimensional state.In the embodiment of the present invention, textures module
The 63 specific picture points that can be used for determining based on the inverse operation of cylindrical equidistant projection in spherical panorama and the sphere model
Internal Spherical Surface correspondence, the spherical panorama is affixed on the sphere model Internal Spherical Surface obtain sphere displaying view.
Below come to determining picture point in spherical panorama and sphere model based on the inverse operation of cylindrical equidistant projection
The correspondence of Internal Spherical Surface is specifically described.For ease of understanding, the process for introducing cylindrical equidistant projection first, referring to Fig. 7,
The process of cylindrical equidistant projection is that the warp and weft of sphere are converted to the process of cartesian grid, in cartesian grid,
The warp (referring to the semicircle that the perimeter in the vertical direction of sphere is equal to the half of great circle) and weft of sphere (refer on sphere
The circle parallel with horizontal plane) intersected with 90 degree, two, the north and south pole of sphere (refers to the ball that all warps on sphere pass through
Millet cake) it is stretched as the top edge and lower edge of cartesian grid.The inverse process of cylindrical equidistant projection is by cartesian grid
Lattice revert to the process of warp and weft, and the top edge and lower edge in cartesian grid are compressed to two, north and south pole
Point divides spherical panorama according to cartesian grid, then according to point and sphere in cartesian grid point pair
It should be related to, then can determine the correspondence of the picture point and the umbilical point on sphere model inner surface in spherical panorama.
After the correspondence of the Internal Spherical Surface of picture point and sphere model in determining spherical panorama, textures module 63 can
Each umbilical point in sphere model is rendered into the identical image of corresponding with umbilical point picture point, is regarded with obtaining sphere displaying
Figure.In a kind of specific implementation, the textures module 63 may include:
Material effect determination unit, for according to the pixel characteristic of the target image point in the spherical panorama determine with
The material effect of the corresponding target umbilical point of the target image point;
In the embodiment of the present invention, the pixel characteristic of target image point refers to color, brightness, the vision of the target image point
Element composition etc. can embody the target image point and the difference of other pixels or the feature of similarity degree.
Here, if target umbilical point and target image point are one-to-one relationships, if target umbilical point is sphere
Point on equator (referring to the great circle parallel with horizontal plane on sphere), then material effect determination unit determine the target umbilical point
Material effect is identical as the pixel characteristic of target image point, i.e. the color of the material effect of target umbilical point, brightness, visual element
Composition is identical as the color of target image point, brightness, visual element composition etc..If target umbilical point is not with target image point
One-to-one relationship, if target umbilical point is the pole at north and south the two poles of the earth on sphere, then material effect determination unit can be comprehensive
The pixel characteristic for closing the corresponding multiple target image points of target umbilical point determines and the material effect of the target image point, for example,
Can color, brightness, the visual element etc. of multiple target image points corresponding to target umbilical point do handling averagely, according to average
The result that change is handled determines the material effect of target umbilical point.
Rendering unit, for the Internal Spherical Surface of the sphere model render according to the material effect of each umbilical point
View is shown to the sphere.
In another specific implementation, textures module 63 can also be by calling in Three.js
The Internal Spherical Surface that spherical panorama is affixed on sphere model by MeshBasicMaterial obtains sphere displaying view, for example, can lead to
It crosses
Var material=new THREE.MeshBasicMaterial ({ map:newTHREE.TextureLoader
().load('tupian.jpg')});Mesh=newTHREE.Mesh (geometry, material) is entitled by one
It is affixed in the spherical panorama of tupian on the spherical surface of sphere model and obtains the corresponding sphere displaying view of spherical panorama.
Slice map determining module 64, for obtain using the center of the sphere model as viewpoint on target slice direction simultaneously
The sphere shows the view image of view in default visual angle, as the spherical panorama on the target slice direction
Panorama slice map.
In the embodiment of the present invention, visual angle refers to from the center of sphere model, onto the vertical direction of imaging plane
Subtended angle, the schematic diagram at visual angle can using as shown in figure 9, i.e. visual angle as the top edge at the center of sphere model to imaging plane first
Point line and sphere model center to imaging plane lower edge between the line of first point of corresponding second point
Angle, wherein the line of first point and second point is perpendicular to horizontal plane.
In the embodiment of the present invention, target slice direction is using the center of sphere model as the direction of starting point, for example, target slice
Direction is front, refers to the front at the center of sphere model.
In a kind of specific implementation, slice map determining module 64 may include:
Video camera creating unit for creating virtual camera at the center of the sphere model, and is arranged described virtual
The shooting direction of video camera is the target slice direction, and, the visual angle that the virtual camera is arranged is that described preset regards
Angle;
In the embodiment of the present invention, virtual camera is to be present in the virtual three-dimensional world to meet near big and far smaller imaging rule
Rule is so that the image of shooting meets the video camera of natural view.
In the specific implementation, video camera creating unit can be by calling the perspective projection video camera in Three.js
(Perspective Camera) completes shooting in the virtual three-dimensional world.Video camera creating unit can pass through camera=new
THREE.PerspectiveCamera (fov, aspect, near, far) creates perspective projection video camera, wherein video camera is created
It builds unit and fov is set as default visual angle to set the visual angle of virtual camera to default visual angle;Video camera creating unit can
Pass through the position that virtual camera is arranged in camera position.set (x, y, z), wherein video camera creating unit general (x, y,
Z) (0,0,0) is set as to set the position of virtual camera at the center of sphere model;Video camera creating unit can lead to
Cross the shooting direction of camera.lookAt (scene.position) setting virtual cameras, wherein video camera creating unit will
Scene.position is set as target slice direction to set the shooting direction of virtual camera to target slice direction.
The shooting direction of virtual camera is illustrated below.Due in the virtual three-dimensional world, coordinate (0,0,0) table
Show that the center in the virtual three-dimensional world, x-axis indicate that left and right space, y-axis indicate that upper down space, z-axis indicate front and back space, then virtually take the photograph
The shooting direction of camera can be indicated with three-dimensional coordinate, for example, shooting direction is front, then can be used
Camera.lookAt (0,0,1) come indicate front, wherein camera.lookAt (0,0,1) indicate be virtual three-dimensional generation
The center (0,0,0) on boundary is set out the front at the center to the direction of three-dimensional coordinate (0,0,1) namely the virtual three-dimensional world.
Shooting unit shoots the sphere by the virtual camera and shows that view obtains the view image.
Optionally, slice map determining module 64 can also obtain difference by adjusting the shooting direction of video camera and visual angle and regard
View image under angle or different shooting direction is to get the panorama to spherical panorama under different visual angles or different shooting direction
Slice map.For example, it is 90 degree that spherical panorama, which as shown in the p in Figure 11, will currently obtain visual angle, shooting direction is respectively just
Front, dead astern, front-left, front-right, surface, underface panorama slice map, then slice map determining module 64 is by taking the photograph
Camera creating unit be arranged fov be 90, then be arranged camera.lookAt (scene.position) be respectively (0,0,1), (0,
0, -1), (1,0,0), (- 1,0,0), (0,1,0), (0, -1,0) to by shooting direction be respectively set to front, dead astern,
Front-left, front-right, surface, underface, so by shooting unit shoot to obtain spherical panorama in front, just after
Side, front-left, front-right, the view image of surface, underface, respectively such as p1, p2, p3, p4, the p5 in Figure 11, shown in p6,
P1~p6 in Figure 11 is that spherical panorama is complete on front, dead astern, front-left, front-right, surface, underface
Scape slice map.It is 90 degree to obtain visual angle by virtual camera, and shooting direction is front, dead astern, front-left, the positive right side
Nonoverlapping details that can fully reflect spherical panorama all directions can be obtained in the view image of side, surface, underface
Slice map.
In the embodiment of the present invention, the device of panorama slice map is generated by will be affixed in sphere model in spherical panorama
Surface obtains spherical displaying view, then obtains the target at the center of sphere model with a certain visual angle at the center of sphere model
View image on slice direction, which is slice map of the spherical panorama in target slice direction, simple and convenient,
The Slice Software for not needing to buy profession, reduces to obtain the cost of panorama slice map.
Refer to Figure 17, for an embodiment of the present invention provides it is a kind of generate panorama slice map device structural schematic diagram,
Described device may include acquisition module 61, creation module 62, textures module 63 and slice in above-mentioned Figure 16 corresponding embodiments
Figure determining module 64, further, described device can also include download instruction acquisition module 65 and slice map preserving module 66,
Wherein:
The download instruction acquisition module 65, for obtaining slice map download instruction, the slice map download instruction includes
Picture visual angle and view directions;
The slice map preserving module 66, for according to the slice map download instruction by visual angle and the picture visual angle pair
It answers and slice direction panorama slice map corresponding with the view directions is saved in local.
If there are visual angles in the view image that slice map determining module 64 is currently got it is identical as picture visual angle and
Slice direction panorama slice map identical with the view directions, then slice map preserving module 66 visual angle and the picture are regarded
Angle and slice direction panorama slice map identical with the view directions is saved in local.For example, the view currently got
Image is as shown in figure 11, there is p1~p6 totally six view images respectively, it is assumed that the picture of user's panorama slice map to be obtained regards
Angle is 90 degree, and view directions are front, then view image shown in p1 are saved in local.
If there is no visual angle is identical as picture visual angle simultaneously in the view image that slice map determining module 64 is currently got
And slice direction panorama slice map identical with the view directions, then the view that slice map preserving module 66 will currently be got
Visual angle is closest with the picture visual angle in image and slice direction is preserved with the immediate view image of the view directions
To local.For example, the view image currently got is as shown in figure 11, there are p1~p6 totally six view images respectively, it is assumed that use
The picture visual angle of the family panorama slice map to be obtained is 90 degree, and view directions are front to 50 degree of left avertence, the view of front-left
Image is slice direction and the immediate view image of view directions, then view image shown in p3 is saved in local.
It is figure in view image since the panorama slice map got is view image form in the embodiment of the present invention
In the case of piece format, determining view image is directly saved in local by slice map preserving module 66;In the lattice of view image
In the case that formula is not picture format, slice map preserving module 66 can convert determining view image in picture and be saved in this
Ground, for example, view image is the image shot by the perspective projection video camera in Three.js, view image is
Content in canvas labels, then slice map preserving module 66 can pass through painting canvas picture transfer function
(convertedCanvasToImage) it by the view image that the content transformation in canvas labels is picture format, is preserved
To local.
In the embodiment of the present invention, slice map of the device of panorama slice map in spherical panorama in target slice direction is generated
Later, picture corresponding with the slice map download instruction is saved in by local according to slice map download instruction, allows users to protect
The slice map for depositing oneself want to save does not need to buy the Slice Software of profession, reduces the cost that user obtains panorama slice map.
Figure 18 is referred to, for an embodiment of the present invention provides a kind of structural schematic diagrams of terminal.As shown in figure 18, the end
End 70 may include:At least one processor 701, such as CPU, at least one network interface 704, user interface 703, memory
705, at least one communication bus 702.Wherein, communication bus 702 is for realizing the connection communication between these components.Wherein,
User interface 703 may include display screen (Display), camera (Camera), and optional user interface 703 can also include mark
Wireline interface, the wireless interface of standard.Network interface 704 may include optionally standard wireline interface and wireless interface (such as WI-
FI interfaces).Memory 705 can be high-speed RAM memory, can also be non-labile memory (non-volatile
Memory), a for example, at least magnetic disk storage.Memory 705 optionally can also be at least one and be located remotely from aforementioned place
Manage the storage device of device 501.As shown in figure 18, as may include in a kind of memory 705 of computer storage media operation
System, network communication module, Subscriber Interface Module SIM and generation panorama slice map application program.
In the terminal 70 shown in Figure 18, user interface 703 is mainly used for providing the interface of input to the user, obtains user
The data of input;And processor 701 can be used for calling the generation panorama slice map application program stored in memory 705, and
It is specific to execute following operation:
Obtain spherical panorama;
According to the spherical panorama sphere model is created in the virtual three-dimensional world;
The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;
Acquisition on target slice direction and is presetting the sphere in visual angle using the center of the sphere model as viewpoint
The view image for showing view, as panorama slice map of the spherical panorama on the target slice direction.
In one embodiment, to obtain using the center of the sphere model be viewpoint in mesh to the processor 701 executing
It marks on slice direction and when the view image of the sphere displaying view, specifically executes following operation in default visual angle:
Virtual camera is created at the center of the sphere model, and the shooting direction of the virtual camera is set for institute
Target slice direction is stated, and, the visual angle that the virtual camera is arranged is the default visual angle;
The sphere, which is shot, by the virtual camera shows that view obtains the view image.
In one embodiment, the processor 701 is being executed according to the spherical panorama in the virtual three-dimensional world
It is specific to execute following operation when creating sphere model:
Determine that the picture traverse of the spherical panorama, the image length-width ratio of the spherical panorama are more than one;
Sphere model, the sphere model are created in the virtual three-dimensional world according to the picture traverse of the spherical panorama
Great circle perimeter half be equal to the spherical panorama picture traverse.
In one embodiment, the spherical panorama is affixed on the sphere model by the processor 701 in execution
It is specific to execute following operation when Internal Spherical Surface obtains sphere displaying view:
By determining the picture point in the spherical panorama and the sphere mould based on the inverse operation of cylindrical equidistant projection
The correspondence of umbilical point in the Internal Spherical Surface of type, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain ball
Body display view.
In one embodiment, the spherical panorama is affixed on the sphere model by the processor 701 in execution
It is specific to execute following operation when Internal Spherical Surface obtains sphere displaying view:
It is determined according to the pixel characteristic of the target image point in the spherical panorama corresponding with the target image point
The material effect of target umbilical point;
The Internal Spherical Surface of the sphere model is rendered according to the material effect of each umbilical point to obtain the sphere exhibition
Show view.
In one embodiment, the processor 701 also executes following operation:
Slice map download instruction is obtained, the slice map download instruction includes picture visual angle and view directions;
According to the slice map download instruction by visual angle with the picture visual angle corresponding and slice direction and the visual angle
The corresponding panorama slice map in direction is saved in local.
In the embodiment of the present invention, the device of panorama slice map is generated by will be affixed in sphere model in spherical panorama
Surface obtains spherical displaying view, then obtains the target at the center of sphere model with a certain visual angle at the center of sphere model
View image on slice direction, which is slice map of the spherical panorama in target slice direction, and is also
User provides slice map download function, reduces the cost that user obtains panorama slice map.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium
In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.
Claims (14)
1. a kind of method generating panorama slice map, which is characterized in that including:
Obtain spherical panorama;
According to the spherical panorama sphere model is created in the virtual three-dimensional world;
The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;
Obtain the sphere displaying on target slice direction and in default visual angle using the center of the sphere model as viewpoint
The view image of view, as panorama slice map of the spherical panorama on the target slice direction.
2. according to the method described in claim 1, it is characterized in that, the acquisition is existed using the center of the sphere model as viewpoint
The sphere shows that the view image of view includes on target slice direction and in default visual angle:
The shooting direction for creating virtual camera at the center of the sphere model, and the virtual camera being arranged is the mesh
Slice direction is marked, and, the visual angle that the virtual camera is arranged is the default visual angle;
The sphere, which is shot, by the virtual camera shows that view obtains the view image.
3. according to the method described in claim 1, it is characterized in that, it is described according to the spherical panorama in the virtual three-dimensional world
Middle establishment sphere model includes:
Determine that the picture traverse of the spherical panorama, the image length-width ratio of the spherical panorama are more than one;
Create sphere model in the virtual three-dimensional world according to the picture traverse of the spherical panorama, the sphere model it is big
The half of circumference is equal to the picture traverse of the spherical panorama.
4. according to the method described in claim 3, it is characterized in that, described be affixed on the sphere model by the spherical panorama
Internal Spherical Surface obtain sphere displaying view include:
By determining the picture point in the spherical panorama and the sphere model based on the inverse operation of cylindrical equidistant projection
The correspondence of umbilical point in Internal Spherical Surface, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere exhibition
Show view.
5. according to the method described in claim 4, it is characterized in that, described be affixed on the sphere model by the spherical panorama
Internal Spherical Surface obtain sphere displaying view include:
Target corresponding with the target image point is determined according to the pixel characteristic of the target image point in the spherical panorama
The material effect of umbilical point;
It is rendered to obtain the sphere displaying to the Internal Spherical Surface of the sphere model according to the material effect of each umbilical point to regard
Figure.
6. according to claim 1-5 any one of them methods, which is characterized in that the method further includes:
Slice map download instruction is obtained, the slice map download instruction includes picture visual angle and view directions;
According to the slice map download instruction by visual angle with the picture visual angle corresponding and slice direction and the view directions
Corresponding panorama slice map is saved in local.
7. a kind of device generating panorama slice map, which is characterized in that including:
Acquisition module, for obtaining spherical panorama;
Creation module, for creating sphere model in the virtual three-dimensional world according to the spherical panorama;
Textures module, the Internal Spherical Surface for the spherical panorama to be affixed on to the sphere model obtain sphere displaying view;
Slice map determining module, for obtaining using the center of the sphere model as viewpoint on target slice direction and default
The view image of the sphere displaying view in visual angle, as panorama of the spherical panorama on the target slice direction
Slice map.
8. device according to claim 7, which is characterized in that the slice map determining module includes:
For creating virtual camera at the center of the sphere model, and the virtual camera shooting is arranged in video camera creating unit
The shooting direction of machine is the target slice direction, and, the visual angle that the virtual camera is arranged is the default visual angle;
Shooting unit shows that view obtains the view image for shooting the sphere by the virtual camera.
9. device according to claim 7, which is characterized in that the creation module includes:
The image of picture traverse determination unit, the picture traverse for determining the spherical panorama, the spherical panorama is long
Wide ratio is more than one;
Creating unit, for creating sphere model in the virtual three-dimensional world according to the picture traverse of the spherical panorama, institute
The half for stating the great circle perimeter of sphere model is equal to the picture traverse of the spherical panorama.
10. device according to claim 9, which is characterized in that the textures module is specifically used for:
By determining the picture point in the spherical panorama and the sphere model based on the inverse operation of cylindrical equidistant projection
The correspondence of umbilical point in Internal Spherical Surface, the Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtain sphere exhibition
Show view.
11. device according to claim 10, which is characterized in that the textures module includes:
Material effect determination unit, for according to the pixel characteristic of the target image point in the spherical panorama determine with it is described
The material effect of the corresponding target umbilical point of target image point;
Rendering unit obtains institute for being rendered to the Internal Spherical Surface of the sphere model according to the material effect of each umbilical point
State sphere displaying view.
12. device according to claim 7, which is characterized in that described device further includes:
Download instruction acquisition module, for obtaining slice map download instruction, the slice map download instruction include picture visual angle and
View directions;
Slice map preserving module, for according to the slice map download instruction that visual angle is corresponding with the picture visual angle and be sliced
Direction panorama slice map corresponding with the view directions is saved in local.
13. a kind of computer storage media, which is characterized in that the computer storage media is stored with a plurality of instruction, the finger
It enables and is suitable for being loaded by processor and being executed the method and step such as claim 1-6 any one.
14. a kind of terminal, which is characterized in that including:Processor and memory;Wherein, the memory is stored with computer journey
Sequence, the computer program are suitable for being loaded by the processor and executing following steps:
Obtain spherical panorama;
According to the spherical panorama sphere model is created in the virtual three-dimensional world;
The Internal Spherical Surface that the spherical panorama is affixed on to the sphere model obtains sphere displaying view;
Obtain the sphere displaying on target slice direction and in default visual angle using the center of the sphere model as viewpoint
The view image of view, as panorama slice map of the spherical panorama on the target slice direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810454739.8A CN108681987A (en) | 2018-05-10 | 2018-05-10 | The method and apparatus for generating panorama slice map |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810454739.8A CN108681987A (en) | 2018-05-10 | 2018-05-10 | The method and apparatus for generating panorama slice map |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108681987A true CN108681987A (en) | 2018-10-19 |
Family
ID=63806349
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810454739.8A Pending CN108681987A (en) | 2018-05-10 | 2018-05-10 | The method and apparatus for generating panorama slice map |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108681987A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110853143A (en) * | 2019-10-12 | 2020-02-28 | 广州亚美信息科技有限公司 | Scene implementation method and device, computer equipment and storage medium |
CN111240625A (en) * | 2020-01-09 | 2020-06-05 | 盾钰(上海)互联网科技有限公司 | Method and system for calculating image dynamic rendering of infinite visual boundary |
CN111783014A (en) * | 2020-06-30 | 2020-10-16 | 北京百度网讯科技有限公司 | Image acquisition method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110273451A1 (en) * | 2010-05-10 | 2011-11-10 | Salemann Leo J | Computer simulation of visual images using 2d spherical images extracted from 3d data |
US20130314402A1 (en) * | 2010-10-05 | 2013-11-28 | Sony Computer Entertainment Inc. | Apparatus and method for displaying images |
CN105163158A (en) * | 2015-08-05 | 2015-12-16 | 北京奇艺世纪科技有限公司 | Image processing method and device |
CN106548446A (en) * | 2016-09-29 | 2017-03-29 | 北京奇艺世纪科技有限公司 | A kind of method and device of the pinup picture on Spherical Panorama Image |
CN106604087A (en) * | 2016-12-13 | 2017-04-26 | 杭州映墨科技有限公司 | Rendering method for panoramic live streaming |
WO2017084281A1 (en) * | 2015-11-18 | 2017-05-26 | 乐视控股(北京)有限公司 | Method and device for displaying panoramic video |
US20170186219A1 (en) * | 2015-12-28 | 2017-06-29 | Le Holdings (Beijing) Co., Ltd. | Method for 360-degree panoramic display, display module and mobile terminal |
CN107248193A (en) * | 2017-05-22 | 2017-10-13 | 北京红马传媒文化发展有限公司 | The method, system and device that two dimensional surface is switched over virtual reality scenario |
-
2018
- 2018-05-10 CN CN201810454739.8A patent/CN108681987A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110273451A1 (en) * | 2010-05-10 | 2011-11-10 | Salemann Leo J | Computer simulation of visual images using 2d spherical images extracted from 3d data |
US20130314402A1 (en) * | 2010-10-05 | 2013-11-28 | Sony Computer Entertainment Inc. | Apparatus and method for displaying images |
CN105163158A (en) * | 2015-08-05 | 2015-12-16 | 北京奇艺世纪科技有限公司 | Image processing method and device |
WO2017084281A1 (en) * | 2015-11-18 | 2017-05-26 | 乐视控股(北京)有限公司 | Method and device for displaying panoramic video |
US20170186219A1 (en) * | 2015-12-28 | 2017-06-29 | Le Holdings (Beijing) Co., Ltd. | Method for 360-degree panoramic display, display module and mobile terminal |
CN106548446A (en) * | 2016-09-29 | 2017-03-29 | 北京奇艺世纪科技有限公司 | A kind of method and device of the pinup picture on Spherical Panorama Image |
CN106604087A (en) * | 2016-12-13 | 2017-04-26 | 杭州映墨科技有限公司 | Rendering method for panoramic live streaming |
CN107248193A (en) * | 2017-05-22 | 2017-10-13 | 北京红马传媒文化发展有限公司 | The method, system and device that two dimensional surface is switched over virtual reality scenario |
Non-Patent Citations (4)
Title |
---|
吕杰英;: "三维全景在实训基地漫游系统中的应用研究", 中国教育信息化, no. 18, pages 78 - 80 * |
崔汉国;王大宇;陈军;: "球面全景空间缝合及漫游算法研究", 海军工程大学学报, no. 01, pages 16 - 20 * |
朱明;吴博;: "天地图・广西全景地图的设计与实现", 测绘通报, no. 06, pages 46 - 49 * |
苏柳;: "全景播放技术中的帧渲染", 现代计算机(专业版), no. 23, pages 39 - 41 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110853143A (en) * | 2019-10-12 | 2020-02-28 | 广州亚美信息科技有限公司 | Scene implementation method and device, computer equipment and storage medium |
CN111240625A (en) * | 2020-01-09 | 2020-06-05 | 盾钰(上海)互联网科技有限公司 | Method and system for calculating image dynamic rendering of infinite visual boundary |
CN111783014A (en) * | 2020-06-30 | 2020-10-16 | 北京百度网讯科技有限公司 | Image acquisition method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101923562B1 (en) | Method for efficient re-rendering objects to vary viewports and under varying rendering and rasterization parameters | |
CN108257219B (en) | Method for realizing panoramic multipoint roaming | |
CN107146274B (en) | Image data processing system, texture mapping compression method and method for generating panoramic video | |
CN100458850C (en) | Method and apparatus for cost effective digital image and video editing, using general 3D graphic pipeline | |
CN107924556B (en) | Image generation device and image display control device | |
CN108681987A (en) | The method and apparatus for generating panorama slice map | |
Livny et al. | A GPU persistent grid mapping for terrain rendering | |
CN109997167A (en) | Directional images for spherical surface picture material splice | |
US20100066732A1 (en) | Image View Synthesis Using a Three-Dimensional Reference Model | |
CN112652046B (en) | Game picture generation method, device, equipment and storage medium | |
CN112370784A (en) | Virtual scene display method, device, equipment and storage medium | |
CN106780759A (en) | Method, device and the VR systems of scene stereoscopic full views figure are built based on picture | |
CN108043027A (en) | Storage medium, electronic device, the display methods of game picture and device | |
WO2024077897A1 (en) | Virtual scene display control method and apparatus, storage medium and electronic device | |
CN111710020B (en) | Animation rendering method and device and storage medium | |
CN114419226A (en) | Panorama rendering method and device, computer equipment and storage medium | |
CN114549289A (en) | Image processing method, image processing device, electronic equipment and computer storage medium | |
US10163250B2 (en) | Arbitrary view generation | |
JP6719596B2 (en) | Image generation device and image display control device | |
CN114511447A (en) | Image processing method, device, equipment and computer storage medium | |
KR102352092B1 (en) | Image processing method and apparatus, storage medium and electronic device | |
CN108230430B (en) | Cloud layer mask image processing method and device | |
CN113657074A (en) | Linear text layout method in three-dimensional space, electronic device and storage medium | |
GB2584753A (en) | All-around spherical light field rendering method | |
CN110038302A (en) | Grid generation method and device based on Unity3D |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |