Foreground / background separation method and device

Through the gridization of multi-view image sets and neural radiation field model training, the problem of difficult background separation in other parts of the human body in the NeRF model is solved, high-quality prospects and background separation is achieved, and the consistency and accuracy of three-dimensional reconstruction are improved. .

CN118887248APending Publication Date: 2024-11-01SHANGHAI XIYU JIZHI TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411006973.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing neural radiation field (NeRF) model is difficult to effectively separate the changing parts of the human body as background during the three-dimensional reconstruction process, resulting in a decline in the quality of the three-dimensional reconstruction. There are limitations in traditional image background cutting technology and 2D image segmentation technology, especially 3D The background is inconsistent with the 2D segmentation results.

Method used

By acquiring multi-view image sets, grid-based foreground goals, determining the foreground and background position points in three-dimensional space, training the neural radiation field models of the foreground and background respectively, realizing the separation of foreground and background.

Benefits of technology

The images generated by the neural radiation model are quickly and accurately separated foreground and background, improving the quality and consistency of three-dimensional reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887248A_ABST
    Figure CN118887248A_ABST
Patent Text Reader

Abstract

The invention discloses a foreground / background separation method and device. The method comprises the following steps: acquiring an image set; wherein the image set comprises at least two images with different visual angles, and each image comprises corresponding camera parameter information; according to each image in the image set, meshing the foreground target to generate a target grid; determining a target distance between each position point in the three-dimensional space and the target grid according to the target grid; determining a foreground position point and a background position point in the three-dimensional space based on the target distance; training the first neural radiation field model based on the foreground position point to generate a foreground model, and training the second neural radiation model based on the background position point to generate a background model; and completing foreground / background separation based on the foreground model and / or the background model. Through the target distance between each position point and the target grid, the foreground region and the background region of the image generated based on the neural radiation model can be rapidly and accurately separated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a foreground / background separation method and device. Background Art

[0002] At present, implicit 3D reconstruction technology based on Neural Radiance Field (NeRF) has achieved good reconstruction and visualization effects in some small-scale scenes. The input of NeRF is multi-view images and the camera parameters corresponding to the images. The geometry and texture information of the scene are implicitly represented by the multi-layer perceptron (MLP) of the deep neural network, and then the image synthesis from different view directions is performed by volume rendering technology to achieve the purpose of 3D reconstruction.

[0003] When training NeRF, multiple multi-view RGB images are required, and RGB images usually contain background information, such as green screens, camera stands, and other backgrounds. For example, when using the NeRF model to perform 3D modeling of individual parts of the human body, such as 3D hand modeling, other parts of the human body are also considered background information. In related technologies, the image background matting technology solution can only separate the captured static background, and because other parts of the human body usually change during the shooting process, the image background matting technology cannot separate the changing other parts of the human body as the background. The 2D image segmentation technology also has certain limitations in separating the changing background, especially the background separated by the 2D image segmentation technology is not consistent with the 3D background, which reduces the quality of 3D reconstruction based on the NeRF model. Summary of the invention

[0004] The present invention provides a foreground / background separation method and device, which can quickly and accurately separate the foreground area and the background area of ​​an image generated based on a neural radiation model.

[0005] According to one aspect of the present invention, a foreground / background separation method is provided, comprising:

[0006] Acquire an image set; wherein the image set includes at least two images from different perspectives, and each image contains corresponding camera parameter information;

[0007] According to each image in the image set, gridding the foreground object to generate an object grid;

[0008] According to the target grid, determining a target distance between each position point in a three-dimensional space and the target grid, wherein the three-dimensional space is a space containing the target grid;

[0009] Determine a foreground position point and a background position point in the three-dimensional space based on the target distance;

[0010] Training a first neural radiation field model based on the foreground position points to generate a foreground model, and training a second neural radiation model based on the background position points to generate a background model;

[0011] The foreground / background separation is performed based on the foreground model and / or the background model.

[0012] According to another aspect of the present invention, there is provided a foreground / background separation device, comprising:

[0013] An image set acquisition module, used to acquire an image set; wherein the image set includes at least two images from different viewing angles, each image containing corresponding camera parameter information;

[0014] A target grid generation module, used for gridding the foreground target according to each image in the image set to generate a target grid;

[0015] A target distance determination module, used to determine the target distance between each position point in the three-dimensional space and the target grid according to the target grid;

[0016] A position point determination module, used to determine a foreground position point and a background position point in the three-dimensional space based on the target distance;

[0017] A model generation module, used to train the first neural radiation field model based on the foreground position points to generate a foreground model, and to train the second neural radiation model based on the background position points to generate a background model;

[0018] A foreground / background separation module is used to complete the foreground / background separation based on the foreground model and / or the background model.

[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0020] at least one processor; and

[0021] a memory communicatively connected to the at least one processor; wherein,

[0022] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the foreground / background separation method described in any embodiment of the present invention.

[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the foreground / background separation method described in any embodiment of the present invention when executed.

[0024] The foreground / background separation scheme of the embodiment of the present invention obtains an image set; wherein the image set includes at least two images of different perspectives, and each image includes corresponding camera parameter information; based on each image in the image set, the foreground target is gridded to generate a target grid; based on the target grid, the target distance between each position point in the three-dimensional space and the target grid is determined, wherein the three-dimensional space is a space containing the target grid; based on the target distance, the foreground position point and the background position point in the three-dimensional space are determined; based on the foreground position point, a first neural radiation field model is trained to generate a foreground model, and based on the background position point, a second neural radiation model is trained to generate a background model; and the foreground / background separation is completed based on the foreground model and / or the background model. By determining the target distance between each position point in the image and the target grid, the foreground area and the background area of ​​the image generated based on the neural radiation model can be quickly and accurately separated.

[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 is a flow chart of a foreground / background separation method provided according to Embodiment 1 of the present invention;

[0028] Figure 2 It is a schematic diagram of the principle of collecting images in an image set provided by an embodiment of the present invention;

[0029] Figure 3 is a structural schematic diagram of a foreground / background separation device provided according to Embodiment 2 of the present invention;

[0030] Figure 4 It is a structural schematic diagram of an electronic device for implementing the foreground / background separation method of an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] Embodiment 1

[0034] Figure 1 A flowchart of a foreground / background separation method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of performing foreground / background separation on an image. The method can be performed by a foreground / background separation device. The foreground / background separation device can be implemented in the form of hardware and / or software. The foreground / background separation device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0035] S110, obtaining an image set; wherein the image set includes at least two images from different perspectives, and each image contains corresponding camera parameter information.

[0036] In an embodiment of the present invention, at least two images of different perspectives corresponding to the target to be generated can be obtained, and an image set can be formed based on at least two images of different perspectives. Exemplarily, by controlling an image acquisition device to acquire images of the target to be generated at different shooting angles, at least two images of different visuals corresponding to the target to be generated are acquired through the image acquisition device. Among them, the image acquisition device may include various digital cameras, smart phones, portable wearable devices, drones and other devices with optical image information acquisition functions. Among them, each image contains corresponding camera parameter information, and the camera parameter information is the observation position coordinates and observation direction of the image acquisition device. The target to be generated can be a human body, a local area of ​​a human body, other animals, or target objects such as vehicles. It should be noted that the embodiment of the present invention does not limit the target to be generated.

[0037] For example, Figure 2 The following is a schematic diagram of the principle of collecting images in an image set provided by an embodiment of the present invention. Figure 2 As shown in the figure, each image in the image set is taken in a global coordinate system (world coordinate system) with a camera at a fixed position and in a fixed field of view. The coordinates of the camera position can be called the viewpoint, and the RGB of each point in the image is the projection result of the RGB and transparency of each point on a ray with the viewpoint as the origin on the pixel point of the image.

[0038] S120 , gridding the foreground object according to each image in the image set to generate an object grid.

[0039] Among them, the foreground target can be a local area of ​​the subject of the image, for example, the subject of the image is a human body, and the foreground target can be a local area such as the face area and the hand area of ​​the human body. In an embodiment of the present invention, the foreground target of each image in the image set is determined. For example, the foreground target of each image can be determined based on image recognition technology. The foreground targets of at least two images from different perspectives are meshed to generate a target mesh, wherein the target mesh is a mesh map of a 3D topological structure for characterizing the foreground target, and the target mesh can also be called a 3D Mesh. The target mesh can be composed of multiple vertex information and triangle face information, wherein the triangle face is a triangle face composed of 3 vertices, and the vertex information includes the coordinates of each vertex, and the coordinates of each vertex can be expressed as (x, y, z).

[0040] Exemplarily, a parameterized model, such as MANO, is used to generate a target mesh based on image fitting in an image set, wherein the target mesh contains vertex information and connection information constituting the target mesh. The vertex information is to use the viewpoint of each image as the origin and to make rays through the key points in the image. The points where the same key points in different images intersect are the position coordinates of the key points in three-dimensional space, i.e., the vertices of the target mesh. The connection information can be to connect multiple adjacent points according to rules to form a target mesh, or to connect the key points to form a target mesh after identifying the foreground target according to image recognition technology.

[0041] Optionally, the foreground target is gridded according to each image in the image set to generate a target grid, including: determining multiple key points of the foreground target in each image; fitting and generating the target grid of the foreground target in a three-dimensional space according to the key points of each image. In an embodiment of the present invention, multiple key points of the foreground target in each image of at least two images with different viewing angles are determined, wherein the key points may be feature points of the foreground target, for example, if the foreground target is a human face area, the key points may be facial features, such as mouth, left eye, nose, right eye, ear, eyebrow and other feature points; for example, if the foreground target is a human hand area, the key points may be feature points of the fingertips, knuckles, palms and other feature points of each finger. Optionally, multiple key points of the foreground target in each image may be determined by feature point recognition technology. According to the key points of each image, a target grid of the foreground target in a three-dimensional space is fitted and generated. Exemplarily, the key points of each image may be input into a pre-constructed neural network model, and the target grid of the foreground target in the three-dimensional space may be generated by the neural network model. Optionally, the target mesh is a triangle mesh.

[0042] S130. Determine a target distance between each position point in a three-dimensional space and the target grid according to the target grid, wherein the three-dimensional space is a space including the target grid.

[0043] In an embodiment of the present invention, a three-dimensional space containing a target grid is determined, wherein the three-dimensional space is a space of a global coordinate system (world coordinate system), which is a space of the real world that has been defined when the images in the image set are captured. For example, the spatial region where the model is defined when the image is captured is a cubic meter space with the origin as the vertex, and there are 8 cameras, which are distributed at 8 vertices. The camera coordinates are (0,0,0), (1,0,0), (0,1,0), (0,0,1), (1,1,0), (1,0,1), (0,1,1), (1,1,1), and the viewing directions all point to the center of the cube, that is, any point in the three-dimensional model, camera, or space outside the camera is a point that can be defined by the global coordinate system of the three-dimensional space. For each position point in the three-dimensional space, the target distance between the position point and the target grid is determined.

[0044] Optionally, determining the target distance between each position point in the three-dimensional space and the target grid according to the target grid includes: for the position point in the three-dimensional space, determining the target distance between the position point and the target grid based on a preset distance function; wherein the preset distance function includes a signed distance function or an unsigned distance function. Wherein, the target distance between the position point and the target grid can be understood as the distance from the point to the surface. In an embodiment of the present invention, the target distance between the position point and the target grid can be calculated based on a signed distance function (Signed Distance Function, SDF), wherein SDF uses positive and negative to distinguish whether the position point is located inside or outside the corresponding surface of the target grid. When the position point is located inside the corresponding surface of the target grid, the distance is set to a negative value. When the position point is located outside the corresponding surface of the target grid, the distance is set to a positive value. When the position point is located on the corresponding surface of the target grid, the distance is set to 0. Optionally, the target distance between the position point and the target grid can also be calculated based on an unsigned distance function (UDF), wherein the UDF does not distinguish whether the position point is located inside or outside the corresponding surface of the target grid, that is, when the position point is located inside or outside the corresponding surface of the target grid, the distance is a positive value, and when the position point is located on the corresponding surface of the target grid, the distance is set to 0.

[0045] Optionally, determining the target distance between each position point in the three-dimensional space and the target grid includes: for the position point in the three-dimensional space, calculating the first distance between the position point and several grid surfaces corresponding to the target grid, and taking the minimum distance among the first distances as the target distance between the position point and the target grid. In an embodiment of the present invention, the target grid contains multiple grid surfaces, and at least two grid surfaces can be randomly selected from the multiple grid surfaces corresponding to the target grid, and for the position point in the three-dimensional space, the first distance between the position point and the at least two selected grid surfaces is determined respectively. The minimum distance among the at least two first distances is taken as the target distance between the position point and the target grid. Among them, the first distance between the position point and each selected grid surface can be determined based on a signed distance function or an unsigned distance function, and the distance from the position point to the center point of the selected grid surface can also be taken as the first distance between the position point and the selected grid surface.

[0046] Optionally, determining the target distance between each position point in the three-dimensional space and the target mesh includes: for the position point in the three-dimensional space, calculating the second distance between the position point and several mesh vertices or mesh edges in the target mesh, and taking the minimum distance in the second distance as the target distance between the position point and the target mesh, or taking the average of the distances of the plurality of distances in the second distance as the target distance between the position point and the target mesh. In an embodiment of the present invention, the target mesh includes a plurality of mesh vertices and a plurality of mesh edges, and at least two mesh vertices can be randomly selected from the plurality of mesh vertices included in the target mesh, and for the position point in the three-dimensional space, the second distance between the position point and each selected mesh vertex is calculated; or at least two mesh edges can be randomly selected from the plurality of mesh edges included in the target mesh, and for the position point in the three-dimensional space, the second distance between the position point and each selected mesh edge is calculated. The minimum distance in the second distance between the position point and the at least two selected mesh vertices or mesh edges is taken as the target distance between the position point and the target mesh. Optionally, the average of the second distances between the position point and all selected mesh vertices or all selected mesh edges can be calculated, and the average distance can be used as the target distance between the position point and the target mesh. Optionally, multiple second distances can be selected from the second distances between the position point and all selected mesh vertices or all selected mesh edges, and the average of the selected multiple second distances can be used as the target distance between the position point and the target mesh.

[0047] S140: Determine a foreground position point and a background position point in the three-dimensional space based on the target distance.

[0048] In an embodiment of the present invention, the position points in the three-dimensional space are traversed, and according to the target distance corresponding to the position point, it is determined whether the position point belongs to the foreground position point or the background position point. Optionally, the foreground position point and the background position point in the three-dimensional space are determined based on the target distance, including: for the position point in the three-dimensional space, it is determined whether the target distance corresponding to the position point is less than or equal to a preset distance threshold; if the target distance is less than or equal to the preset distance threshold, the position point is used as a foreground position point; if the target distance is greater than the preset distance threshold, the position point is used as a background position point. Exemplarily, for the position point in the three-dimensional space, it is determined whether the target distance corresponding to the position point is less than or equal to the preset distance threshold, if so, the position point is used as a foreground position point, otherwise, the position point is used as a background position point. In the above manner, the foreground position point and the background position point in the three-dimensional space can be determined.

[0049] It is understandable that after determining the spatial position of each point, line and plane of the target grid, the points in the three-dimensional space can be classified according to the target distance. Among them, the boundary of the point in the three-dimensional space can be set artificially, such as a spatial position point of 1 cubic meter, or the boundary of the point in the three-dimensional space can be determined according to the area where the visual field of different perspective images overlaps, such as a spatial position point of 500 cubic decimeters. Because only the overlap of different perspectives can determine the third coordinate in the space, only one picture can determine one ray, and the two coordinates on the ray are fixed in proportion. Only when another ray intersects can the specific position of a point in space be determined. For example, the spatial area where the target grid is located determined by S120 is the area where 1 cubic decimeter of the center point is located, and the target distance threshold is 1 cm, then the space composed of the foreground position points is 1.331 cubic decimeters of space. The points at the remaining spatial positions belong to the background space.

[0050] S150. Training the first neural radiation field model based on the foreground position points to generate a foreground model, and training the second neural radiation model based on the background position points to generate a background model.

[0051] Among them, the Neural radiance field (NeRF) model is a three-dimensional reconstruction model for generating high-quality images. The input of the NeRF model is the three-dimensional coordinate information and observation angle of the three-dimensional space point, and the output of the NeRF model is the RGB information of the three-dimensional space point and a parameter related to transparency. Then, by projecting the output three-dimensional signal onto a 2D plane at a certain angle, a high-quality three-dimensional reconstructed image is generated. In an embodiment of the present invention, two NeRF models are defined, namely a first NeRF model and a second NeRF model. The first NeRF model is trained based on the foreground position points in the image set to generate a foreground model, and the second NeRF model is trained based on the background position points in the image set to generate a background model. Among them, the foreground model is a three-dimensional reconstruction model for generating a foreground target image, and the background model is a three-dimensional reconstruction model for generating a background target image other than the foreground target. Optionally, the foreground model has a higher accuracy than the background model.

[0052] It should be emphasized that the NeRF model is essentially a function, which is related to the spatial position (x, y, z), viewing direction, color information (RGB) and volume density information (transparency). The first two (spatial position (x, y, z) and viewing direction) are input quantities, and the latter two (color information and volume density information) are output quantities. The process of model training is to sample points in the image, fit the model by determining the coordinates, viewing direction, RGB and transparency of the sampling points, and then calculate the loss value of the model through the loss function, and modify the model based on the loss value, and then sample again, and repeat the above process until the desired training model is achieved, for example, the loss value is within an acceptable range. The completion of model training indicates the completion of three-dimensional modeling. The foreground-background separation training model means that when training the foreground model, there is no need to fit the background position points outside the foreground space, such as other parts of the human arm, etc., which reduces the amount of training and improves the fitting accuracy.

[0053] S160: Complete the foreground / background separation based on the foreground model and / or the background model.

[0054] Optionally, the foreground / background separation is completed based on the foreground model and / or the background model, including: if the inference target is the foreground target, then the foreground target image is generated by rendering based on each position point in the three-dimensional space and the foreground model; and the transparency parameter of the background target other than the foreground target in the foreground target image is set to 0 to complete the foreground / background separation. In an embodiment of the present invention, it is determined whether the inference target is a foreground target or a background target. If it is determined that the inference target is only a foreground target, then the image reconstruction is performed on each position point in the three-dimensional space based on the foreground model, and the foreground target image is generated by rendering. Then, the transparency parameter of the background target other than the foreground target in the foreground target image is set to 0, thereby completing the foreground / background separation in the foreground target image. If it is determined that the inference target is only a background target (that is, the inference target is not a foreground target), then the image reconstruction is performed on each position point in the three-dimensional space based on the background model, and the background target image is generated by rendering. Then, the transparency parameter of the foreground target other than the background target in the background target image is set to 0, thereby completing the foreground / background separation in the foreground target image. If the inference target is determined to be a foreground target and a background target, for example, when the inference target is to highlight the foreground and blur the background, each position point in the three-dimensional space is input into the foreground model and the background model respectively, and the image of each position point in the three-dimensional space is reconstructed based on the foreground model, and the foreground target image is generated by rendering, and the image of each position point in the three-dimensional space is reconstructed based on the background model, and the background target image is generated by rendering. Then, the foreground target image and the background target image are fused to generate a final target image, wherein the transparency parameter of the background target image in the final target image is lower than the transparency parameter of the foreground target image, thereby completing the foreground / background separation.

[0055] The foreground / background separation method of the embodiment of the present invention obtains an image set; wherein the image set includes at least two images of different perspectives, and each image includes corresponding camera parameter information; according to each image in the image set, the foreground target is gridded to generate a target grid; according to the target grid, the target distance between each position point in the three-dimensional space and the target grid is determined, wherein the three-dimensional space is a space containing the target grid; based on the target distance, the foreground position point and the background position point in the three-dimensional space are determined; based on the foreground position point, a first neural radiation field model is trained to generate a foreground model, and based on the background position point, a second neural radiation model is trained to generate a background model; the foreground / background separation is completed based on the foreground model and / or the background model. By determining the target distance between each position point in the image and the target grid, the foreground area and the background area of ​​the image generated based on the neural radiation model can be quickly and accurately separated.

[0056] Embodiment 2

[0057] Figure 3 This is a schematic diagram of the structure of a foreground / background separation device provided in Embodiment 2 of the present invention. Figure 3 As shown, the device comprises:

[0058] The image set acquisition module 310 is used to acquire an image set; wherein the image set includes at least two images from different perspectives, and each image contains corresponding camera parameter information;

[0059] The target grid generation module 320 is used to grid the foreground target according to each image in the image set to generate a target grid;

[0060] A target distance determination module 330 is used to determine the target distance between each position point in the three-dimensional space and the target grid according to the target grid, wherein the three-dimensional space is a space containing the target grid;

[0061] A position point determination module 340, configured to determine a foreground position point and a background position point in the three-dimensional space based on the target distance;

[0062] A model generation module 350, configured to train a first neural radiation field model based on the foreground position points to generate a foreground model, and to train a second neural radiation model based on the background position points to generate a background model;

[0063] The foreground / background separation module 360 ​​is used to complete the foreground / background separation based on the foreground model and / or the background model.

[0064] Optionally, the target grid generation module is used to:

[0065] determining a plurality of key points of the foreground object in each image;

[0066] According to the key points of each image, the target grid of the foreground target in a three-dimensional space is fitted and generated.

[0067] Optionally, the target mesh is a triangular mesh.

[0068] Optionally, the target distance determination module is used to:

[0069] For a position point in the three-dimensional space, a target distance between the position point and the target grid is determined based on a preset distance function; wherein the preset distance function includes a signed distance function or an unsigned distance function.

[0070] Optionally, the target distance determination module is used to:

[0071] For a position point in the three-dimensional space, first distances between the position point and a plurality of mesh surfaces corresponding to the target mesh are calculated, and a minimum distance among the first distances is used as a target distance between the position point and the target mesh.

[0072] Optionally, the target distance determination module is used to:

[0073] For a position point in the three-dimensional space, a second distance from the position point to several mesh vertices or mesh edges in the target mesh is calculated, and the minimum distance among the second distances is used as the target distance between the position point and the target mesh, or an average of multiple distances in the second distances is used as the target distance between the position point and the target mesh.

[0074] Optionally, the location point determination module is used to:

[0075] For a position point in the three-dimensional space, determining whether the target distance corresponding to the position point is less than or equal to a preset distance threshold;

[0076] If the target distance is less than or equal to the preset distance threshold, the position point is used as a foreground position point;

[0077] If the target distance is greater than the preset distance threshold, the position point is used as a background position point.

[0078] Optionally, the foreground / background separation module is used to:

[0079] If the inference target is the foreground target, then

[0080] Generate the foreground target image based on each position point in the three-dimensional space and the foreground model rendering;

[0081] The transparency parameters of the background objects other than the foreground object in the foreground object image are set to 0, thereby completing the foreground / background separation.

[0082] Optionally, the foreground model has higher accuracy than the background model.

[0083] The foreground / background separation device provided in the embodiment of the present invention can execute the foreground / background separation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0084] Embodiment 3

[0085] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0086] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0087] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, such as the foreground / background separation method.

[0089] In some embodiments, the foreground / background separation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the foreground / background separation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the foreground / background separation method in any other appropriate manner (e.g., by means of firmware).

[0090] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0092] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0093] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0094] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0095] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0096] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0097] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A foreground / background separation method, characterized in that: include: Acquire an image set; wherein the image set includes at least two images from different perspectives, and each image contains corresponding camera parameter information; According to each image in the image set, gridding the foreground object to generate an object grid; According to the target grid, determining a target distance between each position point in a three-dimensional space and the target grid, wherein the three-dimensional space is a space containing the target grid; Determine a foreground position point and a background position point in the three-dimensional space based on the target distance; Training a first neural radiation field model based on the foreground position points to generate a foreground model, and training a second neural radiation model based on the background position points to generate a background model; The foreground / background separation is performed based on the foreground model and / or the background model.

2. The method according to claim 1, characterized in that The step of gridding the foreground object according to each image in the image set to generate an object grid comprises: determining a plurality of key points of the foreground object in each image; According to the key points of each image, the target grid of the foreground target in a three-dimensional space is fitted and generated.

3. The method according to claim 2, characterized in that The target mesh is a triangular mesh.

4. The method according to claim 1, characterized in that: Determining the target distance between each position point in the three-dimensional space and the target grid according to the target grid includes: For a position point in the three-dimensional space, a target distance between the position point and the target grid is determined based on a preset distance function; wherein the preset distance function includes a signed distance function or an unsigned distance function.

5. The method according to claim 1, characterized in that Determining a target distance between each position point in the three-dimensional space and the target grid includes: For a position point in the three-dimensional space, first distances between the position point and a plurality of mesh surfaces corresponding to the target mesh are calculated, and a minimum distance among the first distances is used as a target distance between the position point and the target mesh.

6. The method according to claim 1, characterized in that Determining a target distance between each position point in the three-dimensional space and the target grid includes: For a position point in the three-dimensional space, a second distance from the position point to several mesh vertices or mesh edges in the target mesh is calculated, and the minimum distance among the second distances is used as the target distance between the position point and the target mesh, or an average of multiple distances in the second distances is used as the target distance between the position point and the target mesh.

7. The method according to claim 1, characterized in that Determining a foreground position point and a background position point in the three-dimensional space based on the target distance includes: For a position point in the three-dimensional space, determining whether the target distance corresponding to the position point is less than or equal to a preset distance threshold; If the target distance is less than or equal to the preset distance threshold, the position point is used as a foreground position point; If the target distance is greater than the preset distance threshold, the position point is used as a background position point.

8. The method according to claim 1, characterized in that The foreground / background separation is completed based on the foreground model and / or the background model, comprising: If the inference target is the foreground target, then Generate the foreground target image based on each position point in the three-dimensional space and the foreground model rendering; The transparency parameters of the background objects other than the foreground object in the foreground object image are set to 0, thereby completing the foreground / background separation.

9. The method according to claim 1, characterized in that: The foreground model has higher accuracy than the background model.

10. A foreground / background separation device, characterized in that: include: An image set acquisition module, used to acquire an image set; wherein the image set includes at least two images from different viewing angles, each image containing corresponding camera parameter information; A target grid generation module, used for gridding the foreground target according to each image in the image set to generate a target grid; A target distance determination module, used to determine the target distance between each position point in the three-dimensional space and the target grid according to the target grid, wherein the three-dimensional space is a space containing the target grid; A position point determination module, used to determine a foreground position point and a background position point in the three-dimensional space based on the target distance; A model generation module, used to train the first neural radiation field model based on the foreground position points to generate a foreground model, and to train the second neural radiation model based on the background position points to generate a background model; A foreground / background separation module is used to complete the foreground / background separation based on the foreground model and / or the background model.

Citation Information

Patent Citations

  • Lung CT image adhesion blood vascular nodule detection method

    CN104616307A

  • An eyeball region segmentation method in an ultrasonic image

    CN109948575A

  • Mechanical arm and three-dimensional reconstruction method and device thereof

    CN111540045A

  • Target object attitude detection method and device, equipment and storage medium

    CN113689503A

  • Image processing method and device based on neural radiation field

    CN114972632A