WO2019157923A1 - Environment mapping method and apparatus - Google Patents

Environment mapping method and apparatus Download PDF

Info

Publication number
WO2019157923A1
WO2019157923A1 PCT/CN2019/072919 CN2019072919W WO2019157923A1 WO 2019157923 A1 WO2019157923 A1 WO 2019157923A1 CN 2019072919 W CN2019072919 W CN 2019072919W WO 2019157923 A1 WO2019157923 A1 WO 2019157923A1
Authority
WO
WIPO (PCT)
Prior art keywords
texture
coordinate system
value
mapping
sphere
Prior art date
Application number
PCT/CN2019/072919
Other languages
French (fr)
Chinese (zh)
Inventor
任麒麟
宋健
江淑红
熊春雷
张小军
Original Assignee
视辰信息科技(上海)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 视辰信息科技(上海)有限公司 filed Critical 视辰信息科技(上海)有限公司
Publication of WO2019157923A1 publication Critical patent/WO2019157923A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/521Depth or shape recovery from laser ranging, e.g. using interferometry; from the projection of structured light
    • G06T3/12
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/593Depth or shape recovery from multiple images from stereo images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images

Definitions

  • Embodiments of the present invention relate to a computer graphics method, and in particular, to an environment map mapping method. Embodiments of the present invention also relate to an apparatus that uses an environment map mapping method.
  • An environment map is an efficient way to simulate a scene around a viewpoint using pre-computed texture images in computer graphics rendering.
  • the texture is used to store an image of the environment around the viewpoint, and the two-dimensional texture is mapped to the surface of the environment sphere in some way to simulate the environment image around the viewpoint.
  • Environmental mapping has a wide range of applications: 360-degree streetscape rendering, indoor display, in-car environment display, and 360-degree VR video.
  • p sqrt(x 2 +y 2 +(z+1) 2 )
  • the texture coordinate of this point is (x/2p+0.5, y/2p+0.5).
  • the advantage is simplicity, but the disadvantages are: stretching and distortion are noticeable, especially when z is close to zero, ie around the equator of the sphere. This is a fatal flaw in the display of environments such as Street View.
  • the texture is not effectively utilized, and there is an invalid blank area.
  • Dual Paraboloid Environment Mapping The double parabolic environment mapping is actually an improvement on spherical mapping. Double paraboloids are used to improve distortion and stretch at the edges and support 360-degree environmental mapping. The disadvantage is that there are still distortions and stretches; as with spherical mapping, there is also the problem of texture waste.
  • Cylindral Map Given a sphere with a radius of 1, in the spherical coordinate system, ⁇ and any point on the surface of the sphere can be used. To represent. Where ⁇ is called a polar angle and its value ranges from [0, ⁇ ]; It is called azimuthal angle and its value ranges from [0, 2* ⁇ ]. Any point on the sphere Texture coordinates are
  • the advantage is that the cylindrical mapping is a kind of conformal mapping (so-called conformal mapping, that is, conformal mapping, which means that when one region is mapped to another region, the angle is kept constant), and it is protected within the visible range of the human eye. Highly true, suitable for showing environments such as Street View.
  • the format is simple, the popularity is high, and many environment maps are provided in a cylindrical map.
  • the disadvantage is that there are pixel aggregations at the north and south poles, and the storage space is more expensive.
  • Cube Map Given a sphere with a radius of 1, first find the largest component according to any point ⁇ x, y, z> on the surface of the sphere, used to locate the external cube surface of the sphere, and then calculate on the plane. Out texture coordinates.
  • the standard cube map is divided into six planes, the order of which is: X-axis positive direction, X-axis negative direction, Y-axis positive direction, Y-axis negative direction, Z-axis positive direction, Z-axis negative direction.
  • the advantage is: relatively simple, the corresponding hardware implementation has been accelerated.
  • the disadvantage is that the north and south poles, which are usually not of concern to the human eye, still use the same sampling rate as the side of the sphere.
  • the IsoCube mapping is actually a variant of the cube mapping. Unlike cube mapping, this technique attempts to map the sphere more evenly onto the cube. The advantage is that it is more uniform with respect to the cube mapping. The disadvantage is that there is a non-conformal mapping and there is a pixel distortion problem. The north and south poles, which are usually not of concern to the human eye, still use the same sampling rate as the side of the sphere. In addition, due to its low penetration rate, re-sampling of existing environmental maps is required, which will result in a decrease in texture accuracy.
  • HEALPix mapping is called Hierarchical Equal Area isoLatitudePixelization.
  • the method first divides the sphere into 12 quadrilateral blocks of the same area, and then recursively subdivides the block into smaller quadrilateral blocks.
  • anti-aliasing for the HEALPix mapping method requires a special algorithm, which makes the mapping operation more complicated.
  • the advantage is that the entire sphere achieves uniform mapping, uniform area, and small distortion.
  • the disadvantage is that the operation is more complicated. For the 360-degree street view, the use of the North and South poles is not high, and the North and South poles are not optimized.
  • Spherical Map and its improved method Dual Paraboloid Environment Mapping has the problem of texture waste and pixel distortion and aggregation at the mapping boundary; Cylindrical Map based on latitude and longitude can be seen in the human eye. The effect is better in the range, but there is a problem of pixel aggregation and a large amount of storage space being wasted at the north and south poles; Cube Map, IsoCube, and HEALPix map waste more storage space for Store non-interest areas, that is, pixels of the north and south poles of the environment ball.
  • the present invention provides a partially conformal environment map mapping method, which can use less data amount to achieve an approximately equal effect in the visible range of the human eye, and simultaneously solve the cylindrical mapping in the north and south.
  • the first step is to divide the environmental sphere into three parts:
  • takes a spherical portion of [ ⁇ /2-A 1 , ⁇ /2+A 2 ];
  • Top surface the spherical top dome portion of ⁇ ranging from [0, ⁇ /2–A 1 );
  • Bottom surface the spherical bottom portion of the sphere with a range of ⁇ ( ⁇ /2+A 2 , ⁇ );
  • is the angle between the direction vector of any point on the surface of the sphere in the spherical coordinate system and the Z axis;
  • the spherical coordinate system refers to a sphere with a radius of 1, in the spherical coordinate system, any point on the surface of the sphere
  • Angle ⁇ and azimuth To show that ⁇ has a value range of [0, ⁇ ], The value range is [0, 2 ⁇ ];
  • the angle A 1 has a value range of 0 ⁇ A 1 ⁇ /2;
  • the angle A 2 has a value range of 0 ⁇ A 2 ⁇ /2;
  • the values of A 1 and A 2 are ⁇ /6 ⁇ A 1 ⁇ ⁇ / 3, and the test results show that the best values of A 1 and A 2 in the first step are ⁇ /4.
  • the texture width corresponding to the side part be N, and the value of N be a power of 2; then the texture size corresponding to each part is:
  • S 1 is a scaling factor
  • Top/bottom part the width of the texture is S 2 ⁇ N/4, and the height is S 3 ⁇ N/4;
  • S 2 and S 3 are both scaling factors.
  • the values of S 1 , S 2 , and S 3 are 1, and the width and height of the top cover and the bottom cover portion are N/4, and the width of the side portion map is N.
  • the side portion and the top surface/bottom surface are mapped to the texture coordinate system by using different texture coordinate mappings, wherein the texture coordinate system refers to the horizontal direction of the texture as the u-axis and the vertical direction as the v-axis.
  • the coordinates of the four corners are respectively (0, 0), (1, 0), (0, 1), (1, 1) coordinate system, and the side portion and the top/bottom dome are mapped.
  • the shape matches the size of the texture.
  • texture coordinates of the side portion in the third step are:
  • u is the coordinate value of the horizontal direction in the texture coordinate system
  • v is the coordinate value of the vertical direction in the texture coordinate system.
  • the texture coordinate mapping method of the top/bottom portion in the third step is:
  • the top/bottom dome is evenly divided, and each block is mapped to a part of the rectangle.
  • top/bottom dome is evenly divided into 4 parts, each of which is mapped to a corresponding position of the rectangle;
  • the texture coordinates of the top/bottom dome are divided into the following four cases, corresponding to four areas:
  • u is the coordinate value of the horizontal direction in the texture coordinate system
  • v is the coordinate value of the vertical direction in the texture coordinate system.
  • the invention also provides an apparatus using an environment map mapping method, and the technical solution thereof is:
  • a processor is included for performing the method steps described above.
  • the vertical viewing range of the human eye is about 100 degrees.
  • the present invention adopts a cylindrical projection with high fidelity and simple operation in the vertical visible range close to the human eye. Due to the characteristics of the conformal mapping, the street view is observed. Get better results when you wait for the scene.
  • the present invention can ensure that there is no need to perform texture resampling within the visible range of the human eye for these existing textures, so that precision loss does not occur.
  • the present invention maps the round cover as evenly as possible onto the rectangular map, and by adjusting the size of the north-south round-shaped rectangular map, the joint between the north-south round cover and the area near the equator can be eliminated. And reduce the storage consumption of the north and south poles.
  • the pixel aggregation problem of the two poles in the traditional cylindrical mapping is eliminated.
  • the above parameters A 1 and A 2 take a value of ⁇ /4 and S 1
  • S 2 and S 3 both take 1, the texture of the entire sphere just surrounds the seamless connection, and only the cylindrical mapping is used 75%. The amount of data.
  • Figure 1 is a schematic illustration of a spherical coordinate system used in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a texture coordinate system used in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a method for mapping texture coordinates according to an embodiment of the present invention.
  • Figure 4 is a schematic view of a texture used in the prior art
  • Figure 5 is a schematic view of a texture used in an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an image processing apparatus using an environment map mapping method according to an embodiment of the present invention.
  • Spherical coordinate system Given a sphere with a radius of 1, in the spherical coordinate system, ⁇ and any point on the surface of the sphere can be used. To indicate; where ⁇ is called the polar angle, and its value ranges from [0, ⁇ ]; It is called azimuthal angle and its value ranges from [0, 2 ⁇ ].
  • Texture coordinate system The horizontal direction of the image is the u-axis, and the vertical direction is the v-axis.
  • the coordinates corresponding to the four corners of the image are shown in Figure 2.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • An embodiment of the present invention provides an environment map mapping method, including the following steps:
  • the environmental sphere sphere is divided into three parts:
  • takes a spherical portion of [ ⁇ /2-A 1 , ⁇ /2+A 2 ];
  • Top surface the spherical top dome portion of ⁇ ranging from [0, ⁇ /2–A 1 );
  • takes the range of ( ⁇ / 2 + A 2 , ⁇ ) spherical bottom cover portion
  • the angle A 1 has a value range of 0 ⁇ A 1 ⁇ /2;
  • the angle A 2 has a value range of 0 ⁇ A 2 ⁇ /2;
  • the values of A 1 and A 2 may be ⁇ /6 ⁇ A 1 ⁇ ⁇ / 3, and the test results show that the optimal values of A 1 and A 2 are ⁇ /4.
  • the size of the map is set and the side portion and the top surface/bottom surface are respectively mapped to the texture coordinate system by using different texture coordinate mappings, wherein the texture coordinate system refers to the horizontal direction of the texture as the u-axis.
  • the vertical direction is the v-axis, and the coordinates of the four corners of the map are coordinate systems of (0, 0), (1, 0), (0, 1), (1, 1), respectively, the side portion and the The shape of the top/bottom dome is mapped to match the size of the texture.
  • N the texture width corresponding to the side part
  • N the value of N is generally a power of 2; then the texture size of each part and the texture coordinates on the texture are:
  • S 1 is a scaling factor, and an optimal value of S 1 is 1;
  • Top/bottom part the width of the texture is S 2 ⁇ N/4, and the height is S 3 ⁇ N/4;
  • the mapping method of the top/bottom dome is as shown in FIG. 3, and the top/bottom dome is evenly divided into 4 parts, and each part is mapped to a corresponding position of the rectangle;
  • the vertical visible range of the human eye is about 100 degrees
  • a cylindrical projection with high fidelity and simple operation is adopted in the vertical visible range close to the human eye, due to its conformal mapping.
  • the present invention can ensure that there is no need to perform texture resampling within the visible range of the human eye for these existing textures, so that precision loss does not occur.
  • the present invention maps the round cover as evenly as possible onto the rectangular map, and by adjusting the size of the north-south round-shaped rectangular map, the joint between the north-south round cover and the area near the equator can be eliminated. And reduce the storage consumption of the north and south poles.
  • the pixel aggregation problem of the two poles in the traditional cylindrical mapping is eliminated.
  • the above parameters A 1 and A 2 take a value of ⁇ /4 and S 1
  • S 2 and S 3 both take 1, the texture of the entire sphere just surrounds the seamless connection, and only the cylindrical mapping is used 75%. The amount of data.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • An embodiment of the present invention further provides a preferred environment map mapping method, including the following steps:
  • the sphere is divided into three parts, of which:
  • Top surface the southern dome that remains after cutting the sphere
  • the size of the texture may be 1024 pixels ⁇ 512 pixels
  • the upper part displays the mapping result of the top surface of the sphere
  • the middle part displays the mapping result of the side of the sphere
  • the lower part shows the mapping result of the bottom surface of the sphere.
  • Half part: middle part: lower part 1: 2:1;
  • the horizontal direction of the texture is the u axis
  • the vertical direction is the v axis
  • the coordinates of the four corners of the texture are defined as (0, 0), (1, 0), (0, 1), (1, 1), respectively.
  • the side portion and the top surface/bottom surface are mapped to the texture coordinate system by different texture coordinate mapping manners, the side portions of the sphere are cylindrically mapped, and the mapping result is displayed in the middle portion of the texture; the top surface and the bottom surface are performed.
  • the texture coordinate map displays the mapping results in the upper and lower parts of the remaining textures.
  • the three parts can be completely spliced together, which enhances the visual experience.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the environment map mapping method provided by the embodiment of the present invention can be applied to the scene of the AR/VR car.
  • the following describes the technical solution of the present invention by using an AR/VR car display as an embodiment:
  • the spherical mapping map shown in FIG. 4 is divided into three parts.
  • the area of 512 ⁇ 64 pixels from the top of the texture is the part showing the sunroof in the car, and the area of 512 ⁇ 128 pixels in the middle is the part showing the head-view range.
  • the method of the invention can be employed:
  • the side part adopts a cylindrical map and maps to the map area showing the head-view range.
  • the size of the side part is 512 ⁇ 128; the side part is a map showing the head-view range, which is the same as the map size and content of the spherical map;
  • the top surface adopts texture mapping, and each point of the top surface is mapped to texture coordinates, and the size of the top surface portion after mapping is 128 ⁇ 128; the top surface portion is used as a map for displaying the sunroof inside the vehicle;
  • the bottom surface also adopts texture mapping, and each point of the bottom surface is mapped to texture coordinates, and the size of the bottom portion is mapped to 128 ⁇ 128; the bottom portion is used as a map showing the bottom of the vehicle;
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the apparatus for using the environment map mapping method provided by the embodiment of the present invention further includes a memory 41 and a processor 42, wherein the memory 41 is configured to store code and related data, and the processor 42 is configured to call the memory 41.
  • the data in the memory 41 is executed, and the code in the memory 41 is executed to implement the environment map mapping method provided in the first embodiment and the second embodiment.
  • the specific method steps refer to the description of the foregoing embodiment, and details are not described herein again. .
  • the memory 41 may include a volatile memory, such as a random access memory (RAM), and the RAM may include a static RAM or a dynamic RAM.
  • the memory 41 may also include a non-volatile memory such as a read-only memory (PROM), a programmable read-only memory (PROM), and a rewritable memory.
  • PROM read-only memory
  • PROM programmable read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • the memory 41 may also be an external flash memory, at least one disk storage or a buffer.
  • the processor 42 may be a central processing unit (CPU), and the processor 42 may also be other general-purpose control processors, digital signal processing (DSP), and application specific integrated circuits. (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc.
  • the general purpose control processor may be a micro control processor or any conventional control processor such as a microcontroller or the like.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the processor executes, and the aforementioned program, when executed, can execute all or part of the steps including the above method embodiments.
  • the processor may be implemented as one or more processor chips, or may be part of one or more application specific integrated circuits (ASICs); and the foregoing storage medium may include but not be limited to the following types. Storage medium: flash memory, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk, etc. .
  • the invention adopts a cylindrical mapping of the vicinity of the equator of the sphere, and maps the north and south poles of the sphere to the rectangle, which has high fidelity in the visible range of the human eye, and solves the problem of pixel aggregation of the cylindrical mapping at the north and south poles. It also reduces storage consumption.

Abstract

Disclosed is an environment mapping method, comprising the following steps: step one, dividing a sphere into three parts; step two, setting the size of a map; and step three, respectively mapping a lateral face part and a top face/a bottom face to a texture coordinate system by different texture coordinate mapping methods. According to the present invention, cylindrical projection which has higher fidelity and is simple in operation is used within an approximate vertical visual scope of human eyes, and due to the feature of conformal mapping of the cylindrical projection, better effects are obtained when scenes, such as a street scene, are observed. Regarding the treatment of southern and northern domes, in the present invention, the domes are uniformly mapped to rectangular maps as far as possible, and by adjusting the sizes of the rectangular maps of the southern and northern domes, joints between the southern and northern domes and an area near the equator can be removed, and the storage consumption of north and south poles can be reduced. By ensuring the continuity of mapping, the problem of pixel aggregation of the north and south poles in traditional cylindrical mapping is solved.

Description

一种环境贴图映射方法及装置Environment map mapping method and device 技术领域Technical field
本发明实施例涉及一种计算机图形学方法,具体涉及一种环境贴图映射方法。本发明实施例还涉及一种采用环境贴图映射方法的装置。Embodiments of the present invention relate to a computer graphics method, and in particular, to an environment map mapping method. Embodiments of the present invention also relate to an apparatus that uses an environment map mapping method.
背景技术Background technique
环境映射是在计算机图形渲染中使用预先计算的纹理图像模拟视点周围环境画面的一种高效方法。纹理用于存储视点周围环境的图像,将二维的纹理以某种方式映射到环境球表面,从而模拟视点周围的环境画面。环境映射有着广泛的应用:比如360度街景渲染、室内展示、车内环境展示、以及360度VR视频等。An environment map is an efficient way to simulate a scene around a viewpoint using pre-computed texture images in computer graphics rendering. The texture is used to store an image of the environment around the viewpoint, and the two-dimensional texture is mapped to the surface of the environment sphere in some way to simulate the environment image around the viewpoint. Environmental mapping has a wide range of applications: 360-degree streetscape rendering, indoor display, in-car environment display, and 360-degree VR video.
现有的环境映射(Environment Mapping)方法有以下几种:The existing environment mapping (Environment Mapping) methods are as follows:
球形映射(Spherical Map):是一种最为简单的环境映射方法;给定一个半径为1的球体,球体表面上任意一点<x,y,z>满足:x 2+y 2+z 2=1,令p=sqrt(x 2+y 2+(z+1) 2),则该点的纹理坐标为(x/2p+0.5,y/2p+0.5)。其优点是简单,而缺点在于:拉伸和扭曲明显,特别是在z接近于0时,即球体的赤道周围。这在展示街景等环境时是一个致命缺陷。另外贴图并未得到有效利用,存在无效空白区域。 Spherical Map: It is the simplest environment mapping method; given a sphere with a radius of 1, any point <x, y, z> on the surface of the sphere satisfies: x 2 + y 2 + z 2 =1 Let p=sqrt(x 2 +y 2 +(z+1) 2 ), then the texture coordinate of this point is (x/2p+0.5, y/2p+0.5). The advantage is simplicity, but the disadvantages are: stretching and distortion are noticeable, especially when z is close to zero, ie around the equator of the sphere. This is a fatal flaw in the display of environments such as Street View. In addition, the texture is not effectively utilized, and there is an invalid blank area.
双抛物面环境映射(Dual Paraboloid Environment Mapping):双抛物面环境映射实际上是对球形映射的改进。采用了双抛物面,改进了边缘处的扭曲和拉伸,并支持了360度的环境映射。其缺点是:依然存在扭曲和拉伸;同球形映射一样,也存在着贴图浪费的问题。Dual Paraboloid Environment Mapping: The double parabolic environment mapping is actually an improvement on spherical mapping. Double paraboloids are used to improve distortion and stretch at the edges and support 360-degree environmental mapping. The disadvantage is that there are still distortions and stretches; as with spherical mapping, there is also the problem of texture waste.
圆柱映射(Cylindrical Map):给定一个半径为1的球体,在球面坐标系下,球体表面上任意一点可以用θ和
Figure PCTCN2019072919-appb-000001
来表示。其中,θ被称为极角(polar angle),其取值范围为[0,π];而
Figure PCTCN2019072919-appb-000002
被称为方位角(azimuthal angle),其取值范围为[0,2*π]。则球面上任意一点
Figure PCTCN2019072919-appb-000003
的纹理坐标为
Figure PCTCN2019072919-appb-000004
其优点是:圆柱映射是一种共形映射(所谓共形映射,即保角映射,是指当一个区域被映射到另一个区域时,保持角度不变),在人眼可视范围内保真度较高,适合用于展示街景 等环境。格式简单,普及率较高,许多环境贴图以圆柱映射的方式进行提供。缺点在于:南北两极存在像素聚集情况,且存储空间耗费较多。
Cylindral Map: Given a sphere with a radius of 1, in the spherical coordinate system, θ and any point on the surface of the sphere can be used.
Figure PCTCN2019072919-appb-000001
To represent. Where θ is called a polar angle and its value ranges from [0, π];
Figure PCTCN2019072919-appb-000002
It is called azimuthal angle and its value ranges from [0, 2*π]. Any point on the sphere
Figure PCTCN2019072919-appb-000003
Texture coordinates are
Figure PCTCN2019072919-appb-000004
The advantage is that the cylindrical mapping is a kind of conformal mapping (so-called conformal mapping, that is, conformal mapping, which means that when one region is mapped to another region, the angle is kept constant), and it is protected within the visible range of the human eye. Highly true, suitable for showing environments such as Street View. The format is simple, the popularity is high, and many environment maps are provided in a cylindrical map. The disadvantage is that there are pixel aggregations at the north and south poles, and the storage space is more expensive.
立方体映射(Cube Map):给定一个半径为1的球体,根据球体表面上任意一点<x,y,z>首先找到最大的分量,用于定位球体的外接立方体面,然后在该平面上计算出纹理坐标。标准的立方体映射分为6个面,其顺序是:X轴正方向、X轴负方向、Y轴正方向、Y轴负方向、Z轴正方向、Z轴负方向。其优点是:相对简单,已有相应的硬件实现加速。缺点在于:对于人眼通常不关心的南北两极依然使用了和球体侧面相同的采样率。Cube Map: Given a sphere with a radius of 1, first find the largest component according to any point <x, y, z> on the surface of the sphere, used to locate the external cube surface of the sphere, and then calculate on the plane. Out texture coordinates. The standard cube map is divided into six planes, the order of which is: X-axis positive direction, X-axis negative direction, Y-axis positive direction, Y-axis negative direction, Z-axis positive direction, Z-axis negative direction. The advantage is: relatively simple, the corresponding hardware implementation has been accelerated. The disadvantage is that the north and south poles, which are usually not of concern to the human eye, still use the same sampling rate as the side of the sphere.
等方立方体映射(IsoCube):IsoCube映射实际上是立方体映射的一个变种。不同于立方体映射,该技术尝试将球面更加均匀地映射到立方体上。其优点是:相对于立方体映射更加均匀。缺点在于:非共形映射,存在像素扭曲问题。对于人眼通常不关心的南北两极依然使用了和球体侧面相同的采样率。另外由于其普及率不高,要求对已经存在的环境贴图进行重新采样,这将导致贴图精度下降。IsoCube: The IsoCube mapping is actually a variant of the cube mapping. Unlike cube mapping, this technique attempts to map the sphere more evenly onto the cube. The advantage is that it is more uniform with respect to the cube mapping. The disadvantage is that there is a non-conformal mapping and there is a pixel distortion problem. The north and south poles, which are usually not of concern to the human eye, still use the same sampling rate as the side of the sphere. In addition, due to its low penetration rate, re-sampling of existing environmental maps is required, which will result in a decrease in texture accuracy.
HEALPix映射,HEALPix映射全称为Hierarchical Equal Area isoLatitudePixelization。该方法首先将球体分割为12个面积相同的四边形区块,然后递归地将区块细分为更小的四边形区块。不过,要针对HEALPix映射方式进行反走样采样需要特制的算法,使得其映射运算较为复杂。其优点是:整个球体实现了均匀映射、面积一致、扭曲小。缺点在于:运算较为复杂。对于360度街景这样对南北两极关注不高的使用情景,并未对南北两极进行优化。HEALPix mapping, HEALPix mapping is called Hierarchical Equal Area isoLatitudePixelization. The method first divides the sphere into 12 quadrilateral blocks of the same area, and then recursively subdivides the block into smaller quadrilateral blocks. However, anti-aliasing for the HEALPix mapping method requires a special algorithm, which makes the mapping operation more complicated. The advantage is that the entire sphere achieves uniform mapping, uniform area, and small distortion. The disadvantage is that the operation is more complicated. For the 360-degree street view, the use of the North and South poles is not high, and the North and South poles are not optimized.
综上,在使用360度环境球展示静态场景时,上述环境映射方法不能很好地同时满足低存储空间消耗、高图像质量的需求。球形映射(Spherical Map)及其改进方法双抛物面映射(Dual Paraboloid Environment Mapping)存在着贴图浪费问题,以及在映射边界处像素扭曲和聚集的问题;基于经纬度的圆柱映射(Cylindrical Map)在人眼可视范围内效果较好,但在南北两极存在像素聚集以及大量存储空间被浪费的问题;立方体映射(Cube Map)、等方立方体映射(IsoCube)、HEALPix映射则浪费了较多存储空间,用于存储非兴趣区域,即环境球南北两极的像素。In summary, when a static scene is displayed using a 360-degree environmental ball, the above-described environment mapping method cannot satisfactorily meet the requirements of low storage space consumption and high image quality. Spherical Map and its improved method Dual Paraboloid Environment Mapping has the problem of texture waste and pixel distortion and aggregation at the mapping boundary; Cylindrical Map based on latitude and longitude can be seen in the human eye. The effect is better in the range, but there is a problem of pixel aggregation and a large amount of storage space being wasted at the north and south poles; Cube Map, IsoCube, and HEALPix map waste more storage space for Store non-interest areas, that is, pixels of the north and south poles of the environment ball.
发明内容Summary of the invention
为了解决上述技术问题,本发明提供了一种部分共形的环境贴图映射方法,它可以使用更少的数据量,达到在人眼可视范围内近似同等的效果,并同时解决圆柱映射在南北两极的像素聚集的问题。In order to solve the above technical problem, the present invention provides a partially conformal environment map mapping method, which can use less data amount to achieve an approximately equal effect in the visible range of the human eye, and simultaneously solve the cylindrical mapping in the north and south. The problem of pixel aggregation of the two poles.
本发明提出的部分共形的环境贴图映射方法的技术解决方案包括以下步骤:The technical solution of the partially conformal environment map mapping method proposed by the present invention comprises the following steps:
第一步,将环境球球体分为三部分:The first step is to divide the environmental sphere into three parts:
侧面部分:θ取值范围为[π/2-A 1,π/2+A 2]的球面部分; Side portion: θ takes a spherical portion of [π/2-A 1 , π/2+A 2 ];
顶面:θ取值范围为[0,π/2–A 1)的球面顶部圆盖部分; Top surface: the spherical top dome portion of θ ranging from [0, π/2–A 1 );
底面:θ取值范围为(π/2+A 2,π)的球面底部圆盖部分; Bottom surface: the spherical bottom portion of the sphere with a range of θ (π/2+A 2 , π);
其中,θ为球面坐标系中球体表面上任意一点的方向向量与Z轴的夹角;球面坐标系是指给定一个半径为1的球体,在球面坐标系下,球体表面上任意一点用极角θ和方位角
Figure PCTCN2019072919-appb-000005
来表示,θ的取值范围为[0,π],
Figure PCTCN2019072919-appb-000006
的取值范围为[0,2π];
Where θ is the angle between the direction vector of any point on the surface of the sphere in the spherical coordinate system and the Z axis; the spherical coordinate system refers to a sphere with a radius of 1, in the spherical coordinate system, any point on the surface of the sphere Angle θ and azimuth
Figure PCTCN2019072919-appb-000005
To show that θ has a value range of [0, π],
Figure PCTCN2019072919-appb-000006
The value range is [0, 2π];
角度A 1的取值范围为0<A 1<π/2; The angle A 1 has a value range of 0 < A 1 <π/2;
角度A 2的取值范围为0<A 2<π/2; The angle A 2 has a value range of 0 < A 2 <π/2;
优选地,所述第一步中A 1和A 2的取值为π/6≤A 1≤π/3,测试结果表明,所述第一步中A 1和A 2的最佳取值为π/4。 Preferably, in the first step, the values of A 1 and A 2 are π/6 ≤ A 1 ≤ π / 3, and the test results show that the best values of A 1 and A 2 in the first step are π/4.
第二步,设置贴图的尺寸为:In the second step, set the size of the texture to:
令侧面部分对应的贴图宽度为N,N的取值为2的幂;则每部分对应的贴图大小分别为:Let the texture width corresponding to the side part be N, and the value of N be a power of 2; then the texture size corresponding to each part is:
侧面部分:贴图宽度为N,高为S 1×N×((A 1+A 2)/(2π)); Side portion: the texture width is N, and the height is S 1 × N × ((A 1 + A 2 ) / (2π));
其中,S 1为缩放系数; Wherein S 1 is a scaling factor;
顶面/底面部分:贴图宽度为S 2×N/4,高为S 3×N/4; Top/bottom part: the width of the texture is S 2 ×N/4, and the height is S 3 ×N/4;
其中,S 2和S 3均为缩放系数。 Among them, S 2 and S 3 are both scaling factors.
优选地,所述S 1、S 2、S 3的取值为1,则顶面和底面的圆盖部分贴图的宽和高为N/4,侧面部分贴图的宽为N。 Preferably, the values of S 1 , S 2 , and S 3 are 1, and the width and height of the top cover and the bottom cover portion are N/4, and the width of the side portion map is N.
第三步,将侧面部分和顶面/底面分别采用不同的纹理坐标映射的方式映射到纹理坐标系,所述纹理坐标系是指以贴图的水平方向为u轴,垂直方向为v 轴,贴图的四个角的坐标分别为(0,0)、(1,0)、(0,1)、(1,1)的坐标系,所述侧面部分和所述顶面/底面圆盖映射后的形状与所述贴图的尺寸相匹配。In the third step, the side portion and the top surface/bottom surface are mapped to the texture coordinate system by using different texture coordinate mappings, wherein the texture coordinate system refers to the horizontal direction of the texture as the u-axis and the vertical direction as the v-axis. The coordinates of the four corners are respectively (0, 0), (1, 0), (0, 1), (1, 1) coordinate system, and the side portion and the top/bottom dome are mapped. The shape matches the size of the texture.
进一步地,所述第三步中侧面部分的纹理坐标为:Further, the texture coordinates of the side portion in the third step are:
Figure PCTCN2019072919-appb-000007
Figure PCTCN2019072919-appb-000007
v=(θ-A 1)/(A 1+A 2); v=(θ-A 1 )/(A 1 +A 2 );
其中,
Figure PCTCN2019072919-appb-000008
为球面坐标系中球体表面上任意一点的方向向量投影到XY平面与X轴的夹角;
among them,
Figure PCTCN2019072919-appb-000008
Projecting a direction vector of any point on the surface of the sphere in the spherical coordinate system to the angle between the XY plane and the X axis;
u为纹理坐标系中水平方向的坐标值;u is the coordinate value of the horizontal direction in the texture coordinate system;
v为纹理坐标系中垂直方向的坐标值。v is the coordinate value of the vertical direction in the texture coordinate system.
进一步地,所述第三步中顶面/底面部分的纹理坐标映射方法为:Further, the texture coordinate mapping method of the top/bottom portion in the third step is:
将顶面/底面圆盖进行均匀切分,每块分别映射到矩形的一部分位置上。The top/bottom dome is evenly divided, and each block is mapped to a part of the rectangle.
更进一步地,将顶面/底面圆盖均匀切分为4份,每份分别映射到矩形的对应位置;Further, the top/bottom dome is evenly divided into 4 parts, each of which is mapped to a corresponding position of the rectangle;
将圆盖上任意一点到圆盖中心点的最短球面弧度距离定义为D,令L为将D归一化到[0,0.5]范围内的数值,则顶面圆盖上任意一点的L值为:0.5×θ/(π/2-A 1),而底面圆盖上任意一点的L值为:0.5×(π-θ)/(π/2-A 2); Define the shortest spherical arc distance from any point on the dome to the center of the dome as D, and let L be the value that normalizes D to [0,0.5], then the L value at any point on the top cover Is: 0.5 × θ / (π / 2 - A 1 ), and the L value of any point on the bottom dome is: 0.5 × (π - θ) / (π / 2 - A 2 );
定义
Figure PCTCN2019072919-appb-000009
为将
Figure PCTCN2019072919-appb-000010
的取值范围映射到[-π/4,7×π/4)的数值,也就是:
definition
Figure PCTCN2019072919-appb-000009
For the
Figure PCTCN2019072919-appb-000010
The range of values is mapped to the value of [-π/4,7×π/4), which is:
Figure PCTCN2019072919-appb-000011
(当
Figure PCTCN2019072919-appb-000012
时)
Figure PCTCN2019072919-appb-000011
(when
Figure PCTCN2019072919-appb-000012
Time)
Figure PCTCN2019072919-appb-000013
(当
Figure PCTCN2019072919-appb-000014
时)
Figure PCTCN2019072919-appb-000013
(when
Figure PCTCN2019072919-appb-000014
Time)
则顶面/底面圆盖的纹理坐标分为以下4种情况,分别对应于4个区域:The texture coordinates of the top/bottom dome are divided into the following four cases, corresponding to four areas:
第一种,
Figure PCTCN2019072919-appb-000015
The first,
Figure PCTCN2019072919-appb-000015
Figure PCTCN2019072919-appb-000016
Figure PCTCN2019072919-appb-000016
v=0.5+Lv=0.5+L
第二种,
Figure PCTCN2019072919-appb-000017
Second,
Figure PCTCN2019072919-appb-000017
u=0.5+Lu=0.5+L
Figure PCTCN2019072919-appb-000018
Figure PCTCN2019072919-appb-000018
第三种,
Figure PCTCN2019072919-appb-000019
Third,
Figure PCTCN2019072919-appb-000019
Figure PCTCN2019072919-appb-000020
Figure PCTCN2019072919-appb-000020
v=0.5-Lv=0.5-L
第四种,
Figure PCTCN2019072919-appb-000021
Fourth,
Figure PCTCN2019072919-appb-000021
u=0.5–Lu=0.5–L
Figure PCTCN2019072919-appb-000022
Figure PCTCN2019072919-appb-000022
其中,
Figure PCTCN2019072919-appb-000023
为球面坐标系中球体表面上任意一点的方向向量投影到XY平面与X轴的夹角;
among them,
Figure PCTCN2019072919-appb-000023
Projecting a direction vector of any point on the surface of the sphere in the spherical coordinate system to the angle between the XY plane and the X axis;
u为纹理坐标系中水平方向的坐标值;u is the coordinate value of the horizontal direction in the texture coordinate system;
v为纹理坐标系中垂直方向的坐标值。v is the coordinate value of the vertical direction in the texture coordinate system.
本发明还提供了一种采用环境贴图映射方法的装置,其技术解决方案为:The invention also provides an apparatus using an environment map mapping method, and the technical solution thereof is:
包括处理器,所述处理器用于执行前述的方法步骤。A processor is included for performing the method steps described above.
本发明可以达到的技术效果是:The technical effects that can be achieved by the present invention are:
人眼的垂直可视范围约为100度,本发明在接近人眼垂直可视范围内采用了保真度较高、运算简单的圆柱投影,由于其共形映射的特点,从而使得在观察街景等场景时获得较好的效果。另外,由于大量已经存在的环境映射贴图是以圆柱投影的形式存在的,针对这些已经存在的贴图,本发明可以保证在人眼可视范围内无需进行贴图重采样,从而不会出现精度损失。The vertical viewing range of the human eye is about 100 degrees. The present invention adopts a cylindrical projection with high fidelity and simple operation in the vertical visible range close to the human eye. Due to the characteristics of the conformal mapping, the street view is observed. Get better results when you wait for the scene. In addition, since a large number of existing environmental mapping maps exist in the form of cylindrical projections, the present invention can ensure that there is no need to perform texture resampling within the visible range of the human eye for these existing textures, so that precision loss does not occur.
在南北两个圆盖的处理上,本发明将圆盖尽可能均匀地映射到矩形贴图上,通过调整南北圆盖矩形贴图的大小,可以消除南北圆盖和赤道附近区域之间的接缝,并减少南北两极的存储消耗。通过确保映射的连续性,消除了传统圆柱映射中南北两个极点的像素聚集问题。最优地,上述参数A 1和A 2都取值π/4且S 1、S 2和S 3都取1时,整个球体的贴图恰好可以环绕无缝连接,而且只使用了圆柱映射75%数据量。 In the treatment of the two round covers of the north and the south, the present invention maps the round cover as evenly as possible onto the rectangular map, and by adjusting the size of the north-south round-shaped rectangular map, the joint between the north-south round cover and the area near the equator can be eliminated. And reduce the storage consumption of the north and south poles. By ensuring the continuity of the mapping, the pixel aggregation problem of the two poles in the traditional cylindrical mapping is eliminated. Optimally, when the above parameters A 1 and A 2 take a value of π/4 and S 1 , S 2 and S 3 both take 1, the texture of the entire sphere just surrounds the seamless connection, and only the cylindrical mapping is used 75%. The amount of data.
附图说明DRAWINGS
本领域的技术人员应理解,以下说明仅是示意性地说明本发明的原理,所述原理可按多种方式应用,以实现许多不同的可替代实施方式。这些说明仅用于示出本发明的教导内容的一般原理,不意味着限制在此所公开的发明构思。Those skilled in the art should understand that the following description is merely illustrative of the principles of the invention, which can be applied in various ways to implement many different alternative embodiments. The illustrations are only intended to illustrate the general principles of the teachings of the present invention and are not intended to limit the inventive concepts disclosed herein.
结合在本说明书中并构成本说明书的一部分的附图示出了本发明的实施方式,并且与上文的总体说明和下列附图的详细说明一起用于解释本发明的原理。The accompanying drawings, which are incorporated in the claims
下面结合附图和具体实施方式对本发明作进一步详细的说明:The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
图1是本发明实施例所使用的球面坐标系的示意图;Figure 1 is a schematic illustration of a spherical coordinate system used in an embodiment of the present invention;
图2是本发明实施例所使用的纹理坐标系的示意图;2 is a schematic diagram of a texture coordinate system used in an embodiment of the present invention;
图3是本发明实施例纹理坐标的映射方法的示意图;3 is a schematic diagram of a method for mapping texture coordinates according to an embodiment of the present invention;
图4是现有技术所采用的贴图的示意图;Figure 4 is a schematic view of a texture used in the prior art;
图5是本发明实施例所采用的贴图的示意图;Figure 5 is a schematic view of a texture used in an embodiment of the present invention;
图6是本发明实施例采用环境贴图映射方法的图像处理装置的示意图。FIG. 6 is a schematic diagram of an image processing apparatus using an environment map mapping method according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例的附图,对本发明实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于所描述的本发明的实施例,本领域普通技术人员在无需创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。除非另外定义,此处使用的技术术语或者科学术语应当为本发明所属领域内具有一般技能的人士所理解的通常意义。本文中使用的“包括”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。The technical solutions of the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings. It is apparent that the described embodiments are part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the described embodiments of the present invention without departing from the scope of the invention are within the scope of the invention. Unless otherwise defined, technical terms or scientific terms used herein shall be taken to mean the ordinary meaning of the ordinary skill in the art to which the invention pertains. The use of the terms "comprises" or "an" or "an" or "an"
本文使用到的坐标系定义如下:The coordinate system used in this paper is defined as follows:
球面坐标系:给定一个半径为1的球体,在球面坐标系下,球体表面上任意一点可以用θ和
Figure PCTCN2019072919-appb-000024
来表示;其中,θ被称为极角(polar angle),其取值范围为[0,π];而
Figure PCTCN2019072919-appb-000025
被称为方位角(azimuthal angle),其取值范围为[0,2π]。
Spherical coordinate system: Given a sphere with a radius of 1, in the spherical coordinate system, θ and any point on the surface of the sphere can be used.
Figure PCTCN2019072919-appb-000024
To indicate; where θ is called the polar angle, and its value ranges from [0, π];
Figure PCTCN2019072919-appb-000025
It is called azimuthal angle and its value ranges from [0, 2π].
如图1所示为本发明实施例所使用的球面坐标系,其中r=1,
Figure PCTCN2019072919-appb-000026
为球面方向向量投影到XY平面与X轴的夹角,取值范围为[0,2π],θ为球面方向向量与Z轴的夹角,取值范围为[0,π]。
FIG. 1 is a spherical coordinate system used in an embodiment of the present invention, where r=1,
Figure PCTCN2019072919-appb-000026
The spherical direction vector is projected to the angle between the XY plane and the X axis, and the value ranges from [0, 2π]. θ is the angle between the spherical direction vector and the Z axis, and the value ranges from [0, π].
纹理坐标系:图像的水平方向为u轴,垂直方向为v轴,图像四个角对应的坐标如图2所示。Texture coordinate system: The horizontal direction of the image is the u-axis, and the vertical direction is the v-axis. The coordinates corresponding to the four corners of the image are shown in Figure 2.
本文中的坐标系仅为了方便表述。即使采用其他坐标系,也可以通过坐标系的转换,实现本发明实施例所达到的效果。The coordinate system in this article is for convenience only. Even if other coordinate systems are used, the effects achieved by the embodiments of the present invention can be achieved by the conversion of the coordinate system.
实施例一:Embodiment 1:
本发明实施例提供了一种环境贴图映射方法,包括以下步骤:An embodiment of the present invention provides an environment map mapping method, including the following steps:
第一步(S1),将环境球球体分为三部分:In the first step (S1), the environmental sphere sphere is divided into three parts:
侧面部分:θ取值范围为[π/2-A 1,π/2+A 2]的球面部分; Side portion: θ takes a spherical portion of [π/2-A 1 , π/2+A 2 ];
顶面:θ取值范围为[0,π/2–A 1)的球面顶部圆盖部分; Top surface: the spherical top dome portion of θ ranging from [0, π/2–A 1 );
底面:θ取值范围为(π/2+A 2,π]的球面底部圆盖部分; Bottom surface: θ takes the range of (π / 2 + A 2 , π) spherical bottom cover portion;
其中,角度A 1的取值范围为0<A 1<π/2; Wherein, the angle A 1 has a value range of 0<A 1 <π/2;
角度A 2的取值范围为0<A 2<π/2; The angle A 2 has a value range of 0 < A 2 <π/2;
优选地,A 1和A 2的取值可以为π/6≤A 1≤π/3,测试结果表明,A 1和A 2的最佳取值为π/4。 Preferably, the values of A 1 and A 2 may be π/6 ≤ A 1 ≤ π / 3, and the test results show that the optimal values of A 1 and A 2 are π/4.
第二步(S2),设置贴图的尺寸并将侧面部分和顶面/底面分别采用不同的纹理坐标映射的方式映射到纹理坐标系,所述纹理坐标系是指以贴图的水平方向为u轴,垂直方向为v轴,贴图的四个角的坐标分别为(0,0)、(1,0)、(0,1)、(1,1)的坐标系,所述侧面部分和所述顶面/底面圆盖映射后的形状与所述贴图的尺寸相匹配。In the second step (S2), the size of the map is set and the side portion and the top surface/bottom surface are respectively mapped to the texture coordinate system by using different texture coordinate mappings, wherein the texture coordinate system refers to the horizontal direction of the texture as the u-axis. The vertical direction is the v-axis, and the coordinates of the four corners of the map are coordinate systems of (0, 0), (1, 0), (0, 1), (1, 1), respectively, the side portion and the The shape of the top/bottom dome is mapped to match the size of the texture.
令侧面部分对应的贴图宽度为N,N的取值一般为2的幂;则每部分对应的贴图大小和贴图上的纹理坐标分别为:Let the texture width corresponding to the side part be N, and the value of N is generally a power of 2; then the texture size of each part and the texture coordinates on the texture are:
侧面部分:贴图宽度为N,高为S 1×N×((A 1+A 2)/(2π)); Side portion: the texture width is N, and the height is S 1 × N × ((A 1 + A 2 ) / (2π));
其中,S 1为缩放系数,S 1的最佳取值为1; Wherein, S 1 is a scaling factor, and an optimal value of S 1 is 1;
Figure PCTCN2019072919-appb-000027
Figure PCTCN2019072919-appb-000027
v=(θ-A 1)/(A 1+A 2); v=(θ-A 1 )/(A 1 +A 2 );
顶面/底面部分:贴图宽度为S 2×N/4,高为S 3×N/4; Top/bottom part: the width of the texture is S 2 ×N/4, and the height is S 3 ×N/4;
其中,S 2和S 3均为缩放系数,S 2和S 3的最佳取值为1。 Where S 2 and S 3 are both scaling factors, and the optimal values of S 2 and S 3 are 1.
当S 1、S 2和S 3都取1时,顶面和底面的圆盖部分贴图的宽和高都为N/4,侧面部分贴图的宽为N,这时整个球体分割成的三部分的贴图恰好可以环绕无缝连接。 When S 1 , S 2 and S 3 are both taken 1, the width and height of the top and bottom dome portions are N/4, and the width of the side portion map is N. At this time, the entire sphere is divided into three parts. The textures just fit seamlessly around the border.
当A 1和A 2都取值π/4且S 1、S 2和S 3都取1时,整个球体的贴图恰好可以环绕无缝连接,而且只使用了圆柱映射75%数据量。 When both A 1 and A 2 take the value π/4 and S 1 , S 2 and S 3 both take 1, the texture of the entire sphere just surrounds the seamless connection, and only the cylindrical mapping is used for 75% of the data amount.
顶面/底面圆盖的映射方法如图3所示,将顶面/底面圆盖均匀切分为4份,每份分别映射到矩形的对应位置;The mapping method of the top/bottom dome is as shown in FIG. 3, and the top/bottom dome is evenly divided into 4 parts, and each part is mapped to a corresponding position of the rectangle;
将圆盖上任意一点到圆盖中心点的最短球面弧度距离定义为D,令L为将D归一化到[0,0.5]范围内的数值,则顶面圆盖上任意一点的L值为:0.5×θ/(π/2-A 1),而底面圆盖上任意一点的L值为:0.5×(π-θ)/(π/2-A 2); Define the shortest spherical arc distance from any point on the dome to the center of the dome as D, and let L be the value that normalizes D to [0,0.5], then the L value at any point on the top cover Is: 0.5 × θ / (π / 2 - A 1 ), and the L value of any point on the bottom dome is: 0.5 × (π - θ) / (π / 2 - A 2 );
定义
Figure PCTCN2019072919-appb-000028
为将
Figure PCTCN2019072919-appb-000029
的取值范围映射到[-π/4,7×π/4)的数值,也就是:
definition
Figure PCTCN2019072919-appb-000028
For the
Figure PCTCN2019072919-appb-000029
The range of values is mapped to the value of [-π/4,7×π/4), which is:
Figure PCTCN2019072919-appb-000030
(当
Figure PCTCN2019072919-appb-000031
时)
Figure PCTCN2019072919-appb-000030
(when
Figure PCTCN2019072919-appb-000031
Time)
Figure PCTCN2019072919-appb-000032
(当
Figure PCTCN2019072919-appb-000033
时)
Figure PCTCN2019072919-appb-000032
(when
Figure PCTCN2019072919-appb-000033
Time)
则顶面/底面圆盖的纹理坐标可以分为以下4种情况,分别对应于图3中的4个区域:Then the texture coordinates of the top/bottom dome can be divided into the following four cases, corresponding to the four regions in Figure 3:
第一种,
Figure PCTCN2019072919-appb-000034
The first,
Figure PCTCN2019072919-appb-000034
Figure PCTCN2019072919-appb-000035
Figure PCTCN2019072919-appb-000035
v=0.5+Lv=0.5+L
第二种,
Figure PCTCN2019072919-appb-000036
Second,
Figure PCTCN2019072919-appb-000036
u=0.5+Lu=0.5+L
Figure PCTCN2019072919-appb-000037
Figure PCTCN2019072919-appb-000037
第三种,
Figure PCTCN2019072919-appb-000038
Third,
Figure PCTCN2019072919-appb-000038
Figure PCTCN2019072919-appb-000039
Figure PCTCN2019072919-appb-000039
v=0.5-Lv=0.5-L
第四种,
Figure PCTCN2019072919-appb-000040
Fourth,
Figure PCTCN2019072919-appb-000040
u=0.5–Lu=0.5–L
Figure PCTCN2019072919-appb-000041
Figure PCTCN2019072919-appb-000041
以上即为纹理坐标映射公式。The above is the texture coordinate mapping formula.
在本发明实施例中,由于人眼的垂直可视范围约为100度,因此在接近人眼垂直可视范围内采用了保真度较高、运算简单的圆柱投影,由于其共形映射的特点,从而使得在观察街景等场景时获得较好的效果。另外,由于大量已经 存在的环境映射贴图是以圆柱投影的形式存在的,针对这些已经存在的贴图,本发明可以保证在人眼可视范围内无需进行贴图重采样,从而不会出现精度损失。In the embodiment of the present invention, since the vertical visible range of the human eye is about 100 degrees, a cylindrical projection with high fidelity and simple operation is adopted in the vertical visible range close to the human eye, due to its conformal mapping. Features, so that you can get better results when viewing scenes such as street scenes. In addition, since a large number of existing environmental mapping maps exist in the form of cylindrical projections, the present invention can ensure that there is no need to perform texture resampling within the visible range of the human eye for these existing textures, so that precision loss does not occur.
在南北两个圆盖的处理上,本发明将圆盖尽可能均匀地映射到矩形贴图上,通过调整南北圆盖矩形贴图的大小,可以消除南北圆盖和赤道附近区域之间的接缝,并减少南北两极的存储消耗。通过确保映射的连续性,消除了传统圆柱映射中南北两个极点的像素聚集问题。最优地,上述参数A 1和A 2都取值π/4且S 1、S 2和S 3都取1时,整个球体的贴图恰好可以环绕无缝连接,而且只使用了圆柱映射75%数据量。 In the treatment of the two round covers of the north and the south, the present invention maps the round cover as evenly as possible onto the rectangular map, and by adjusting the size of the north-south round-shaped rectangular map, the joint between the north-south round cover and the area near the equator can be eliminated. And reduce the storage consumption of the north and south poles. By ensuring the continuity of the mapping, the pixel aggregation problem of the two poles in the traditional cylindrical mapping is eliminated. Optimally, when the above parameters A 1 and A 2 take a value of π/4 and S 1 , S 2 and S 3 both take 1, the texture of the entire sphere just surrounds the seamless connection, and only the cylindrical mapping is used 75%. The amount of data.
实施例二:Embodiment 2:
本发明实施例还提供了一种优选的环境贴图映射方法,包括以下步骤:An embodiment of the present invention further provides a preferred environment map mapping method, including the following steps:
S1、将球体分为三部分,其中:S1, the sphere is divided into three parts, of which:
侧面部分:在球体赤道上下各自取值0度到90度之间任意一数值(最佳取值为45度),分别进行水平方向上的切割,得到的曲面;针对曲面采用圆柱投影;Side portion: any value between 0 degrees and 90 degrees on the upper and lower sides of the equator of the sphere (the optimum value is 45 degrees), respectively, the surface is cut in the horizontal direction, and the cylindrical projection is used for the curved surface;
顶面:对球体进行切割后所剩余的南部圆盖;Top surface: the southern dome that remains after cutting the sphere;
底面:对球体进行切割后所剩余的北部圆盖;Bottom surface: the northern dome that remains after cutting the sphere;
设置贴图的尺寸和贴图在纹理坐标系中的坐标,其中:Set the dimensions of the map and the coordinates of the map in the texture coordinate system, where:
S11、在本实施例中,贴图的尺寸可以是1024像素×512像素,上半部分显示球体顶面的映射结果,中间部分显示球体侧面的映射结果,下半部分显示球体底面的映射结果,上半部分:中间部分:下半部分=1:2:1;S11. In this embodiment, the size of the texture may be 1024 pixels×512 pixels, the upper part displays the mapping result of the top surface of the sphere, the middle part displays the mapping result of the side of the sphere, and the lower part shows the mapping result of the bottom surface of the sphere. Half part: middle part: lower part = 1: 2:1;
S12、以贴图的水平方向为u轴,垂直方向为v轴,贴图的四个角的坐标分别定义为(0,0)、(1,0)、(0,1)、(1,1)来构建贴图的纹理坐标系;S12, the horizontal direction of the texture is the u axis, and the vertical direction is the v axis, and the coordinates of the four corners of the texture are defined as (0, 0), (1, 0), (0, 1), (1, 1), respectively. To construct the texture coordinate system of the texture;
S2、将侧面部分和顶面/底面分别采用不同的纹理坐标映射的方式映射到纹理坐标系,将球体的侧面部分进行圆柱映射,将映射结果显示在贴图的中间部分;将顶面和底面进行纹理坐标映射,将映射结果分别显示在剩余贴图的上半部分和下半部分。S2, the side portion and the top surface/bottom surface are mapped to the texture coordinate system by different texture coordinate mapping manners, the side portions of the sphere are cylindrically mapped, and the mapping result is displayed in the middle portion of the texture; the top surface and the bottom surface are performed. The texture coordinate map displays the mapping results in the upper and lower parts of the remaining textures.
将侧面部分、顶面和底面的影射结果全部映射在贴图后,三部分内容能够 完整地拼接在一起,提升了视觉体验效果。After mapping the mapping results of the side part, the top surface and the bottom surface to the texture map, the three parts can be completely spliced together, which enhances the visual experience.
实施例三:Embodiment 3:
本发明实施例所提供的环境贴图映射方法,可以应用在AR/VR看车的场景中,下面以AR/VR汽车展示为实施例具体说明本发明的技术方案:The environment map mapping method provided by the embodiment of the present invention can be applied to the scene of the AR/VR car. The following describes the technical solution of the present invention by using an AR/VR car display as an embodiment:
在做AR/VR汽车展示的时候,有一种场景是需要将用户的视点模拟真实的车内视点,可以环顾四周,查看车内装饰,包括座椅、仪表盘等实际坐在车里能看到的车内设备;这样的展示在3D引擎里的实现一般是使用全景图贴在一个空心球体的内壁,将摄像机的位置固定在球心,就可以看到接近真实车内的效果,在本实施例中,构建一个半径为5米的空心球体;全景图的获取可以有很多种方式,一般是通过特殊的摄像机现场拍摄的,现有技术通常采用如图4所示的原始内饰贴图,这也是球形映射可以直接使用的贴图。In the AR/VR car show, there is a scene that needs to simulate the user's point of view to simulate the real in-car viewpoint. You can look around and check the interior decoration, including the seat, the dashboard, etc. You can see it in the car. In-car equipment; such display in the 3D engine is generally achieved by using a panorama attached to the inner wall of a hollow sphere, the position of the camera is fixed to the center of the ball, you can see the effect close to the real car, in this implementation In the example, a hollow sphere with a radius of 5 meters is constructed; the panorama can be acquired in many ways, usually by a special camera. The prior art usually uses the original interior map as shown in Figure 4. It is also a map that can be used directly by a spherical map.
将如图4所示的球形映射贴图分为3个部分,从贴图顶部开始512×64像素大小的区域为展示车内天窗的部分,中间512×128像素大小的区域为展示平视范围的部分,贴图底部的512×64像素大小的区域为展示车内底部的部分;如果在本场景中的球体上通过球形映射使用这个贴图,可以发现该贴图南北两极使用了大量的像素,但是在球面贴图的时候,只会对应极少的像素,这是极大的浪费;这种方式的贴图面积总共为512×256=131072;The spherical mapping map shown in FIG. 4 is divided into three parts. The area of 512×64 pixels from the top of the texture is the part showing the sunroof in the car, and the area of 512×128 pixels in the middle is the part showing the head-view range. The 512×64 pixel area at the bottom of the texture is the part that shows the bottom of the car; if you use this texture by sphere mapping on the sphere in this scene, you can find that the north and south poles of the texture use a lot of pixels, but the spherical map At that time, it will only correspond to very few pixels, which is a great waste; the texture area of this method is 512 × 256 = 131072 in total;
用户大部分时候观察的是坐在汽车里面平视的范围,可以环视一周;对于车顶和车底的部分,观察的就少了很多。因此,可以采用本发明的方法:Most of the time the user observes is sitting in the car's flat view, and can look around for a week; for the roof and the bottom of the car, the observation is much less. Therefore, the method of the invention can be employed:
将原始的圆柱贴图分割为三部分:顶部,中间和底部,其中顶部和底部的贴图尺寸一样大;Divide the original cylindrical map into three parts: top, middle, and bottom, where the top and bottom textures are the same size;
设置贴图的尺寸为512×256,使用最优参数,即:A 1和A 2都取值π/4且S 1、S 2和S 3都取1,将空心球面的三部分分别进行映射: Set the size of the texture to 512 × 256, using the optimal parameters, that is, both A 1 and A 2 take the value π / 4 and S 1 , S 2 and S 3 take 1 to map the three parts of the hollow sphere separately:
侧面部分采用圆柱映射,映射到展示平视范围的贴图区域,侧面部分映射后的尺寸为512×128;侧面部分作为展示平视范围的贴图,与球形映射的贴图大小和内容相同;The side part adopts a cylindrical map and maps to the map area showing the head-view range. The size of the side part is 512×128; the side part is a map showing the head-view range, which is the same as the map size and content of the spherical map;
顶面采用纹理映射,将顶面的每一个点都映射为纹理坐标,顶面部分映射后的尺寸为128×128;顶面部分作为展示车内天窗的贴图;The top surface adopts texture mapping, and each point of the top surface is mapped to texture coordinates, and the size of the top surface portion after mapping is 128×128; the top surface portion is used as a map for displaying the sunroof inside the vehicle;
底面也采用纹理映射,将底面的每一个点都映射为纹理坐标,底面部分映射后的尺寸为128×128;底面部分作为展示车内底部的贴图;The bottom surface also adopts texture mapping, and each point of the bottom surface is mapped to texture coordinates, and the size of the bottom portion is mapped to 128×128; the bottom portion is used as a map showing the bottom of the vehicle;
空心球体映射到贴图区域后,完成图像的无缝连接和展示,如图5所示。After the hollow sphere is mapped to the texture area, the seamless connection and display of the image is completed, as shown in FIG. 5.
使用本发明实施例所提供的方法后,将空心球映射后的贴图面积为128×128+128×128+512×128=98304;因此相较球形贴图,采用本发明实施例所提供的方法,贴图区域的压缩比可以达到98304/131072=75%。After the method provided by the embodiment of the present invention, the mapped area of the hollow sphere is 128×128+128×128+512×128=98304; therefore, compared with the spherical map, the method provided by the embodiment of the present invention is adopted. The compression ratio of the texture area can reach 98304/131072=75%.
实施例四:Embodiment 4:
如图6所示,本发明实施例所提供的采用环境贴图映射方法的装置,还包括存储器41和处理器42,其中存储器41用于存储代码和相关数据,处理器42用于调用存储器41中的数据,执行存储器41中的代码,执行所述存储器41中的代码可以实现实施例一、实施例二所提供的环境贴图映射方法,具体方法步骤参照前述实施例的描述,在此不再赘述。As shown in FIG. 6, the apparatus for using the environment map mapping method provided by the embodiment of the present invention further includes a memory 41 and a processor 42, wherein the memory 41 is configured to store code and related data, and the processor 42 is configured to call the memory 41. The data in the memory 41 is executed, and the code in the memory 41 is executed to implement the environment map mapping method provided in the first embodiment and the second embodiment. The specific method steps refer to the description of the foregoing embodiment, and details are not described herein again. .
在本发明实施例中,存储器41可能包含易失性存储器,例如,随机存取存储器(random access memory,RAM),所述RAM可以包括静态RAM或动态RAM。所述存储器41也可能包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,PROM)、可编程只读存储器(programmable read-only memory,PROM)、可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、电可擦写可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)或闪存(flash memory)。所述存储器41还可能是外部闪存、至少一个磁盘存储器或缓存器。In the embodiment of the present invention, the memory 41 may include a volatile memory, such as a random access memory (RAM), and the RAM may include a static RAM or a dynamic RAM. The memory 41 may also include a non-volatile memory such as a read-only memory (PROM), a programmable read-only memory (PROM), and a rewritable memory. An erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The memory 41 may also be an external flash memory, at least one disk storage or a buffer.
在本发明实施例中,处理器42可以是中央处理单元(Central Processing Unit,CPU),处理器42还可以是其他通用控制处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。所述通用控制处理器可以是微控制处理器或者是任何常规的控制处理器,例如单片机等。In the embodiment of the present invention, the processor 42 may be a central processing unit (CPU), and the processor 42 may also be other general-purpose control processors, digital signal processing (DSP), and application specific integrated circuits. (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general purpose control processor may be a micro control processor or any conventional control processor such as a microcontroller or the like.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性 的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所属技术领域的技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,并被通讯设备内部的处理器执行,前述的程序在被执行时处理器可以执行包括上述方法实施例的全部或者部分步骤。其中,所述处理器可以作为一个或多个处理器芯片实施,或者可以为一个或多个专用集成电路(Application Specific Integrated Circuit,ASIC)的一部分;而前述的存储介质可以包括但不限于以下类型的存储介质:闪存(Flash Memory)、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。It can be understood by those skilled in the art that all or part of the steps of implementing the above method embodiments may be completed by hardware related to the program instructions, and the foregoing programs may be stored in a computer readable storage medium and processed by the communication device. The processor executes, and the aforementioned program, when executed, can execute all or part of the steps including the above method embodiments. The processor may be implemented as one or more processor chips, or may be part of one or more application specific integrated circuits (ASICs); and the foregoing storage medium may include but not be limited to the following types. Storage medium: flash memory, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk, etc. .
本发明将球体的赤道附近区域采用圆柱映射,将球体的南北两极各自映射到矩形上,在人眼可视范围内保真度较高,同时解决了圆柱映射在南北两极的像素聚集的问题,还减少了存储消耗。The invention adopts a cylindrical mapping of the vicinity of the equator of the sphere, and maps the north and south poles of the sphere to the rectangle, which has high fidelity in the visible range of the human eye, and solves the problem of pixel aggregation of the cylindrical mapping at the north and south poles. It also reduces storage consumption.
显然,本领域的技术人员可以对本发明进行各种改动和变形,而不脱离本发明的精神和范围。这样,倘若本发明的这些修改属于本发明权利要求及其同等技术的范围之内,则本发明也意图包含这些改动和变形在内。It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and the modifications

Claims (10)

  1. 一种环境贴图映射方法,其特征在于,包括以下步骤:An environment map mapping method, comprising the steps of:
    第一步,将环境球球体分为三部分:The first step is to divide the environmental sphere into three parts:
    侧面部分:θ取值范围为[π/2-A 1,π/2+A 2]的球面部分; Side portion: θ takes a spherical portion of [π/2-A 1 , π/2+A 2 ];
    顶面:θ取值范围为[0,π/2–A 1)的球面顶部圆盖部分; Top surface: the spherical top dome portion of θ ranging from [0, π/2–A 1 );
    底面:θ取值范围为(π/2+A 2,π]的球面底部圆盖部分; Bottom surface: θ takes the range of (π / 2 + A 2 , π) spherical bottom cover portion;
    其中,θ为球面坐标系中球体表面上任意一点的方向向量与Z轴的夹角;球面坐标系是指给定一个半径为1的球体,在球面坐标系下,球体表面上任意一点用极角θ和方位角φ来表示,θ的取值范围为[0,π],φ的取值范围为[0,2π];Where θ is the angle between the direction vector of any point on the surface of the sphere in the spherical coordinate system and the Z axis; the spherical coordinate system refers to a sphere with a radius of 1, in the spherical coordinate system, any point on the surface of the sphere The angle θ and the azimuth angle φ indicate that the value range of θ is [0, π], and the value range of φ is [0, 2π];
    角度A 1的取值范围为0<A 1<π/2; The angle A 1 has a value range of 0 < A 1 <π/2;
    角度A 2的取值范围为0<A 2<π/2; The angle A 2 has a value range of 0 < A 2 <π/2;
    第二步,设置贴图的尺寸;The second step is to set the size of the texture;
    第三步,将侧面部分和顶面/底面分别采用不同的纹理坐标映射的方式映射到纹理坐标系,所述纹理坐标系是指以贴图的水平方向为u轴,垂直方向为v轴,贴图的四个角的坐标分别为(0,0)、(1,0)、(0,1)、(1,1)的坐标系,所述侧面部分和所述顶面/底面圆盖映射后的形状与所述贴图的尺寸相匹配。In the third step, the side portion and the top surface/bottom surface are respectively mapped to the texture coordinate system by using different texture coordinate mappings, wherein the texture coordinate system refers to the horizontal direction of the texture as the u-axis and the vertical direction as the v-axis, and the texture The coordinates of the four corners are respectively (0, 0), (1, 0), (0, 1), (1, 1) coordinate system, and the side portion and the top/bottom dome are mapped. The shape matches the size of the texture.
  2. 根据权利要求1所述的环境贴图映射方法,其特征在于,所述第一步中A 1和/或A 2的取值为: The environment map mapping method according to claim 1, wherein the values of A 1 and/or A 2 in the first step are:
    角度A 1的取值范围为π/6≤A 1≤π/3; The angle A 1 has a value range of π/6 ≤ A 1 ≤ π / 3;
    角度A 2的取值范围为π/6≤A 1≤π/3。 The angle A 2 has a value range of π/6 ≤ A 1 ≤ π / 3.
  3. 根据权利要求2所述的环境贴图映射方法,其特征在于,所述第一步中A 1和/或A 2的取值为π/4。 The environment map mapping method according to claim 2, wherein A 1 and/or A 2 of the first step have a value of π/4.
  4. 根据权利要求1所述的环境贴图映射方法,其特征在于,所述第二步中设置贴图的尺寸为:The environment map mapping method according to claim 1, wherein the size of the map set in the second step is:
    令侧面部分对应的贴图宽度为N,则每部分对应的贴图大小分别为:If the texture width corresponding to the side part is N, the corresponding map size of each part is:
    侧面部分:贴图宽度为N,高为S 1×N×((A 1+A 2)/(2π)); Side portion: the texture width is N, and the height is S 1 × N × ((A 1 + A 2 ) / (2π));
    其中,S 1为缩放系数; Wherein S 1 is a scaling factor;
    顶面/底面部分:贴图宽度为S 2×N/4,高为S 3×N/4; Top/bottom part: the width of the texture is S 2 ×N/4, and the height is S 3 ×N/4;
    其中,S 2和S 3均为缩放系数。 Among them, S 2 and S 3 are both scaling factors.
  5. 根据权利要求4所述的环境贴图映射方法,其特征在于,所述N的取值为2的幂。The environment map mapping method according to claim 4, wherein the value of N is a power of two.
  6. 根据权利要求4所述的环境贴图映射方法,其特征在于,所述S 1、S 2、S 3的取值为1,则顶面和底面的圆盖部分贴图的宽和高为N/4,侧面部分贴图的宽为N。 The environment map mapping method according to claim 4, wherein the values of S 1 , S 2 , and S 3 are 1, and the width and height of the top cover and the bottom cover portion are N/4. The width of the side part map is N.
  7. 根据权利要求4所述的环境贴图映射方法,其特征在于,所述第三步中侧面部分的纹理坐标为:The environment map mapping method according to claim 4, wherein the texture coordinates of the side portion of the third step are:
    Figure PCTCN2019072919-appb-100001
    Figure PCTCN2019072919-appb-100001
    v=(θ-A 1)/(A 1+A 2); v=(θ-A 1 )/(A 1 +A 2 );
    其中,
    Figure PCTCN2019072919-appb-100002
    为球面坐标系中球体表面上任意一点的方向向量投影到XY平面与X轴的夹角;
    among them,
    Figure PCTCN2019072919-appb-100002
    Projecting a direction vector of any point on the surface of the sphere in the spherical coordinate system to the angle between the XY plane and the X axis;
    u为纹理坐标系中水平方向的坐标值;u is the coordinate value of the horizontal direction in the texture coordinate system;
    v为纹理坐标系中垂直方向的坐标值。v is the coordinate value of the vertical direction in the texture coordinate system.
  8. 根据权利要求1所述的环境贴图映射方法,其特征在于,所述第三步中顶面/底面部分的纹理坐标映射方法为:The environment map mapping method according to claim 1, wherein the texture coordinate mapping method of the top/bottom portion in the third step is:
    将顶面/底面圆盖进行均匀切分,每块分别映射到矩形的一部分位置上。The top/bottom dome is evenly divided, and each block is mapped to a part of the rectangle.
  9. 根据权利要求1或8所述的环境贴图映射方法,其特征在于,The environment map mapping method according to claim 1 or 8, wherein
    将顶面/底面圆盖均匀切分为4份,每份分别映射到矩形的对应位置;The top/bottom dome is evenly divided into 4 parts, each of which is mapped to a corresponding position of the rectangle;
    将圆盖上任意一点到圆盖中心点的最短球面弧度距离定义为D,令L为将D归一化到[0,0.5]范围内的数值,则顶面圆盖上任意一点的L值为:0.5×θ/(π/2-A 1),而底面圆盖上任意一点的L值为:0.5×(π-θ)/(π/2-A 2); Define the shortest spherical arc distance from any point on the dome to the center of the dome as D, and let L be the value that normalizes D to [0,0.5], then the L value at any point on the top cover Is: 0.5 × θ / (π / 2 - A 1 ), and the L value of any point on the bottom dome is: 0.5 × (π - θ) / (π / 2 - A 2 );
    定义
    Figure PCTCN2019072919-appb-100003
    为将
    Figure PCTCN2019072919-appb-100004
    的取值范围映射到[-π/4,7×π/4)的数值,也就是:
    definition
    Figure PCTCN2019072919-appb-100003
    For the
    Figure PCTCN2019072919-appb-100004
    The range of values is mapped to the value of [-π/4,7×π/4), which is:
    Figure PCTCN2019072919-appb-100005
    (当
    Figure PCTCN2019072919-appb-100006
    时)
    Figure PCTCN2019072919-appb-100005
    (when
    Figure PCTCN2019072919-appb-100006
    Time)
    Figure PCTCN2019072919-appb-100007
    (当
    Figure PCTCN2019072919-appb-100008
    时)
    Figure PCTCN2019072919-appb-100007
    (when
    Figure PCTCN2019072919-appb-100008
    Time)
    则顶面/底面圆盖的纹理坐标分为以下4种情况,分别对应于4个区域:The texture coordinates of the top/bottom dome are divided into the following four cases, corresponding to four areas:
    第一种,
    Figure PCTCN2019072919-appb-100009
    The first,
    Figure PCTCN2019072919-appb-100009
    Figure PCTCN2019072919-appb-100010
    Figure PCTCN2019072919-appb-100010
    v=0.5+Lv=0.5+L
    第二种,
    Figure PCTCN2019072919-appb-100011
    Second,
    Figure PCTCN2019072919-appb-100011
    u=0.5+Lu=0.5+L
    Figure PCTCN2019072919-appb-100012
    Figure PCTCN2019072919-appb-100012
    第三种,
    Figure PCTCN2019072919-appb-100013
    Third,
    Figure PCTCN2019072919-appb-100013
    Figure PCTCN2019072919-appb-100014
    Figure PCTCN2019072919-appb-100014
    v=0.5-Lv=0.5-L
    第四种,
    Figure PCTCN2019072919-appb-100015
    Fourth,
    Figure PCTCN2019072919-appb-100015
    u=0.5–Lu=0.5–L
    Figure PCTCN2019072919-appb-100016
    Figure PCTCN2019072919-appb-100016
    其中,
    Figure PCTCN2019072919-appb-100017
    为球面坐标系中球体表面上任意一点的方向向量投影到XY平面与X轴的夹角;
    among them,
    Figure PCTCN2019072919-appb-100017
    Projecting a direction vector of any point on the surface of the sphere in the spherical coordinate system to the angle between the XY plane and the X axis;
    u为纹理坐标系中水平方向的坐标值;u is the coordinate value of the horizontal direction in the texture coordinate system;
    v为纹理坐标系中垂直方向的坐标值。v is the coordinate value of the vertical direction in the texture coordinate system.
  10. 一种采用环境贴图映射方法的装置,其特征在于:包括处理器,所述处理器用于执行如权利要求1至9任一项所述的方法步骤。An apparatus for employing an environment map mapping method, comprising: a processor for performing the method steps of any one of claims 1 to 9.
PCT/CN2019/072919 2018-02-13 2019-01-24 Environment mapping method and apparatus WO2019157923A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810150486.5 2018-02-13
CN201810150486.5A CN108447086B (en) 2018-02-13 2018-02-13 A kind of Environment mapping method and device

Publications (1)

Publication Number Publication Date
WO2019157923A1 true WO2019157923A1 (en) 2019-08-22

Family

ID=63192463

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/072919 WO2019157923A1 (en) 2018-02-13 2019-01-24 Environment mapping method and apparatus

Country Status (2)

Country Link
CN (1) CN108447086B (en)
WO (1) WO2019157923A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108447086B (en) * 2018-02-13 2019-02-26 视辰信息科技(上海)有限公司 A kind of Environment mapping method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106691A (en) * 2013-01-14 2013-05-15 清华大学 Method and system of interactive browsing visualization of moon model with grains and annotations
CN106355635A (en) * 2016-08-30 2017-01-25 北京像素软件科技股份有限公司 Method and device for displaying sky sphere in game scene
CN106792151A (en) * 2016-12-29 2017-05-31 上海漂视网络科技有限公司 A kind of virtual reality panoramic video player method
WO2017116952A1 (en) * 2015-12-29 2017-07-06 Dolby Laboratories Licensing Corporation Viewport independent image coding and rendering
US20170323423A1 (en) * 2016-05-06 2017-11-09 Mediatek Inc. Method and Apparatus for Mapping Omnidirectional Image to a Layout Output Format
CN108447086A (en) * 2018-02-13 2018-08-24 视辰信息科技(上海)有限公司 A kind of Environment mapping method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101871222B1 (en) * 2013-02-01 2018-06-27 삼성전자주식회사 Image processing apparatus and method
CN103559733B (en) * 2013-10-09 2017-02-08 浙江大学 Spherical body drawing method supporting three-dimension data inner viewpoint roaming
CN104484896B (en) * 2014-10-30 2018-01-16 无锡梵天信息技术股份有限公司 It is a kind of that the physical method of figure skin Subsurface Scattering is simulated based on Environment
CN104463959A (en) * 2014-11-25 2015-03-25 无锡梵天信息技术股份有限公司 Method for generating cubic environment maps
CN107317998A (en) * 2016-04-27 2017-11-03 成都理想境界科技有限公司 Full-view video image fusion method and device
CN106527857A (en) * 2016-10-10 2017-03-22 成都斯斐德科技有限公司 Virtual reality-based panoramic video interaction method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106691A (en) * 2013-01-14 2013-05-15 清华大学 Method and system of interactive browsing visualization of moon model with grains and annotations
WO2017116952A1 (en) * 2015-12-29 2017-07-06 Dolby Laboratories Licensing Corporation Viewport independent image coding and rendering
US20170323423A1 (en) * 2016-05-06 2017-11-09 Mediatek Inc. Method and Apparatus for Mapping Omnidirectional Image to a Layout Output Format
CN106355635A (en) * 2016-08-30 2017-01-25 北京像素软件科技股份有限公司 Method and device for displaying sky sphere in game scene
CN106792151A (en) * 2016-12-29 2017-05-31 上海漂视网络科技有限公司 A kind of virtual reality panoramic video player method
CN108447086A (en) * 2018-02-13 2018-08-24 视辰信息科技(上海)有限公司 A kind of Environment mapping method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MARTIN, LAMBERS: "Mappings between Sphere, Disc, and Square", JOURNAL OF COMPUTER GRAPHICS TECHNIQUES, 15 April 2016 (2016-04-15), XP055481607, ISSN: 2331-7418 *

Also Published As

Publication number Publication date
CN108447086A (en) 2018-08-24
CN108447086B (en) 2019-02-26

Similar Documents

Publication Publication Date Title
US20210225067A1 (en) Game screen rendering method and apparatus, terminal, and storage medium
US10621767B2 (en) Fisheye image stitching for movable cameras
US9626790B1 (en) View-dependent textures for interactive geographic information system
US6504535B1 (en) Display techniques for three-dimensional virtual reality
ES2886637T3 (en) Panoramic image compression method and apparatus
EP3438919B1 (en) Image displaying method and head-mounted display apparatus
EP3523955A1 (en) Apparatus and methods for the optimal stitch zone calculation of a generated projection of a spherical image
TWI637355B (en) Methods of compressing a texture image and image data processing system and methods of generating a 360-degree panoramic video thereof
US20180018807A1 (en) Method and apparatus for generating panoramic image with texture mapping
US10997954B2 (en) Foveated rendering using variable framerates
CN106558017B (en) Spherical display image processing method and system
WO2018077071A1 (en) Panoramic image generating method and apparatus
KR20180107271A (en) Method and apparatus for generating omni media texture mapping metadata
WO2018126922A1 (en) Method and apparatus for rendering panoramic video and electronic device
US10650592B2 (en) Methods and apparatus for providing rotated spherical viewpoints
US20220327781A1 (en) Stereoscopic rendering of virtual 3d objects
WO2020151268A1 (en) Generation method for 3d asteroid dynamic map and portable terminal
WO2023207963A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN108765582B (en) Panoramic picture display method and device
WO2019157923A1 (en) Environment mapping method and apparatus
CN113012290B (en) Terminal posture-based picture display and acquisition method and device, storage medium and terminal
CN109214981B (en) Method for projecting spherical image to plane image
US11388336B2 (en) Horizontal calibration method and system for panoramic image or video, and portable terminal
CN114359456B (en) Picture pasting method and device, electronic equipment and readable storage medium
CN109829851B (en) Panoramic image splicing method based on spherical alignment estimation and storage device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19754803

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19754803

Country of ref document: EP

Kind code of ref document: A1