Image rendering method, device and electronic device

By assigning weights to each spatial point in the NeRF model and performing volume rendering, the problem of image color aberration caused by differences in rendering quality of NeRF models in different areas is solved, achieving higher quality and consistent image rendering.

CN118052926BActive Publication Date: 2024-10-29北京数原数字化城市研究中心
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410253693.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-06
Publication Date
2024-10-29
Estimated Expiration
2044-03-06

AI Technical Summary

Technical Problem

The difference in rendering quality of different NeRF models in different areas leads to the problem of chromatic aberration in the image.

Method used

By inputting the observation information of M spatial points into N NeRF models respectively, the rendering information weight of each spatial point is determined, and volume rendering is performed based on these weights to calculate the color of each pixel to avoid color difference caused by direct equal integration.

Benefits of technology

It effectively reduces image chromatic aberration, improves rendering quality, and ensures image consistency in the same 3D scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118052926B_ABST
    Figure CN118052926B_ABST
Patent Text Reader

Abstract

The present application provides an image rendering method, device and electronic device, which relate to the field of computer vision technology, wherein the method comprises: inputting the first observation information of M spatial points into N neural radiation field NeRF models respectively, obtaining N rendering information of the M spatial points, the rendering information comprising at least one of the first RGB parameter and the first volume density, the M spatial points being spatial points located on the same ray in the 3D scene to be rendered, and M and N being integers greater than 1; respectively determining the weight of each rendering information of each spatial point; performing volume rendering according to the N rendering information of the M spatial points and the weight of each rendering information of each spatial point, and obtaining the first color of the pixel corresponding to the M spatial points. The present application does not directly integrate the N rendering information of the M spatial points output by the N NeRF models equally based on volume rendering, but integrates according to the weight of each rendering information of each spatial point (i.e., volume rendering), which can effectively reduce image chromatic aberration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to an image rendering method, device and electronic device. Background Art

[0002] The Neural Radiance Field (NeRF) model uses a neural network to represent a three-dimensional scene. For large scenes, the amount of data collected is usually large, and a single NeRF model is difficult to cover the full amount of data. Therefore, the data needs to be divided into multiple blocks to train different NeRF models separately, so that different NeRF models can be used to render images in different areas of the same scene. The NeRF model uses a volume rendering method to render images. Each pixel in the image corresponds to a 3D ray. The density and color of each spatial point (also called a sampling point) on the 3D ray are integrated to obtain the color of the pixel corresponding to the 3D ray. When using different NeRF models to render images of different areas in the same scene, each NeRF model will output the density and color of each spatial point on a certain 3D ray. Based on volume rendering, the density and color of the spatial points output by each NeRF model are integrated, and the integrated results are combined to obtain the information of the pixel corresponding to the ray.

[0003] However, since the coverage areas of the training data of different NeRF models are different, the rendering quality of different NeRF models in different areas is different. Directly integrating the rendering information of the spatial points output by each NeRF model equally based on volume rendering and then combining the integrated results will cause color difference in the image. Summary of the invention

[0004] The embodiments of the present application provide an image rendering method, device and electronic device to solve the problem of color difference in the image caused by directly performing equal integration of the rendering information of the spatial points output by each NeRF model based on volume rendering due to differences in rendering quality of different NeRF models in different areas.

[0005] In order to solve the above technical problems, the present application is implemented as follows;

[0006] In a first aspect, an embodiment of the present application provides an image rendering method, the method comprising:

[0007] Inputting first observation information of M spatial points into N neural radiation field NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1;

[0008] Determine the weight of each rendering information of each spatial point respectively;

[0009] Volume rendering is performed according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point to obtain the first colors of the pixels corresponding to the M spatial points.

[0010] In a second aspect, an embodiment of the present application provides an image rendering device, including:

[0011] A first acquisition module is used to input first observation information of M spatial points into N neural radiation field NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1;

[0012] A determination module, used to determine the weight of each rendering information of each spatial point respectively;

[0013] The rendering module is used to perform volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point, so as to obtain the first color of the pixel corresponding to the M spatial points.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the image rendering method described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image rendering method described in the first aspect are implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the image rendering method described in the first aspect.

[0017] In an embodiment of the present application, the first observation information of M spatial points is respectively input into N NeRF models, and each NeRF model will output a rendering information of each space, thereby obtaining N rendering information of M spatial points; the weight of each rendering information of each spatial point is respectively determined, and volume rendering is performed according to the N rendering information of M spatial points and the weight of each rendering information of each spatial point, thereby obtaining the first color of the pixel corresponding to the M spatial points. In the process of rendering the same 3D scene through multiple NeRF models, the embodiment of the present application does not directly integrate the N rendering information of M spatial points output by N NeRF models equally based on volume rendering, but integrates according to the weight of each rendering information of each spatial point (i.e., volume rendering), which can effectively reduce image color difference. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 One of the flowcharts of an image rendering method provided in an embodiment of the present application;

[0020] Figure 2 A second flowchart of an image rendering method provided in an embodiment of the present application;

[0021] Figure 3 A structural diagram of an image rendering device provided in an embodiment of the present application;

[0022] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.

[0025] For ease of understanding, the relevant contents involved in this application are explained below.

[0026] New perspective image synthesis technology belongs to the task in the field of combining computer vision and computer graphics. In the field of new perspective synthesis, Neural Radiance Field (NeRF) has maintained a good popularity since its birth, and has become an important branch of neural rendering. NeRF can be trained based on a series of pictures taken from different perspectives. After training, NeRF uses a neural network to represent the three-dimensional scenes corresponding to the above pictures. Based on the trained NeRF, it can render pictures with different camera poses (camera pose includes the three-dimensional coordinates of the camera and the orientation of the camera). Usually, the NeRF model can render pictures with training camera poses (that is, the camera pose of the training picture) well. For areas not covered by the training data, the rendering results are random.

[0027] For large scenes, the expression ability of a single NeRF model is limited. If there are too many perspective images involved in the training or the shooting scene is too large, the rendered image will be blurred. Therefore, in the related art, the data of the large scene can be divided into multiple blocks for training different NeRF models respectively, so that different NeRF models can be used to render images of different areas in the same scene. Based on the observation information of the spatial point, the NeRF model can obtain the RGB parameters (3D vector c = (R, G, B)) and volume density of the spatial point. After obtaining the RGB parameters and volume density of the spatial point, the image can be rendered based on the volume rendering method. Specifically, each pixel in the image corresponds to a 3D ray. The density and RGB parameters of each spatial point (also called sampling point) on the 3D ray are integrated to obtain the color of the pixel corresponding to the 3D ray. When using different NeRF models to render images of different areas in the same scene, each NeRF model will output the density and RGB parameters of each spatial point on a certain 3D ray. Based on volume rendering, the volume density and RGB parameters of the spatial point output by each NeRF model are integrated, and the integrated results are combined to obtain the information of the pixel corresponding to the ray.

[0028] However, each NeRF model will output the density and RGB parameters of each spatial point on a certain 3D ray. Since the coverage area of ​​the training data of different NeRF models is different, the rendering quality of different NeRF models in different areas is different. If the rendering information of the spatial points output by each NeRF model is equally integrated based on volume rendering and the integrated results are combined, color difference will occur in the image.

[0029] In order to solve the problem of color difference in the image caused by the difference in rendering quality of different NeRF models in different areas, the rendering information of the spatial points output by each NeRF model is equally integrated directly based on volume rendering. The embodiments of the present application provide an image rendering method, device and electronic device.

[0030] The image rendering method provided by the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0031] See also Figure 1 , Figure 1 is one of the flowcharts of an image rendering method provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0032] Step 101: inputting first observation information of M spatial points into N NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1;

[0033] Step 102, respectively determine the weight of each rendering information of each spatial point;

[0034] Step 103 : Perform volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point to obtain the first colors of the pixels corresponding to the M spatial points.

[0035] The N NeRF models in the embodiment of the present application are trained NeRF models, and the neural networks of the N NeRF models store 3D models of different areas in the above 3D scene to be rendered. Based on the N NeRF models, pictures corresponding to the above 3D scene under different shooting angles can be obtained.

[0036] The following is an exemplary description of how to train the NeRF model.

[0037] The input data for training the NeRF model are: a sequence of photos of the same 3D scene taken from different positions, and the camera pose and camera intrinsic parameters for taking these photos. When the 3D scene is large, the sequence of photos of the same 3D scene taken from different positions can be divided into multiple blocks to train different NeRF models (i.e., the N NeRF models mentioned above). Taking N equals 3 as an example, the photos of the same 3D scene can be divided into photos of the first area, photos of the second area, and photos of the third area of ​​the same 3D scene to train three different NeRF models respectively, so that different NeRF models can respectively store 3D models of the first area, the second area, and the third area. Among them, any of the three different NeRF models has a direct or indirect common viewing area with other NeRF models. For example, a direct common viewing area is a 3D model partially overlapped by the 3D models saved by NeRF model A and NeRF model B, so there is a direct common viewing area between NeRF model A and NeRF model B. For example, an indirect common viewing area is a 3D model partially overlapped by the 3D models saved by NeRF model A and NeRF model B, and there is a partial overlap between the 3D models saved by NeRF model B and NeRF model C, so there is an indirect common viewing area between NeRF model A and NeRF model C.

[0038] After training N NeRF models, images of 3D scenes under any camera pose can be obtained based on the N NeRF models.

[0039] Before step 101, the camera posture needs to be preprocessed to obtain the parameters of the 3D ray, and then the observation information of each sampling point of each 3D ray is obtained according to the preset sampling standard. The following is an exemplary description:

[0040] When you need to get a picture of the 3D scene under the pose of camera A (including the camera position (3D coordinates) and the camera orientation), process the pose of camera A and get the expressions of multiple 3D rays based on the pose of camera A and the camera internal parameters:

[0041] r(t)=o+t j ·d (1)

[0042] Where r is the ray, o is the coordinate of the center point of the camera (that is, the origin of the ray), d is the direction of the ray, and t j is the distance from the spatial point (or sampling point) to the starting point of the ray. The value of j can be set according to actual needs. For example, spatial points can be uniformly sampled on a ray (j = 1, 2...N)

[0043] According to the above expression of each 3D ray, the observation information of each spatial point on each 3D ray (including spatial point coordinates and observation direction) can be obtained. The volume rendering result of a ray corresponds to the color of a pixel on the image.

[0044] In the embodiment of the present application, the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and the first observation information of the M spatial points (including the coordinates x=(x, y, z) of the spatial points and the direction of observation) is ) input N NeRF models respectively, and N rendering information of M spatial points output by the N NeRF models can be obtained, that is, each NeRF model will output a rendering information of each spatial point.

[0045] Determine the weight of each rendering information of each spatial point separately. In some embodiments, the weight may be pre-customized, for example, the weight of the rendering information of the spatial point output by the pre-customized poorly trained NeRF model is lower; in other embodiments, the weight may be determined based on the Euclidean distance between the spatial point and the NeRF model, for example: the Euclidean distance between the spatial point and the center point of the NeRF model is negatively correlated, and when the Euclidean distance between the spatial point A and the center point of the NeRF model A is greater than the Euclidean distance between the spatial point A and the center point of the NeRF model B, the weight of the rendering information of the spatial point A output by the NeRF model A is less than the weight of the rendering information of the spatial point A output by the NeRF model B.

[0046] After the weight of each piece of rendering information of each spatial point is determined, integration (ie, volume rendering) may be performed according to the N pieces of rendering information of M spatial points and the weight of each piece of rendering information of each spatial point.

[0047] In order to more clearly understand the technical solution of the embodiment of the present application, the volume rendering according to weight in the embodiment of the present application is exemplarily described below.

[0048] Exemplarily, volume rendering may be performed according to the following formula:

[0049]

[0050] Wherein, C(r) represents the first color, i represents the i-th NeRF model in the N NeRF models, j represents the j-th spatial point in the M spatial points, and k represents the k-th spatial point in the M spatial points. represents the weight of a rendering information of the j-th spatial point output by the i-th NeRF model, represents the first volume density of the k-th spatial point output by the i-th NeRF model (volume density can be understood as the opacity of the spatial point), δ krepresents the distance between the kth spatial point and the (k-1)th spatial point, represents the first volume density of the j-th spatial point output by the i-th NeRF model, δ j represents the distance between the j-th spatial point and the (j-1)-th spatial point, Represents the first RGB parameter of the j-th spatial point output by the i-th NeRF model.

[0051] In the process of rendering the same 3D scene through multiple NeRF models, the embodiment of the present application does not directly integrate the N rendering information of M spatial points output by N NeRF models equally based on volume rendering, but integrates them according to the weight of each rendering information of each spatial point (i.e., volume rendering), which can effectively reduce image chromatic aberration.

[0052] Optionally, step 102 includes:

[0053] Determine the Euclidean distance between the coordinates of the first spatial point (any spatial point among the M spatial points) and the coordinates of the center points corresponding to the N NeRF models;

[0054] According to the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center points corresponding to the N NeRF models, the weights of the N rendering information of the first spatial point are determined, and the weight of each rendering information of the first spatial point is negatively correlated with the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center point of the NeRF model.

[0055] The coordinates of the center point of the NeRF model can be determined based on the training data of the NeRF model. Specifically, the coordinates of the center point of the NeRF model can be determined based on the camera position (i.e., the three-dimensional coordinates of the camera) of each training picture of the NeRF model. The formula is as follows:

[0056]

[0057] Where M i is the center point coordinate of the i-th NeRF model, N i is the number of training images for the i-th NeRF model, P t is the camera position of the training image.

[0058] After determining the coordinates of the center point of the NeRF model, determine the Euclidean distance between the coordinates of the spatial point and the coordinates of the center point of the NeRF model. The formula is as follows:

[0059]

[0060] Where M i is the center point coordinate of the i-th NeRF model, xj is the jth spatial point among M spatial points, is the Euclidean distance between the j-th spatial point and the center point of the i-th NeRF model.

[0061] According to the Euclidean distance, the corresponding weight can be determined. The formula is as follows:

[0062]

[0063] In the formula, represents the weight of a rendering information of the jth spatial point output by the i-th NeRF model, represents the sum of the Euclidean distances between the center point of N NeRF models and the jth spatial point, and α is a hyperparameter. According to Formula 5, the weights of N rendering information of M spatial points can be obtained (the weights of N rendering information are also the weights corresponding to the N rendering information of spatial points output by N models).

[0064] According to the above formula 5, when determining the weights of the N rendering information of the first spatial point, the denominator in formula 5 is always equal to the sum of the Euclidean distances between the center points of the N NeRF models and the first spatial point, and the numerator is the (-α)th power of the Euclidean distance between the first spatial point and a certain NeRF model. It can be seen that the weight of each rendering information of the first spatial point is negatively correlated with the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center point of the NeRF model.

[0065] In the embodiment of the present application, the weight of the rendering information is determined according to the Euclidean distance between the coordinates of the spatial point and the coordinates of the center point of the NeRF model. When the Euclidean distance between the center point of the NeRF model and the first spatial point is closer, the weight of the rendering information of the first spatial point output by the NeRF model is higher. The closer the Euclidean distance, the more accurate the rendering information can be obtained, and by assigning a higher weight, it is helpful to reduce the color difference of the image.

[0066] Optionally, the method further comprises:

[0067] Obtaining the validity of each rendering information of each spatial point, wherein the validity is determined by the NeRF model;

[0068] The step of performing volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point to obtain a first color of a pixel corresponding to the M spatial points includes:

[0069] Volume rendering is performed according to the N pieces of rendering information of the M spatial points, the weight of each piece of rendering information of each spatial point, and the validity of each piece of rendering information of each spatial point to obtain the first colors of the pixels corresponding to the M spatial points.

[0070] In this implementation, while each NeRF model outputs rendering information of a spatial point, each NeRF model also outputs the validity of the rendering information.

[0071] The validity is related to the rendering effect. Each NeRF model has two areas: good rendering and poor rendering. In NeRF model A, if the rendering quality of spatial point A is poor, the validity of the rendering information of spatial point A output by NeRF model A is low.

[0072] During the rendering process, the areas close to the camera are rendered first, so there may be a situation where a low-quality area of ​​a NeRF model blocks other high-quality areas, resulting in the rendered image not being the optimal solution. Therefore, the embodiment of the present application also performs volume rendering based on effectiveness, and eliminates low-quality areas during rendering to avoid affecting the rendering of high-quality areas.

[0073] In some embodiments, the validity can be divided into valid and invalid, and the parameter "1" can be used to represent valid, and the parameter "0" can be used to represent invalid. According to the validity parameter, invalid rendering information can be screened out during the volume rendering process.

[0074] In other embodiments, the validity may also include a specific validity value (such as a validity percentage, etc.), and whether to filter out the rendering information may be determined based on the validity value. For example, when the validity value of a certain rendering information of a spatial point A is less than a preset value, it may be determined that the rendering information of the spatial point needs to be filtered out.

[0075] In the embodiment of the present application, volume rendering is also performed based on the validity of the rendering information, which can eliminate low-quality areas during rendering to avoid affecting high-quality areas, thereby helping to reduce image noise and further improve image quality.

[0076] The following uses the first NeRF model (the first NeRF model is any one of the N NeRF models) as an example to explain how to determine the validity of the rendering information of the M spatial points output by the first NeRF model.

[0077] In some embodiments, the validity is obtained according to the following steps:

[0078] a. The first NeRF model of the N NeRF models respectively fuses the corresponding disturbance variables in the first observed information of the M spatial points to obtain the second observed information of the M spatial points;

[0079] b. The first NeRF model determines the second RGB parameters and the second volume density of the M spatial points according to the second observed information of the M spatial points, and obtains the second color of the pixel corresponding to the M spatial points based on volume rendering;

[0080] c. The first NeRF model determines the Jacobian matrix corresponding to the M spatial points according to the second color and the disturbance variables corresponding to the M spatial points;

[0081] d. The first NeRF model determines the Hessian matrix corresponding to the M spatial points according to the Jacobian matrix corresponding to the M spatial points;

[0082] e. The first NeRF model determines the validity of the rendering information output by the first NeRF model of the M spatial points according to the Hessian matrix corresponding to the M spatial points.

[0083] In step a, the first NeRF model fuses corresponding disturbance variables in the first observed information of the M spatial points respectively, and the disturbance variables are differentiable. The corresponding disturbance variables are fused in the first observed information mainly by fusing the corresponding disturbance variables in the three-dimensional coordinates of the M spatial points:

[0084]

[0085] In the formula, x j is the coordinate of the jth spatial point in the first observation information, Δx j is the disturbance variable corresponding to the jth point of fusion, is the coordinate of the jth spatial point that integrates the corresponding disturbance variable in the second observation information.

[0086] It should be noted that the observation direction in the first observation information is the same as the observation direction in the second observation information, which is the ray direction d in formula 1.

[0087] In step b, the first NeRF model determines the second RGB parameters and the second volume density of the M spatial points based on the second observed information of the M spatial points.

[0088]

[0089] And based on the standard volume rendering formula, the second color of the pixel corresponding to the M spatial points with disturbance is obtained:

[0090]

[0091] In the formula, represents the second volume density of the kth spatial point determined by the first NeRF model according to the second observation information, δ k represents the distance between the kth spatial point and the (k-1)th spatial point, represents the second volume density of the jth spatial point determined by the first NeRF model according to the second observation information, δ jrepresents the distance between the jth spatial point and the (j-1)th spatial point, Represents the second RGB parameter of the jth spatial point determined by the first NeRF model according to the second observation information

[0092] In step c, determine the Jacobian matrix of each spatial point:

[0093]

[0094] In step d, the Hessian matrix corresponding to each spatial point is determined according to the Jacobian matrix of each spatial point. The Hessian matrix can be calculated using the Laplace approximation:

[0095]

[0096] In the formula, is the Jacobian matrix corresponding to the spatial point j, is the transpose of the matrix, λ is the inverse of the variance of the disturbance Δx, and I is the unit matrix.

[0097] The value of the Hessian matrix corresponding to each spatial point is used to characterize the impact of the disturbance of the spatial point on the volume rendering result. Therefore, when the value of the Hessian matrix corresponding to the spatial point is high, it means that the uncertainty of the spatial point is high. Therefore, the weight of the rendering information of the spatial point output by the NeRF model can be determined according to the Hessian matrix corresponding to the spatial point.

[0098] In some embodiments, validity may be determined according to the following binary function:

[0099] v(x)=‖H(x)‖2<0.5*Max({‖H(x j )‖2|j=1..M}) (11)

[0100] Where v(x) is a binary function that outputs 0 and 1, where 0 indicates invalid and 1 indicates valid.

[0101] It is worth mentioning that the validity of determining the rendering information of M spatial points by other models among the N NeRF models except the first NeRF model can refer to the above embodiment, and will not be described again to avoid repetition.

[0102] The embodiment of the present application simulates the spatial parameterized perturbation of the NeRF model through the above steps, uses the rendering information of the perturbed spatial points for volume rendering, and uses the Laplace approximation to estimate the uncertainty (i.e., the Hessian matrix) of the N pieces of rendering information of each spatial point output by the N NeRF models according to the gradient of the perturbation amount, as an indicator for evaluating the effectiveness of the spatial points.

[0103] The Hessian matrix can represent the uncertainty of a spatial point. When the uncertainty of the spatial point A determined by the first NeRF model is high, the first NeRF model can determine that the output rendering information of the spatial point A is invalid according to the above binary function. It can be seen that the embodiment of the present application determines the validity of the rendering information more accurately through the above steps.

[0104] Optionally, performing volume rendering according to the N pieces of rendering information of the M spatial points, the weight of each piece of rendering information of each spatial point, and the validity of each piece of rendering information of each spatial point to obtain the first color of the pixel corresponding to the M spatial points includes:

[0105] The first color of the pixel corresponding to the M spatial points is determined according to the following volume rendering formula:

[0106]

[0107] Wherein, C(r) represents the first color, i represents the i-th NeRF model in the N NeRF models, j represents the j-th spatial point in the M spatial points, and k represents the k-th spatial point in the M spatial points. represents the weight of a rendering information of the j-th spatial point output by the i-th NeRF model, Indicates the validity of a rendering information of the j-th spatial point output by the i-th NeRF model, represents the first volume density of the k-th spatial point output by the i-th NeRF model, δ k represents the distance between the kth spatial point and the (k-1)th spatial point, represents the first volume density of the j-th spatial point output by the i-th NeRF model, δ j represents the distance between the j-th spatial point and the (j-1)-th spatial point, Represents the first RGB parameter of the j-th spatial point output by the i-th NeRF model.

[0108] The difference between Formula 12 in this embodiment and Formula 2 above is that validity v is added in Formula 12. Validity includes valid and invalid, with parameters "1" and "0" respectively. When a rendering information of the j-th spatial point output by the i-th NeRF model is valid, That is, the rendering information is retained; when the rendering information of the j-th spatial point output by the i-th NeRF model is invalid, That is, the rendering information is removed.

[0109] In the embodiment of the present application, the above formula is used to screen out invalid rendering information and retain valid rendering information during volume rendering. There is no need to screen the rendering information in advance based on the validity of the rendering information, which is conducive to improving efficiency.

[0110] It is worth mentioning that the formula 12 and the above formula 2 It can be determined by the i-th NeRF model based on the first observation information of the k-th spatial point, or determined based on the second observation information of the k-th spatial point. In the case where the i-th NeRF model is determined based on the second observation information of the k-th spatial point, during the volume rendering process, the perturbation variable in the second observation information is set to 0 (equal to the determination based on the first observation information of the k-th spatial point). and Same reason.

[0111] Alternatively, if Figure 2 As shown, before the observation information of the M spatial points is respectively input into the N neural radiation field NeRF models, the method further includes:

[0112] Unifying the N NeRF model coordinate systems;

[0113] The unifying the N NeRF model coordinate systems comprises:

[0114] Extracting SIFT feature points of each training picture in a first picture set, and extracting SIFT feature points of each training picture in a second picture set, wherein the first picture set is a training picture set of a second NeRF model, the second picture set is a training picture set of a third NeRF model, and shooting areas corresponding to the first picture set and the second picture set overlap;

[0115] When the SIFT feature points of the first picture in the first picture set match the SIFT feature points of the second picture in the second picture set, determining the camera pose of the second picture in the first coordinate system of the second NeRF model according to the target algorithm;

[0116] Determine a first coordinate transformation value according to a camera pose of the second image in the first coordinate system and a predetermined camera pose of the second image in a second coordinate system of a third NeRF model;

[0117] The second coordinate system is updated to a third coordinate system according to the first coordinate transformation value.

[0118] The 3D coordinate systems of different NeRFs are different, and they differ by a similarity transformation (also called coordinate transformation, including rotation, scaling and translation). After training N NeRF models, the embodiment of the present application needs to unify the 3D coordinate systems of the N NeRF models. The embodiment of the present application realizes the coordinate system of N NeRF models by aligning the 3D coordinate systems of the two NeRF models.

[0119] Among them, there must be a direct or indirect common viewing area between the training images of each NeRF model in the above N NeRF models and the training images of other NeRF models. If the shooting areas corresponding to the training image set of the second NeRF model and the training image set of the third NeRF model overlap, it means that there is a direct common viewing area between the training images of the second NeRF model and the training images of the third NeRF model.

[0120] Take the second NeRF model (M i ) training picture data set: the first picture set (D i ), and the third NeRF model (M j ) training image data set: D j . D i In M i The camera pose in the first coordinate system is (The camera pose is predetermined. During the training process, the training image and the camera pose of the training image in the coordinate system of the corresponding NeRF model need to be input. As an example, the camera pose of the training image can be predetermined using the sfm or slam method). j In M j The camera pose in the second coordinate system is P j j .

[0121] Extract D i and D j The SIFT features of each image in D are then matched using SIFT feature points i and D j The pictures in the table are recorded as follows: (i.e. the first picture above, The number of the first picture in is one or more) and (i.e. the second picture above, The number of second pictures in is one or more).

[0122] M i The coordinate system of is the reference coordinate system, and the PnP algorithm is used to calculate The camera pose P of each second image in the first coordinate system j iThe camera pose P of each second image in the first coordinate system j i And the camera pose P of each second picture in the second coordinate system j j There is a three-dimensional similarity transformation Where s is the scale factor, R is the 3x3 rotation matrix, and t is the 3x1 translation vector. j i The camera 3D coordinates in With P j j The camera 3D coordinates in Existence relationship

[0123]

[0124] The first coordinate transformation value S0 can be obtained using the Umeyama algorithm.

[0125] According to the first coordinate transformation value, the second coordinate system is updated to the third coordinate system, thereby achieving coordinate matching between the second NeRF model and the third NeRF model.

[0126] In the embodiment of the present application, by matching the coordinates of N NeRF models, the ghosting problem of NeRF multi-model rendering can be effectively reduced.

[0127] In some embodiments, the second coordinate system can be directly updated to the third coordinate system based only on the first coordinate transformation value; in other embodiments, the first coordinate transformation value can be iteratively updated, and the second coordinate system can be updated to the third coordinate system based on the iteratively updated first coordinate transformation value to make the coordinate matching between the second NeRF model and the third NeRF model more accurate.

[0128] The iterative update is described in detail below.

[0129] Optionally, updating the second coordinate system to a third coordinate system according to the first coordinate transformation value includes:

[0130] Iteratively updating the first coordinate transformation value until a preset condition is met;

[0131] Based on the iteratively updated first coordinate transformation value, updating the second coordinate system to a third coordinate system;

[0132] The iterative updating of the first coordinate transformation value comprises:

[0133] Based on the first coordinate transformation value, convert S first camera poses in the first coordinate system into S second camera poses in the second coordinate system, where the S first camera poses are camera poses of S first images in the first coordinate system, and S is a positive integer;

[0134] Obtaining S third images at the S second camera poses based on the third NeRF model;

[0135] When the SIFT feature points of T first pictures among the S first pictures match the SIFT feature points of T third pictures among the S third pictures, determining a camera pose of each third picture among the T third pictures in the first coordinate system, where T is a positive integer;

[0136] Determine a second coordinate transformation value according to a camera pose of each of the T third images in the first coordinate system and a predetermined camera pose of each of the T third images in the second coordinate system;

[0137] The first coordinate transformation value is updated based on the second coordinate transformation value.

[0138] from Randomly select S (e.g. 5) first picture Its first camera pose in the first coordinate system is P i i , the second camera pose in the second coordinate system is S i -1 P i i (S i Represents the latest coordinate transformation value, which is S0 in an iterative update), and uses the second NeRF model to render S third images under S second camera poses.

[0139] When the SIFT feature points of T first images among the S first images match the SIFT feature points of T third images among the S third images, the camera pose of each third image among the T third images in the first coordinate system is determined, where T is a positive integer (for details, refer to the above embodiment of determining the camera pose of the second image in the first coordinate system).

[0140] Determine a second coordinate transformation value ΔS according to the camera pose of each of the T third images in the first coordinate system and the predetermined camera pose of each of the T third images in the second coordinate system. i

[0141] Based on ΔSi For S i renew:

[0142] S i+1 =ΔS i *S i (14)

[0143] The first coordinate transformation value is updated based on the second coordinate transformation value, that is, the first coordinate transformation value is updated for the first time to: S1 = ΔS0 * S0.

[0144] It is worth mentioning that the first coordinate transformation value in the embodiment of the present application is iteratively updated until the preset condition is met, which can be:

[0145] The number of iterative updates meets the preset conditions, for example, it is satisfied when the number of iterative updates is 50;

[0146] ΔS i The value of satisfies the preset conditions, such as ΔS i The value is close to 1.

[0147] The embodiment of the present application updates the second coordinate system to the third coordinate system based on the iteratively updated first coordinate transformation value, which can further effectively reduce the ghosting problem of NeRF multi-model rendering.

[0148] The present application also provides an image rendering device. Figure 3 , Figure 3 This is a structural diagram of an image rendering device provided in an embodiment of the present application. Figure 3 As shown, the device 200 includes:

[0149] A first acquisition module 201 is used to input first observation information of M spatial points into N neural radiation field NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1;

[0150] A determination module 202, used to determine the weight of each rendering information of each spatial point respectively;

[0151] The rendering module 203 is used to perform volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point, so as to obtain the first colors of the pixels corresponding to the M spatial points.

[0152] Optionally, the determining module 202 is specifically configured to:

[0153] Determine the Euclidean distance between the coordinates of a first spatial point among the M spatial points and the coordinates of the center points corresponding to the N NeRF models;

[0154] According to the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center points corresponding to the N NeRF models, the weights of the N rendering information of the first spatial point are determined, and the weight of each rendering information of the first spatial point is negatively correlated with the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center point of the NeRF model.

[0155] Optionally, the device 200 further includes:

[0156] An acquisition module, used for acquiring the validity of each rendering information of each spatial point, wherein the validity is determined by the NeRF model;

[0157] The rendering module 203 is specifically used for:

[0158] Volume rendering is performed according to the N pieces of rendering information of the M spatial points, the weight of each piece of rendering information of each spatial point, and the validity of each piece of rendering information of each spatial point to obtain the first colors of the pixels corresponding to the M spatial points.

[0159] Optionally, the validity is obtained according to the following steps:

[0160] A first NeRF model among the N NeRF models respectively fuses corresponding disturbance variables in the first observed information of the M spatial points to obtain second observed information of the M spatial points;

[0161] The first NeRF model determines second RGB parameters and second volume density of the M spatial points according to second observed information of the M spatial points, and obtains second colors of pixels corresponding to the M spatial points based on volume rendering;

[0162] The first NeRF model determines the Jacobian matrix corresponding to the M spatial points according to the second color and the disturbance variables corresponding to the M spatial points;

[0163] The first NeRF model determines the Hessian matrix corresponding to the M spatial points according to the Jacobian matrix corresponding to the M spatial points;

[0164] The first NeRF model determines the validity of the rendering information output by the first NeRF model of the M spatial points according to the Hessian matrix corresponding to the M spatial points.

[0165] Optionally, the rendering module 203 is further configured to:

[0166] The first color of the pixel corresponding to the M spatial points is determined according to the following volume rendering formula:

[0167]

[0168] Wherein, C(r) represents the first color, i represents the i-th NeRF model in the N NeRF models, j represents the j-th spatial point in the M spatial points, and k represents the k-th spatial point in the M spatial points. represents the weight of a rendering information of the j-th spatial point output by the i-th NeRF model, Indicates the validity of a rendering information of the j-th spatial point output by the i-th NeRF model, represents the first volume density of the k-th spatial point output by the i-th NeRF model, δ k represents the distance between the kth spatial point and the (k-1)th spatial point, represents the first volume density of the j-th spatial point output by the i-th NeRF model, δ j represents the distance between the j-th spatial point and the (j-1)-th spatial point, Represents the first RGB parameter of the j-th spatial point output by the i-th NeRF model.

[0169] Optionally, the device 200 further includes:

[0170] A coordinate unification module, used for unifying the N NeRF model coordinate systems;

[0171] The coordinate unification module is specifically used for:

[0172] Extracting Scale Invariant Feature Transform (SIFT) feature points of each training picture in a first picture set, and extracting SIFT feature points of each training picture in a second picture set, wherein the first picture set is a training picture set of a second NeRF model, the second picture set is a training picture set of a third NeRF model, and shooting areas corresponding to the first picture set and the second picture set overlap;

[0173] When the SIFT feature points of the first picture in the first picture set match the SIFT feature points of the second picture in the second picture set, determining the camera pose of the second picture in the first coordinate system of the second NeRF model according to the target algorithm;

[0174] Determine a first coordinate transformation value according to a camera pose of the second image in the first coordinate system and a predetermined camera pose of the second image in a second coordinate system of a third NeRF model;

[0175] The second coordinate system is updated to a third coordinate system according to the first coordinate transformation value.

[0176] Optionally, the coordinate unification module is further used for:

[0177] Iteratively updating the first coordinate transformation value until a preset condition is met;

[0178] Based on the iteratively updated first coordinate transformation value, updating the second coordinate system to a third coordinate system;

[0179] The iterative updating of the first coordinate transformation value comprises:

[0180] Based on the first coordinate transformation value, convert S first camera poses in the first coordinate system into S second camera poses in the second coordinate system, where the S first camera poses are camera poses of S first images in the first coordinate system, and S is a positive integer;

[0181] Obtaining S third images at the S second camera poses based on the third NeRF model;

[0182] When the SIFT feature points of T first pictures among the S first pictures match the SIFT feature points of T third pictures among the S third pictures, determining a camera pose of each third picture among the T third pictures in the first coordinate system, where T is a positive integer;

[0183] Determine a second coordinate transformation value according to a camera pose of each of the T third images in the first coordinate system and a predetermined camera pose of each of the T third images in the second coordinate system;

[0184] The first coordinate transformation value is updated based on the second coordinate transformation value.

[0185] It should be noted that the image rendering device of the embodiment of the present application can implement the various processes of the image rendering method embodiment described above and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0186] The present application embodiment also provides an electronic device 300, see Figure 4 , including at least one processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. The computer program is executed by at least one processor 301 to implement the various processes of the above-mentioned image rendering embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0187] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by the processor 301 to implement each process of the above-mentioned image rendering embodiment, and can achieve the same technical effect, to avoid repetition, it is not repeated here. The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0188] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0189] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0190] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An image rendering method, characterized in that: The method comprises: Inputting first observation information of M spatial points into N neural radiation field NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1; Determine the weight of each rendering information of each spatial point respectively; Performing volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point to obtain a first color of a pixel corresponding to the M spatial points; The step of respectively determining the weight of each piece of rendering information of each spatial point includes: Determine the Euclidean distance between the coordinates of a first spatial point among the M spatial points and the coordinates of the center points corresponding to the N NeRF models; According to the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center points corresponding to the N NeRF models, the weights of the N rendering information of the first spatial point are determined, and the weight of each rendering information of the first spatial point is negatively correlated with the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center point of the NeRF model.

2. The method according to claim 1, characterized in that Also includes: Obtaining the validity of each rendering information of each spatial point, wherein the validity is determined by the NeRF model; The step of performing volume rendering according to the N pieces of rendering information of the M spatial points and the weight of each piece of rendering information of each spatial point to obtain a first color of a pixel corresponding to the M spatial points includes: Volume rendering is performed according to the N pieces of rendering information of the M spatial points, the weight of each piece of rendering information of each spatial point, and the validity of each piece of rendering information of each spatial point to obtain the first colors of the pixels corresponding to the M spatial points.

3. The method according to claim 2, characterized in that The effectiveness is obtained according to the following steps: A first NeRF model among the N NeRF models respectively fuses corresponding disturbance variables in the first observed information of the M spatial points to obtain second observed information of the M spatial points; The first NeRF model determines second RGB parameters and second volume density of the M spatial points according to second observed information of the M spatial points, and obtains second colors of pixels corresponding to the M spatial points based on volume rendering; The first NeRF model determines the Jacobian matrix corresponding to the M spatial points according to the second color and the disturbance variables corresponding to the M spatial points; The first NeRF model determines the Hessian matrix corresponding to the M spatial points according to the Jacobian matrix corresponding to the M spatial points; The first NeRF model determines the validity of the rendering information output by the first NeRF model of the M spatial points according to the Hessian matrix corresponding to the M spatial points.

4. The method according to claim 2, characterized in that: The step of performing volume rendering according to the N pieces of rendering information of the M spatial points, the weight of each piece of rendering information of each spatial point, and the validity of each piece of rendering information of each spatial point to obtain a first color of a pixel corresponding to the M spatial points includes: The first color of the pixel corresponding to the M spatial points is determined according to the following volume rendering formula: Wherein, C(r) represents the first color, i represents the i-th NeRF model in the N NeRF models, j represents the j-th spatial point in the M spatial points, and k represents the k-th spatial point in the M spatial points. represents the weight of a rendering information of the j-th spatial point output by the i-th NeRF model, Indicates the validity of a rendering information of the j-th spatial point output by the i-th NeRF model, represents the first volume density of the k-th spatial point output by the i-th NeRF model, δ k represents the distance between the kth spatial point and the (k-1)th spatial point, represents the first volume density of the j-th spatial point output by the i-th NeRF model, δ i represents the distance between the j-th spatial point and the (j-1)-th spatial point, Represents the first RGB parameter of the j-th spatial point output by the i-th NeRF model.

5. The method according to claim 1, characterized in that Before inputting the observation information of the M spatial points into the N neural radiation field NeRF models respectively, the method further includes: Unifying the N NeRF model coordinate systems; The unifying the N NeRF model coordinate systems comprises: Extracting a Scale Invariant Feature Transform (SIFT) feature point of each training picture in a first picture set, and extracting a SIFT feature point of each training picture in a second picture set, wherein the first picture set is a training picture set of a second NeRF model, the second picture set is a training picture set of a third NeRF model, and shooting areas corresponding to the first picture set and the second picture set overlap; When the SIFT feature points of the first picture in the first picture set match the SIFT feature points of the second picture in the second picture set, determining the camera pose of the second picture in the first coordinate system of the second NeRF model according to the target algorithm; Determine a first coordinate transformation value according to a camera pose of the second image in the first coordinate system and a predetermined camera pose of the second image in a second coordinate system of a third NeRF model; The second coordinate system is updated to a third coordinate system according to the first coordinate transformation value.

6. The method according to claim 5, characterized in that The updating the second coordinate system to a third coordinate system according to the first coordinate transformation value includes: Iteratively updating the first coordinate transformation value until a preset condition is met; Based on the iteratively updated first coordinate transformation value, updating the second coordinate system to a third coordinate system; The iterative updating of the first coordinate transformation value comprises: Based on the first coordinate transformation value, convert S first camera poses in the first coordinate system into S second camera poses in the second coordinate system, where the S first camera poses are camera poses of S first images in the first coordinate system, and S is a positive integer; Obtaining S third images at the S second camera poses based on the third NeRF model; When the SIFT feature points of T first pictures among the S first pictures match the SIFT feature points of T third pictures among the S third pictures, determining a camera pose of each third picture among the T third pictures in the first coordinate system, where T is a positive integer; Determine a second coordinate transformation value according to a camera pose of each of the T third images in the first coordinate system and a predetermined camera pose of each of the T third images in the second coordinate system; The first coordinate transformation value is updated based on the second coordinate transformation value.

7. An image rendering device, characterized in that: include: A first acquisition module is used to input first observation information of M spatial points into N neural radiation field NeRF models respectively to obtain N rendering information of the M spatial points, wherein the rendering information includes at least one of a first RGB parameter and a first volume density, and the M spatial points are spatial points located on the same ray in the 3D scene to be rendered, and M and N are integers greater than 1; A determination module, used to determine the weight of each rendering information of each spatial point respectively; A rendering module, configured to perform volume rendering according to the N pieces of rendering information of the M spatial points and a weight of each piece of rendering information of each spatial point, to obtain a first color of a pixel corresponding to the M spatial points; The determination module is specifically used for: Determine the Euclidean distance between the coordinates of a first spatial point among the M spatial points and the coordinates of the center points corresponding to the N NeRF models; According to the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center points corresponding to the N NeRF models, the weights of the N rendering information of the first spatial point are determined, and the weight of each rendering information of the first spatial point is negatively correlated with the Euclidean distance between the coordinates of the first spatial point and the coordinates of the center point of the NeRF model.

8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the image rendering method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image rendering method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the image rendering method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Nerve radiation field-based unbounded scene real-time rendering method, system and equipment

    CN117173315A

  • Implicit stylized new view angle synthesis method

    CN117237501A