







技术领域technical field
本发明涉及三维成像技术领域,尤其涉及一种全息图生成方法及系统。The invention relates to the technical field of three-dimensional imaging, and in particular, to a method and system for generating a hologram.
背景技术Background technique
全息显示是三维显示的一种理想方式。使用计算机模拟干涉衍射的物理过程生成全息图的方法称为计算全息,它可以计算虚拟场景的全息图,应用前景广阔。Holographic display is an ideal way of three-dimensional display. The method of generating holograms using computer simulation of the physical process of interference diffraction is called computational holography, which can calculate holograms of virtual scenes and has broad application prospects.
光线跟踪是一种通过模拟光线真实传播,来计算物体颜色等信息的方法,它能够实现遮挡处理以及提高图像的逼真度。例如,OptiX是英伟达公司推出的光线跟踪引擎,它利用GPU并行计算,能够实现实时计算的效果。Ray tracing is a method that calculates information such as object color by simulating the real propagation of light. It can realize occlusion processing and improve the fidelity of images. For example, OptiX is a ray tracing engine launched by NVIDIA, which uses GPU parallel computing to achieve real-time computing effects.
现有计算全息方法通常只能计算普通模型的全息图,难以表达复杂三维场景,而且现有计算方法通常将反射折射效果作为物体表面的纹理,不符合真实世界的观看效果。由于计算全息处理的数据量很大,为了实时计算通常采用分层法,而传统分层法不适于计算这种复杂场景,以反射为例,分层法中反射像在衍射到全息面时会对前方的反射面产生较严重的干扰。Existing computational holography methods can usually only calculate holograms of ordinary models, which are difficult to express complex three-dimensional scenes, and existing computational holography methods usually use catadioptric effects as the texture of the object surface, which does not conform to the viewing effect of the real world. Due to the large amount of data processed by computational holography, the layered method is usually used for real-time calculation, and the traditional layered method is not suitable for computing such complex scenes. Taking reflection as an example, in the layered method, the reflection image will be diffracted to the holographic surface Serious interference to the reflective surface in front.
发明内容SUMMARY OF THE INVENTION
本发明提供一种全息图生成方法及系统,用以解决现有技术中仅能计算普通的全息图,无法表达复杂场景的缺陷。The present invention provides a method and a system for generating a hologram, which are used to solve the defect in the prior art that only ordinary holograms can be calculated and complex scenes cannot be expressed.
第一方面,本发明提供一种全息图生成方法,包括:In a first aspect, the present invention provides a method for generating a hologram, comprising:
初始化三维场景,基于三维场景初始化信息启动光线跟踪;Initialize the 3D scene, and start ray tracing based on the initialization information of the 3D scene;
计算获得三维场景的颜色信息与深度信息;Calculate the color information and depth information of the 3D scene;
基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;Based on the color information and depth information of the three-dimensional scene, the holographic surface complex amplitude is calculated by using a preset diffraction fast calculation method;
对所述全息面复振幅进行编码,得到全息图。The complex amplitude of the holographic surface is encoded to obtain a hologram.
在一个实施例中,所述初始化三维场景,基于三维场景初始化信息启动光线跟踪,具体包括:In one embodiment, the initializing the 3D scene, starting ray tracing based on the 3D scene initialization information, specifically includes:
初始化三维场景,确定获得多个三维场景参数;Initialize the 3D scene, and determine to obtain multiple 3D scene parameters;
由位于全息面中心位置的相机向所述三维场景发射光线。Light is emitted to the three-dimensional scene by a camera located at the center of the holographic surface.
在一个实施例中,所述初始化三维场景,基于三维场景初始化信息启动光线跟踪,之后还包括:In one embodiment, the initializing the 3D scene, starting ray tracing based on the 3D scene initialization information, further includes:
判断光线跟踪中发出的光线是否与物体相交。Determines whether a ray emitted in ray tracing intersects an object.
在一个实施例中,所述计算获得三维场景的颜色信息与深度信息,具体包括:In one embodiment, the calculation to obtain color information and depth information of the three-dimensional scene specifically includes:
若所述光线与所述物体不相交则将所述光线对应的颜色设定为背景色,否则计算所述物体表面的颜色,并存储光线长度;If the ray does not intersect the object, set the color corresponding to the ray as the background color, otherwise calculate the color of the surface of the object, and store the length of the ray;
基于所述光线长度计算得到物体表面深度、物体反射像深度和物体折射像深度。The surface depth of the object, the reflection image depth of the object, and the refracted image depth of the object are calculated based on the ray length.
在一个实施例中,所述基于所述光线长度计算得到物体表面深度、物体反射像深度和物体折射像深度,具体包括:In one embodiment, the calculation based on the ray length to obtain the depth of the surface of the object, the depth of the reflected image of the object and the depth of the refracted image of the object specifically includes:
确定从相机位置指向注视点的第一单位向量、光线方向的第二单位向量以及击中物体光线长度,基于所述第一单位向量、所述第二单位向量和所述击中物体光线长度,得到所述物体表面深度;determining a first unit vector pointing from the camera position to the gaze point, a second unit vector of the ray direction, and the hit object ray length, based on the first unit vector, the second unit vector and the hit object ray length, obtain the surface depth of the object;
确定初始光线长度和反射光线长度,基于所述第一单位向量、所述第二单位向量、所述初始光线长度和所述反射光线长度,得到所述物体反射像深度;determining the initial ray length and the reflected ray length, and obtaining the reflected image depth of the object based on the first unit vector, the second unit vector, the initial ray length and the reflected ray length;
确定折射光线长度,由所述折射光线长度、介质折射率、空气折射率、折射光线与法线夹角和入射光线与法线夹角递归计算得到初始光线击中位置到折射像距离,基于所述第一单位向量、所述第二单位向量、所述初始光线长度和所述始光线击中位置到折射像距离,得到所述物体折射像深度。Determine the refracted ray length, and recursively calculate the distance from the initial ray hitting position to the refracted image from the refracted ray length, the medium refractive index, the air refractive index, the angle between the refracted ray and the normal, and the angle between the incident ray and the normal. The first unit vector, the second unit vector, the initial ray length, and the distance from the hit position of the initial ray to the refracted image are used to obtain the refracted image depth of the object.
在一个实施例中,所述计算获得三维场景的颜色信息与深度信息,之后还包括:In one embodiment, the computing obtains color information and depth information of the three-dimensional scene, and further includes:
根据深度信息,将所述三维场景分成若干层。According to the depth information, the three-dimensional scene is divided into several layers.
在一个实施例中,所述基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅,具体包括:In one embodiment, based on the color information and depth information of the three-dimensional scene, the holographic surface complex amplitude is calculated by using a preset diffraction fast calculation method, which specifically includes:
获取物体复振幅、波矢和衍射距离;Obtain the complex amplitude, wave vector and diffraction distance of the object;
基于所述波矢和所述衍射距离获得传递函数;obtaining a transfer function based on the wave vector and the diffraction distance;
基于所述物体复振幅和所述传递函数进行快速傅里叶变换以及快速傅里叶反变换,得到所述全息面复振幅。Fast Fourier transform and inverse fast Fourier transform are performed based on the object complex amplitude and the transfer function to obtain the holographic surface complex amplitude.
第二方面,本发明还提供一种全息图生成系统,包括:In a second aspect, the present invention also provides a hologram generation system, comprising:
初始化模块,用于初始化三维场景,基于三维场景初始化信息启动光线跟踪;The initialization module is used to initialize the 3D scene and start ray tracing based on the initialization information of the 3D scene;
第一计算模块,用于计算获得三维场景的颜色信息与深度信息;The first calculation module is used to calculate and obtain the color information and depth information of the three-dimensional scene;
第二计算模块,用于基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;The second calculation module is configured to calculate the holographic surface complex amplitude by adopting a preset diffraction fast calculation method based on the color information and depth information of the three-dimensional scene;
编码模块,用于对所述全息面复振幅进行编码,得到全息图。The encoding module is used for encoding the complex amplitude of the holographic surface to obtain a hologram.
第三方面,本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述全息图生成方法的步骤。In a third aspect, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the program, the processor implements any of the above Describe the steps of the hologram generation method.
第四方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述全息图生成方法的步骤。In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the above-mentioned hologram generation methods.
本发明提供的全息图生成方法及系统,通过使用光线跟踪获取三维场景的信息,利用图形处理器并行处理,可实现实时计算,在分层法中模拟真实光波传播以及正确显示复杂场景。The hologram generation method and system provided by the present invention obtain the information of the three-dimensional scene by using ray tracing, and utilize the parallel processing of the graphics processor to realize real-time calculation, simulate the real light wave propagation in the layered method, and correctly display the complex scene.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明提供的全息图生成方法的流程示意图;1 is a schematic flowchart of a method for generating a hologram provided by the present invention;
图2是本发明提供的整体流程示意图;Fig. 2 is the overall flow schematic diagram provided by the present invention;
图3是本发明提供的光线跟踪示意图;3 is a schematic diagram of ray tracing provided by the present invention;
图4是本发明提供的光线跟踪计算反射像示意图;4 is a schematic diagram of a ray tracing calculation reflection image provided by the present invention;
图5是本发明提供的光线跟踪计算折射像示意图;5 is a schematic diagram of a ray tracing calculation refraction image provided by the present invention;
图6是本发明提供的数值重建以及光学实验效果图;6 is a numerical reconstruction provided by the present invention and an optical experiment effect diagram;
图7是本发明提供的全息图生成系统的结构示意图;7 is a schematic structural diagram of a hologram generation system provided by the present invention;
图8是本发明提供的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
由于现有计算全息方法通常只能计算普通模型的全息图,难以表达复杂三维场景,本发明提出一种基于光线跟踪模拟真实场景的实时计算全息图生成方法。Since the existing computational holography methods can usually only calculate holograms of ordinary models, it is difficult to express complex three-dimensional scenes. The present invention proposes a real-time computational hologram generation method based on ray tracing to simulate real scenes.
下面对本发明所涉及的多个技术名词给出解释:Below, a plurality of technical terms involved in the present invention are explained:
全息图:通常应用衍射和干涉的原理,记录物体光波的干涉图样,这个干涉图样称为全息图。当全息图使用指定的再现光照明时,可以复现出物体的光波。Hologram: The principle of diffraction and interference is usually applied to record the interference pattern of the light wave of the object. This interference pattern is called a hologram. When the hologram is illuminated with the specified reproduction light, the light waves of the object can be reproduced.
空间光调制器(SLM):是计算全息再现过程中的核心器件。SLM能够实现对输入光波的调制,改变输入光波的相位、振幅等。可以将全息图加载到空间光调制器上实现全息显示。Spatial Light Modulator (SLM): It is the core device in the computational holographic reproduction process. SLM can realize modulation of the input light wave and change the phase and amplitude of the input light wave. Holograms can be loaded onto spatial light modulators to achieve holographic display.
光线跟踪:模拟真实光线传播的方法,从相机向三维场景发射光线并来计算每个像素的颜色。可以通过递归地发射光线来计算反射折射等复杂场景。在三维显示中可以用来获取三维场景信息。Ray Tracing: A method of simulating the propagation of real light, emitting rays from a camera into a 3D scene and calculating the color of each pixel. Complex scenes such as catadioptrics can be calculated by recursively firing rays. It can be used to obtain 3D scene information in 3D display.
菲涅尔衍射:菲涅耳衍射指的是光波在近场区域的衍射。菲涅耳衍射积分可以用来计算光波在近场区域的传播。Fresnel Diffraction: Fresnel diffraction refers to the diffraction of light waves in the near field region. The Fresnel diffraction integral can be used to calculate the propagation of light waves in the near-field region.
衍射快速计算:由于菲涅尔衍射积分计算量大,根据菲涅尔衍射积分推导出包含傅里叶变换形式的快速计算方法,如包含单步傅里叶变换的S-FFT算法、包含两步傅里叶变换的D-FFT算法,此外还有包含两步傅里叶变换的角谱算法等快速算法。Fast calculation of diffraction: Due to the large amount of calculation of Fresnel diffraction integral, a fast calculation method including Fourier transform is derived from Fresnel diffraction integral, such as S-FFT algorithm including single-step Fourier transform, including two steps The D-FFT algorithm of the Fourier transform, in addition to the fast algorithms such as the angular spectrum algorithm including the two-step Fourier transform.
图1是本发明提供的全息图生成方法的流程示意图,如图1所示,包括:1 is a schematic flowchart of a method for generating a hologram provided by the present invention, as shown in FIG. 1 , including:
S1,初始化三维场景,基于三维场景初始化信息启动光线跟踪;S1, initialize the 3D scene, and start ray tracing based on the initialization information of the 3D scene;
S2,计算获得三维场景的颜色信息与深度信息;S2, calculate and obtain color information and depth information of the three-dimensional scene;
S3,基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;S3, based on the color information and depth information of the three-dimensional scene, using a preset diffraction fast calculation method to calculate the holographic surface complex amplitude;
S4,对所述全息面复振幅进行编码,得到全息图。S4, encoding the complex amplitude of the holographic surface to obtain a hologram.
具体地,整理流程如图2所示,首先是初始化三维场景等信息,启动光线跟踪,然后由GPU进行处理如下步骤:向三维场景发射光线,计算获得三维场景的颜色信息和深度信息,进一步通过衍射快速计算方法衍射到全息面,最后得到全息面的复振幅,对复振幅进行编码,计算全息图。系统通过多次迭代判断和计算,能得到并显示清晰完整的全息图信息。Specifically, the sorting process is shown in Figure 2. First, the information such as the three-dimensional scene is initialized, ray tracing is started, and then the GPU performs the following steps: emit light to the three-dimensional scene, calculate and obtain the color information and depth information of the three-dimensional scene, and further pass The diffraction fast calculation method diffracts to the holographic surface, finally obtains the complex amplitude of the holographic surface, encodes the complex amplitude, and calculates the hologram. Through multiple iterations of judgment and calculation, the system can obtain and display clear and complete hologram information.
本发明通过使用光线跟踪获取三维场景的信息,利用图形处理器并行处理,可实现实时计算,在分层法中模拟真实光波传播以及正确显示复杂场景。The invention obtains the information of the three-dimensional scene by using ray tracing, and utilizes the parallel processing of the graphics processor to realize real-time calculation, simulate the real light wave propagation in the layered method, and correctly display the complex scene.
基于上述实施例,该方法中步骤S1具体包括:Based on the above embodiment, step S1 in the method specifically includes:
初始化三维场景,确定获得多个三维场景参数;Initialize the 3D scene, and determine to obtain multiple 3D scene parameters;
由位于全息面中心位置的相机向所述三维场景发射光线。Light is emitted to the three-dimensional scene by a camera located at the center of the holographic surface.
具体地,首先是初始化操作,对三维场景进行初始化,确定需要的各个参数;再启动光线跟踪,使相机位于全息面中心,向三维场景发射光线。Specifically, the first is the initialization operation, which initializes the 3D scene and determines the required parameters; then starts the ray tracing, so that the camera is located in the center of the holographic surface and emits light to the 3D scene.
基于上述任一实施例,该方法中步骤S1之后还包括:Based on any of the above embodiments, the method further includes after step S1:
判断光线跟踪中发出的光线是否与物体相交。Determines whether a ray emitted in ray tracing intersects an object.
可选地,待相机向三维场景发射光线后,对于发出的每条光线,判断是否与物体相交,根据判断结果进行后续的计算操作。Optionally, after the camera emits light to the three-dimensional scene, for each emitted light, it is determined whether it intersects with the object, and subsequent calculation operations are performed according to the determination result.
基于上述任一实施例,该方法中步骤S2具体包括:Based on any of the above embodiments, step S2 in the method specifically includes:
若所述光线与所述物体不相交则将所述光线对应的颜色设定为背景色,否则计算所述物体表面的颜色,并存储光线长度;If the ray does not intersect the object, set the color corresponding to the ray as the background color, otherwise calculate the color of the surface of the object, and store the length of the ray;
基于所述光线长度计算得到物体表面深度、物体反射像深度和物体折射像深度。The surface depth of the object, the reflection image depth of the object, and the refracted image depth of the object are calculated based on the ray length.
其中,所述基于所述光线长度计算得到物体表面深度、物体反射像深度和物体折射像深度,具体包括:Wherein, the calculation based on the ray length to obtain the depth of the surface of the object, the depth of the reflected image of the object, and the depth of the refracted image of the object specifically include:
确定从相机位置指向注视点的第一单位向量、光线方向的第二单位向量以及击中物体光线长度,基于所述第一单位向量、所述第二单位向量和所述击中物体光线长度,得到所述物体表面深度;determining a first unit vector pointing from the camera position to the gaze point, a second unit vector of the ray direction, and the hit object ray length, based on the first unit vector, the second unit vector and the hit object ray length, obtain the surface depth of the object;
确定初始光线长度和反射光线长度,基于所述第一单位向量、所述第二单位向量、所述初始光线长度和所述反射光线长度,得到所述物体反射像深度;determining the initial ray length and the reflected ray length, and obtaining the reflected image depth of the object based on the first unit vector, the second unit vector, the initial ray length and the reflected ray length;
确定折射光线长度,由所述折射光线长度、介质折射率、空气折射率、折射光线与法线夹角和入射光线与法线夹角递归计算得到初始光线击中位置到折射像距离,基于所述第一单位向量、所述第二单位向量、所述初始光线长度和所述始光线击中位置到折射像距离,得到所述物体折射像深度。Determine the refracted ray length, and recursively calculate the distance from the initial ray hitting position to the refracted image from the refracted ray length, the medium refractive index, the air refractive index, the angle between the refracted ray and the normal, and the angle between the incident ray and the normal. The first unit vector, the second unit vector, the initial ray length, and the distance from the hit position of the initial ray to the refracted image are used to obtain the refracted image depth of the object.
具体地,若判断光线不物体不相交则颜色设定为背景色,对于与物体相交的光线计算物体表面的颜色,同时储存光线的长度,如图3所示,为从相机位置指向注视点的单位向量,为光线方向的单位向量,d为光线长度,当光线击中物体后,计算物体表面所在深度depth,根据光线长度计算物体表面点所在的深度,计算方法如公式(1)所示:Specifically, if it is judged that the light does not intersect the object, the color is set as the background color, and the color of the surface of the object is calculated for the light intersecting with the object, and the length of the light is stored at the same time, as shown in Figure 3, is the unit vector pointing from the camera position to the gaze point, is the unit vector of the light direction, and d is the length of the light. When the light hits the object, the depth of the surface of the object is calculated, and the depth of the surface of the object is calculated according to the length of the light. The calculation method is shown in formula (1):
对于存在折射反射效果的物体,从相交点继续发射光线,计算折射反射像,并计算物体反射像深度,反射像计算如图4所示,对应的深度计算方法如公式(2)所示,同样为从相机位置指向注视点的单位向量,为初始光线方向的单位向量,d1为初始光线长度,d2为反射光线长度,根据下式计算反射像所在深度depth:For objects with refraction and reflection effects, continue to emit light from the intersection point, calculate the refraction reflection image, and calculate the reflection image depth of the object. The reflection image calculation is shown in Figure 4, and the corresponding depth calculation method is shown in formula (2). Similarly, is the unit vector pointing from the camera position to the gaze point, is the unit vector of the initial ray direction, d1 is the initial ray length, d2 is the reflected ray length, and the depth of the reflected image is calculated according to the following formula:
物体折射像计算如图5所示,对应的深度计算如公式(3)和(4),同样为从相机位置指向注视点的单位向量,为初始光线方向的单位向量,d1为初始光线长度,d2为折射光线长度。根据下式计算初始光线击中位置到折射像的距离d2':The calculation of the refraction image of the object is shown in Figure 5, and the corresponding depth calculation is as shown in formulas (3) and (4). is the unit vector pointing from the camera position to the gaze point, is the unit vector of the initial ray direction, d1 is the initial ray length, and d2 is the refracted ray length. Calculate the distance d2' from the initial ray hit position to the refracted image according to the following formula:
其中n1为介质折射率,n2为空气折射率,i1为折射光线与法线夹角,i2为入射光线与法线的夹角。如果存在多次折射,则d2'的长度需要递归地计算。根据下式计算反射像所在深度depth:where n1 is the refractive index of the medium, n2 is the refractive indexof air, i1 is the angle between the refracted ray and the normal, andi2 is the angle between the incident ray and the normal. If there are multiple refractions, the length of d2' needs to be calculated recursively. Calculate the depth of the reflected image according to the following formula:
本发明通过分别计算得到物体表面深度、物体反射深度和物体折射深度,全方位反映了物体的多角度对应信息,以获得复杂场景下的全息图。The invention obtains the surface depth of the object, the reflection depth of the object and the refraction depth of the object by calculating respectively, and comprehensively reflects the multi-angle corresponding information of the object, so as to obtain the hologram in the complex scene.
基于上述任一实施例,该方法中步骤S2之后还包括:Based on any of the above embodiments, the method further includes after step S2:
根据深度信息,将所述三维场景分成若干层。According to the depth information, the three-dimensional scene is divided into several layers.
可选地,本发明根据深度信息,将三维场景分成若干层,对于复杂场景,采用分层处理,结合衍射快速计算能够实现全息图的实时计算。Optionally, according to the depth information, the present invention divides the three-dimensional scene into several layers, and for complex scenes, real-time calculation of the hologram can be realized by using layered processing combined with fast diffraction calculation.
基于上述任一实施例,该方法中步骤S3具体包括:Based on any of the above embodiments, step S3 in the method specifically includes:
获取物体复振幅、波矢和衍射距离;Obtain the complex amplitude, wave vector and diffraction distance of the object;
基于所述波矢和所述衍射距离获得传递函数;obtaining a transfer function based on the wave vector and the diffraction distance;
基于所述物体复振幅和所述传递函数进行快速傅里叶变换以及快速傅里叶反变换,得到所述全息面复振幅。Fast Fourier transform and inverse fast Fourier transform are performed based on the object complex amplitude and the transfer function to obtain the holographic surface complex amplitude.
具体地,在三维场景的每层,对于普通物体,使用衍射快速计算的方法衍射到全息面,可以使用S-FFT、D-FFT以及角谱的方法,本发明以角谱法为例:Specifically, in each layer of the three-dimensional scene, for ordinary objects, the method of diffraction fast calculation is used to diffract to the holographic surface, and the methods of S-FFT, D-FFT and angular spectrum can be used. The present invention takes the angular spectrum method as an example:
p为物体复振幅,k为波矢,z为衍射距离根据公式(5)计算传递函数trans,根据公式(6)计算全息面复振幅h:p is the complex amplitude of the object, k is the wave vector, z is the diffraction distance, and the transfer function trans is calculated according to formula (5), and the complex amplitude h of the holographic surface is calculated according to formula (6):
h=IFFT[FFT(p)·trans] (6)h=IFFT[FFT(p)·trans] (6)
当分层数与成像范围确定后,传递函数即可确定,而且在交互过程中值不会改变,可以首先计算它们的值并存入缓存,后续计算直接读取,减少计算量加快计算速度。When the number of layers and the imaging range are determined, the transfer function can be determined, and the values will not change during the interaction process. Their values can be calculated first and stored in the cache, and subsequent calculations can be directly read, reducing the amount of calculation and speeding up the calculation.
对于反射折射像,首先将它们的复振幅传播到反射折射面处,之后,只保留反射折射面的复振幅,再传播到全息面。For catadioptric images, their complex amplitudes are first propagated to the catadioptric surface, after which only the complex amplitudes of the catadioptric surface are retained, and then propagated to the holographic surface.
基于上述任一实施例,本发明以具体的实施例来验证方法的有效性,如表1所示的数据:Based on any of the above-mentioned embodiments, the present invention verifies the validity of the method with specific embodiments, such as the data shown in Table 1:
表1Table 1
这里采用的1024*1024分辨率下计算速度对比,具体的测试配置为:CPU(Inteli7-9750h)和GPU(GTX1660ti),最后得到的数值重建以及光学实验效果对比图如图6所示。The calculation speed comparison at 1024*1024 resolution is used here. The specific test configuration is: CPU (Inteli7-9750h) and GPU (GTX1660ti). The final numerical reconstruction and optical experiment effect comparison are shown in Figure 6.
下面对本发明提供的全息图生成系统进行描述,下文描述的全息图生成系统与上文描述的全息图生成方法可相互对应参照。The hologram generation system provided by the present invention is described below, and the hologram generation system described below and the hologram generation method described above can be referred to each other correspondingly.
图7是本发明提供的全息图生成系统的结构示意图,如图7所示,包括:初始化模块71、第一计算模块72、第二计算模块73和编码模块74;其中:7 is a schematic structural diagram of the hologram generation system provided by the present invention, as shown in FIG. 7 , including: an
初始化模块71用于初始化三维场景,基于三维场景初始化信息启动光线跟踪;第一计算模块72用于计算获得三维场景的颜色信息与深度信息;第二计算模块73用于基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;编码模块74用于对所述全息面复振幅进行编码,得到全息图。The
本发明通过使用光线跟踪获取三维场景的信息,利用图形处理器并行处理,可实现实时计算,在分层法中模拟真实光波传播以及正确显示复杂场景。The invention obtains the information of the three-dimensional scene by using ray tracing, and utilizes the parallel processing of the graphics processor to realize real-time calculation, simulate the real light wave propagation in the layered method, and correctly display the complex scene.
图8示例了一种电子设备的实体结构示意图,如图8所示,该电子设备可以包括:处理器(processor)810、通信接口(CommunicationsInterface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的逻辑指令,以执行全息图生成方法,该方法包括:初始化三维场景,基于三维场景初始化信息启动光线跟踪;计算获得三维场景的颜色信息与深度信息;基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;对所述全息面复振幅进行编码,得到全息图。FIG. 8 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 8 , the electronic device may include: a processor (processor) 810, a communication interface (CommunicationsInterface) 820, a memory (memory) 830 and a
此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,RandomAccessMemory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法所提供的全息图生成方法,该方法包括:初始化三维场景,基于三维场景初始化信息启动光线跟踪;计算获得三维场景的颜色信息与深度信息;基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;对所述全息面复振幅进行编码,得到全息图。In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer When executing, the computer can execute the hologram generation method provided by the above methods, the method includes: initializing a three-dimensional scene, starting ray tracing based on the initialization information of the three-dimensional scene; calculating and obtaining color information and depth information of the three-dimensional scene; based on the three-dimensional scene The color information and depth information of the holographic surface are calculated by using the preset diffraction fast calculation method to obtain the complex amplitude of the holographic surface; the complex amplitude of the holographic surface is encoded to obtain a hologram.
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各提供的全息图生成方法,该方法包括:初始化三维场景,基于三维场景初始化信息启动光线跟踪;计算获得三维场景的颜色信息与深度信息;基于所述三维场景的颜色信息与深度信息,采用预设衍射快速计算方法计算得到全息面复振幅;对所述全息面复振幅进行编码,得到全息图。In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, the computer program being implemented by a processor to execute the hologram generation methods provided above, the method comprising: Initializing the three-dimensional scene, and starting ray tracing based on the initialization information of the three-dimensional scene; calculating and obtaining color information and depth information of the three-dimensional scene; based on the color information and depth information of the three-dimensional scene, using a preset diffraction fast calculation method to calculate the complex amplitude of the holographic surface; The complex amplitude of the holographic surface is encoded to obtain a hologram.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein 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, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110210161.3ACN113093500B (en) | 2021-02-24 | 2021-02-24 | A method and system for generating a hologram |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110210161.3ACN113093500B (en) | 2021-02-24 | 2021-02-24 | A method and system for generating a hologram |
| Publication Number | Publication Date |
|---|---|
| CN113093500A CN113093500A (en) | 2021-07-09 |
| CN113093500Btrue CN113093500B (en) | 2022-05-17 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110210161.3AActiveCN113093500B (en) | 2021-02-24 | 2021-02-24 | A method and system for generating a hologram |
| Country | Link |
|---|---|
| CN (1) | CN113093500B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114170287A (en)* | 2021-12-09 | 2022-03-11 | 中国联合网络通信集团有限公司 | Depth information acquisition method and apparatus, electronic device, computer readable medium |
| CN118778371B (en)* | 2023-04-07 | 2025-09-09 | 光科芯图(北京)科技有限公司 | Holographic mask information generation optimization method, device and exposure equipment |
| CN119717468A (en)* | 2024-11-14 | 2025-03-28 | 北京航空航天大学 | High-quality and high-efficiency hologram generation method based on complex amplitude constraint algorithm |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008142000A1 (en)* | 2007-05-21 | 2008-11-27 | Seereal Technologies S.A. | Holographic reconstruction system with tracking of the reconstruction |
| CN101689036A (en)* | 2007-05-16 | 2010-03-31 | 视瑞尔技术公司 | Method for rendering and generating color video holograms in real time |
| JP2010200188A (en)* | 2009-02-27 | 2010-09-09 | National Institute Of Information & Communication Technology | Multi-viewpoint image generation apparatus, multi-viewpoint image generation method, and multi-viewpoint image generation program |
| CN109683461A (en)* | 2019-01-24 | 2019-04-26 | 杭州光粒科技有限公司 | Method for generating holograms, system, storage medium and nearly eye AR hologram three-dimensional display system based on light field rendering |
| WO2019122295A2 (en)* | 2017-12-21 | 2019-06-27 | Seereal Technologies S.A. | Display device and method for tracking a virtual visibility region |
| CN110750043A (en)* | 2019-10-31 | 2020-02-04 | 北京航空航天大学 | A holographic axial chromatic aberration compensation method based on digital axicon |
| CN111812956A (en)* | 2020-06-12 | 2020-10-23 | 北京邮电大学 | Method, device and electronic device for generating computational hologram based on volume data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| DE102007024236A1 (en)* | 2007-05-21 | 2008-11-27 | Seereal Technologies S.A. | Holographic reconstruction system with an array of controllable microprisms |
| CN106707680B (en)* | 2017-03-10 | 2019-03-12 | 东南大学 | A kind of holographic projection methods based on light field |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101689036A (en)* | 2007-05-16 | 2010-03-31 | 视瑞尔技术公司 | Method for rendering and generating color video holograms in real time |
| WO2008142000A1 (en)* | 2007-05-21 | 2008-11-27 | Seereal Technologies S.A. | Holographic reconstruction system with tracking of the reconstruction |
| JP2010200188A (en)* | 2009-02-27 | 2010-09-09 | National Institute Of Information & Communication Technology | Multi-viewpoint image generation apparatus, multi-viewpoint image generation method, and multi-viewpoint image generation program |
| WO2019122295A2 (en)* | 2017-12-21 | 2019-06-27 | Seereal Technologies S.A. | Display device and method for tracking a virtual visibility region |
| CN109683461A (en)* | 2019-01-24 | 2019-04-26 | 杭州光粒科技有限公司 | Method for generating holograms, system, storage medium and nearly eye AR hologram three-dimensional display system based on light field rendering |
| CN110750043A (en)* | 2019-10-31 | 2020-02-04 | 北京航空航天大学 | A holographic axial chromatic aberration compensation method based on digital axicon |
| CN111812956A (en)* | 2020-06-12 | 2020-10-23 | 北京邮电大学 | Method, device and electronic device for generating computational hologram based on volume data |
| Title |
|---|
| 三维物场多重分数傅里叶变换全息图光电再现实验研究;郑华东等;《激光与光电子学进展》;20110210(第02期);全文* |
| 基于OptiX光线跟踪引擎的光线跟踪全息图生成算法;孙敏远等;<激光与光电子学进展>;20201231(第24期);全文* |
| Publication number | Publication date |
|---|---|
| CN113093500A (en) | 2021-07-09 |
| Publication | Publication Date | Title |
|---|---|---|
| CN113093500B (en) | A method and system for generating a hologram | |
| Ichikawa et al. | Realistic expression for full-parallax computer-generated holograms with the ray-tracing method | |
| CN112465938A (en) | Three-dimensional (3D) rendering method and device | |
| CN114494611B (en) | Intelligent 3D reconstruction method, device, equipment and medium based on neural basis function | |
| US20240062453A1 (en) | Generation of tight world space bounding regions | |
| CN115857305A (en) | A Hologram Reconstruction Method with Adjustable Depth of Field Based on Gradient Descent Optimization Algorithm | |
| Feng et al. | Gaussian splashing: Unified particles for versatile motion synthesis and rendering | |
| Schjøth et al. | Photon differentials | |
| CN114926516A (en) | Scattering imaging method and device and computer readable storage medium | |
| WO2023146468A2 (en) | Renderer using explicit object represention via rays tracing volume density aggregation | |
| CN111812956B (en) | Method, device and electronic device for generating computational hologram based on volume data | |
| Wang et al. | Real-time photorealistic computer-generated holograms based on backward ray tracing and wavefront recording planes | |
| Liu et al. | Occlusion calculation algorithm for computer generated hologram based on ray tracing | |
| CN118071909A (en) | Gaussian sputtering method based on delayed reflection calculation | |
| CN114494548B (en) | Method, device and electronic equipment for generating virtual model | |
| Zheng et al. | Unsupervised deep neural network for fast computer-generated holography with continuous depth control | |
| Chen et al. | Photorealistic rapid computer-generated holography employing an enhanced path tracing technique with sequence generated trial | |
| JP2023539808A (en) | Shader core instruction to call depth culling | |
| Chao et al. | Random-phase Gaussian Wave Splatting for Computer-generated Holography | |
| KR20210085177A (en) | Method and apparatus for generating hologram with wide viewing angle | |
| Chan et al. | Particle–mesh coupling in the interaction of fluid and deformable bodies with screen space refraction rendering | |
| Yang | Triplet: Triangle Patchlet for Mesh-Based Inverse Rendering and Scene Parameters Approximation | |
| CN114972613B (en) | Virtual character pupil processing method, device, equipment and storage medium | |
| CN102402795A (en) | Method for estimating scattering of light in homogeneous medium | |
| Zhang et al. | Retinal-NeRF: Real-time rendering of neural point fields across platform |
| 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |