Instance based RGBA decomposition of natural monocular images

The image processing apparatus addresses the challenge of decomposing natural images into multiple layers by using instance ordering and iterative inpainting, enabling flexible and accurate manipulation of images without requiring additional inputs.

WO2025059829A1PCT designated stage expired Publication Date: 2025-03-27HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/119554
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

Existing image processing techniques struggle with precise controllability of local image attributes and fail to effectively decompose natural images into multiple layers without requiring additional inputs, leading to limitations in editing and inpainting.

Method used

An image processing apparatus that decomposes a natural RGB image into two or more layers, with each instance present in a separate layer, using instance ordering and iterative inpainting with generative models, without requiring further inputs.

Benefits of technology

Enables flexible and accurate decomposition of natural images into RGBA layers, allowing for easy manipulation and reconstruction of images, while avoiding the need for additional input data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023119554_27032025_PF_FP_ABST
    Figure CN2023119554_27032025_PF_FP_ABST
Patent Text Reader

Abstract

An image processing apparatus, the apparatus comprising one or more processors configured to: receive an input image; determine one or more instance within the input image; decompose the input image into two or more layers by iteratively extracting each instance from the input image based on instance ordering of the one or more instance within the input image; reconstruct a first layer of the two or more layers, based on the instance ordering, by inpainting the first layer using a mask based on the one or more instance comprised in the input image; reconstruct the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask and one or more preceding reconstructed layer from the previous iteration.
Need to check novelty before this filing date? Find Prior Art

Description

INSTANCE BASED RGBA DECOMPOSITION OF NATURAL MONOCULAR IMAGESFIELD OF THE INVENTION

[0001] This invention relates to an image processing apparatus configured to implement instance decomposition by taking as input a single RGB image, and outputting a multi-instance decomposition into a stack of RGBA layers. In addition, this disclosure also relates to a method of doing the same.BACKGROUND

[0002] Large scale generative diffusion models now enable generation of high-quality images from text prompt descriptions. These models are typically trained on a large dataset of captioned RGB images encompassing multiple styles and contents. While they have pushed the field of controllable image generation forward tremendously, precise controllability of local image attributes (e.g., via image editing) remains subpar. Prompt driven editing can lead to unwanted morphological changes to appear outside of the targeted area, and prompt instructions can often fail (e.g., counting errors, wrong spatial position, bleeding concepts, failure to remove / add instances) . The most popular solution currently involves hand drawn segmentations of instances of interest, which affords precise editing and avoids concept bleeding, yet can often struggle to remove or move instances across an image.

[0003] A natural way to address these issues and increase controllability, is to take advantage of the compositional nature of natural images. More specifically, by decomposing any image into a stack of background image and foreground instances, one is able to move, replace, and remove specific items in an image very easily with standard editing interfaces. There are four main fields where techniques related to this task are explored, image matting, saliency segmentation, image inpainting and amodal completion.

[0004] Image matting refers to extracting precise alpha matte from natural images, and it plays a critical role in various downstream applications, such as image editing. The alpha matte is a non-binary 0-1 valued single channel image that indicates the transparency level of a foreground object (with 1 fully opaque and 0 fully transparent) . Combining a foreground object with associated alpha matte with a background image is called Alpha blending. The current state-of-the-art uses image matting techniques such as ViTMatte (Improving Latent Diffusion Models for High-Resolution Image Synthesis. arXiv preprint arXiv: 2307.01952) which was shown to work on well on real and synthetic datasets. Image matting is usually applied to a single instance of interest to be extracted from an image and blended onto another background. On the other hand, saliency segmentation identifies all important regions in the scene containing the salient object (s) (i.e., elements in an image that ‘stand out’ as foreground) as seen in Liu, T. et al. 2010. Learning to detect a salient object. IEEE Transactions on Pattern analysis and machine intelligence, 33 (2) , pp. 353-367.

[0005] Both prior techniques allow for segmentation and extraction of instances of interest in an image, but do not take into account regions that were occluded in the image. This results in missing information in extracted areas. Image inpainting aims to impute the missing region by using generative modelling and can address this issue. Current advances in text to image modelling have pushed what is possible to new heights both in terms of synthesizing new images as well as inpainting local regions. However, inpainting requires estimation of a mask describing the area to inpaint, i.e., automatically estimating the real object structure behind occluded area. This challenging task, commonly referred to as amodal completion, has been heavily researched as well. However, research has been limited to a few highly specialized datasets such as indoor scenes, humans, and other objects. Some of these datasets are purely synthetic which limits generalization and real-life applicability, while real datasets have a low cardinality thus limited to a few settings.

[0006] One natural extension of some of these approaches is to leverage additional inputs beyond a single RGB image, such as stereo images or temporal video frames. In some cases, a movie is decomposed on multiple layers where each layer holds a different instance and its effects on the scene. In order to inpaint the occluded areas information from different frames is used, thus requiring extra information. Furthermore, such models usually require domain specific priors. Alternative methods could be searching for frames where the occluded region is un-occluded in order to inpaint said region at each timeframe. Both methods require the increased cost of additional required inputs. Video data substantially facilitate the decomposition tasks, as video frames can provide missing occluded information.

[0007] All the aforementioned techniques only partially address the multi-instance decomposition objective of this disclosure, and they suffer from reliance on additional inputs, and the models are trained on specialized or small datasets, which creates domain gaps and limits applicability to real life scenarios.

[0008] One approach to counter some of the above issues is that in which RGB images are decomposed into a background and a foreground image with associated alpha matte segmentation, obtained via saliency segmentation. The background image is completed using prompt-free inpainting, using binarized alpha matte segmentation as an inpainting mask. The two layers are recombined using alpha blending. This strategy has been used to build a training dataset, then train a model to generate background, foreground and alpha segmentation. The main limitation of this, is its limitation to a two-layer decomposition requiring all instances to be extracted in the same foreground layer which strongly lacks the required flexibility of instance wise decomposition and thus does not consider the depths of instances.

[0009] It is therefore an object of this disclosure to solve this image decomposition task by decomposing a natural RGB image into two or more layers, where each instance is present in a separate layer and without requiring further inputs and based on instance ordering.SUMMARY

[0010] According to the present disclosure there is provided an image processing apparatus, the apparatus comprising one or more processors configured to: receive an input image; determine one or more instance within the input image; decompose the input image into two or more layers by iteratively extracting each instance from the input image based on instance ordering of the one or more instance within the input image; reconstruct a first layer of the two or more layers, based on the instance ordering, by inpainting the first layer using a mask based on the one or more instance comprised in the input image; reconstruct the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask and one or more preceding reconstructed layer from the previous iteration. This provides the advantage of being able to decompose a natural image in a flexible manner without requiring further informational input when achieving instance-based decomposition.

[0011] The image processing apparatus above, wherein the reconstruction of the one or more instance in each subsequent layer comprises iteratively: combining the extracted instance with the one or more preceding reconstructed layer and the first layer, creating the further mask based on the instance ordering of the one or more instance and one or more occluding instance comprised in the two or more layers other than the preceding one or more reconstructed layer, inpainting the extracted instance, in dependence on the further mask and the preceding one or more reconstructed layer, using a generative model to form a composite image, and extract the inpainted instance from the composite image to form a reconstructed layer. This provides the advantage of utilising a different mask to reconstruct the instances than that used to reconstruct the first layer and inpaint each of the layers based on previously iterated instance layers.

[0012] The image processing apparatus above, wherein the one or more processors are further configured to: determine alpha layers for each reconstructed layer and the first layer based on the further mask for each of the one or more instance; and reassemble the input image by stacking the one or more reconstructed layers and the first layer based on the instance ordering and the  determined alpha layers. This provides the advantage of allowing the decomposed two or more layers to be re-assembled in a manner that faithful represents the input image due to providing a weighting to at least a portion of each of the two or more layers.

[0013] The image processing apparatus above, wherein the instance ordering performed by the one or more processes comprises: performing a depth estimation for each input image, and inferring a depth of each of the determined one or more instance within the input image. This provides the advantage of allowing the instances within an input image to be decomposed and ordered based on their depth within the image thus providing a means for decomposing the two or more layers in a depth ordered manner.

[0014] The image processing apparatus above, wherein the instance ordering performed by the one or more processes further comprises: determining whether the one or more instance in the input image is occluded by one or more of the other instance within the input image; determining mutual instance occlusion, in which an instance in the input image both occludes and is occluded by a further instance in the input image; ordering the one or more instance in the input image based on a relative mean depth value; and correcting the order of one or more instances based on determined occlusion of each instance. This provides the advantage that the order of the two or more layers can be refined based on occlusions as well as mutual occlusions and thus fine-tuned to decompose complex input images.

[0015] The image processing apparatus above, wherein the mask is comprised of a composite segmentation of all of the one or more instance within the input image. This provides the advantage of allowing for the consideration of all other instances occluding the background layer when inpainting the background (first layer) .

[0016] The image processing apparatus above, wherein the further mask is comprised of a composite segmentation of all of the one or more instance within the input image that are determined to occlude the instance of that iteration. This provides the advantage of allowing only a selection of the instances from layers yet to be iterated and / or layers that occlude the present instance layer to be considered during the inpainting of the current instance layer in the present iteration.

[0017] The image processing apparatus above, wherein the one or more processors are further configured to reassemble the input image by alpha blending based on instance ordering and occlusion of the instances in each layer. This provides the advantage of producing a faithful representation of the input image based on the decomposed two or more layers that have been ordered.

[0018] The image processing apparatus above, wherein each of the one or more instance is determined using an object detector. This provides the advantage that each of the instances comprised within an input image that is input to the apparatus can be detected and segmented without the need for user / manual input.

[0019] The image processing apparatus above, wherein the one or more processors are further configured to use a segmentation model to perform the iterative extraction of each of the one or more instances present within the input image in turn. This provides the advantage that the instances that will form the instance layers of the decomposed image can be reliably extracted from the input image.

[0020] According to a further aspect of this disclosure there is provided a method of image processing, the method comprising: receiving an input image; determining one or more instance within the input image; decomposing the input image into two or more layers by iteratively extracting each instance from the one or more determined instance based on instance ordering of the one or more instance within the input image; reconstructing a first layer of the two or more layers, based on the instance ordering, by inpainting the first layer using a mask based on the one or more instance comprised in the input image; and reconstructing the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask and one or more preceding reconstructed layer from the previous iteration. This  provides the advantage of being able to decompose a natural image in a flexible manner without requiring further informational input when achieving instance-based decomposition.

[0021] The method of image processing above, wherein the reconstruction of the one or more instance in each subsequent layer comprises iteratively: combining the extracted instance with the one or more preceding reconstructed layer and the first layer, creating the further mask based the instance ordering of the one or more instance and one or more occluding instance comprised in the two or more layers other than the preceding one or more reconstructed layer, inpainting the extracted instance, in dependence on the further mask and the preceding one or more reconstructed layer, using a generative model to form a composite image, and extract the inpainted instance from the composite image to form a reconstructed layer. This provides the advantage of utilising a different mask to reconstruct the instances than that used to reconstruct the first layer and inpaint each of the layers based on previously iterated instance layers.

[0022] The method of image processing above, wherein the method further comprises: determining alpha layers for each reconstructed layer and the first layer based on the further mask for each of the one or more instance; and reassembling the input image by stacking the one or more reconstructed layers and the first layer based on the instance ordering and the determined alpha layers. This provides the advantage of allowing the decomposed two or more layers to be re-assembled in a manner that faithfully represents the input image due to providing a weighting to at least a portion of each of the two or more layers.

[0023] The method of image processing above, wherein the instance ordering comprises: performing a depth estimation for each input image, and inferring a depth of each of the determined one or more instance within the input image. This provides the advantage of allowing the instances within an input image to be segmented and ordered based on their depth within the image thus providing a means for decomposing the two or more layers in a depth ordered manner.

[0024] The method of image processing above, wherein the instance ordering is performed by: determining whether the one or more instance in the input image is occluded by one or more of the other instances within the input image; determining mutual instance occlusion, in which an instance in the input image both occludes and is occluded by a further instance in the input image; ordering the one or more instance in the input image based on a relative mean depth value; and correcting the order of one or more instances based on determined occlusion of each instance. This provides the advantage that the order of the two or more layers can be refined based on mutual occlusions and thus fine-tuned to decompose complex input images.

[0025] The method of image processing above, wherein the mask is comprised of a composite segmentation of all of the one or more instance within the input image. This provides the advantage of allowing for the consideration of all other instances occluding the background layer when inpainting the background (first layer) .

[0026] The method of image processing above, wherein the further mask is comprised of a composite segmentation of all of the one or more instance within the input image that are determined to occlude the instance of that iteration. This provides the advantage of allowing only a selection of the instances from layers yet to be iterated and / or layers that occlude the present instance layer to be considered during the inpainting of the current instance layer in the present iteration.

[0027] The method of image processing above, further comprising reassembling the input image by alpha blending based on instance ordering and occlusion of the instances in each layer. This provides the advantage of producing a faithful representation of the input image based on the decomposed two or more layers that have been ordered.

[0028] The method of image processing above, wherein each of the one or more instance is determined using an object detector. This provides the advantage that each of the instances comprised within an input image that is input to the apparatus can be detected and segmented without the need for user / manual input.

[0029] The method of image processing above, further comprising performing the iterative extraction of each of the one or more instances present within the input image in turn using a segmentation model. This provides the advantage that the instances that will form the instance layers of the decomposed image can be reliably extracted from the input image.

[0030] BRIEF DESCRIPTION OF THE FIGURES

[0031] The embodiments of the present disclosure will now be described by way of example with reference to the accompanying drawings. In the drawings:

[0032] Figure 1 illustrates an expanded view of the layers of a decomposed RBG image, the layers being comprised of a background layer and a series of instance layers;

[0033] Figure 2 illustrates an example overview of the functions performed by the image processing apparatus and method of the present disclosure;

[0034] Figure 3a illustrates a portion of the example of the image decomposition shown in figure 2 that is performed by the image processing apparatus and method of the present disclosure;

[0035] Figure 3b illustrates an example of the instance ordering functions performed as part of Figure 7 by the image processing apparatus and method of the present disclosure;

[0036] Figure 4 illustrates an Algorithm that describes the instance ordering procedure of this disclosure;

[0037] Figure 5 illustrates an example of the inpainting procedure of the two or more layers provided by this disclosure;

[0038] Figure 6 illustrates the impact of adjusting the alpha layer in consideration of occlusions;

[0039] Figure 7 illustrates a detailed example of the overview of the functions performed by the image processing apparatus and method of the present disclosure.DETAILED DESCRIPTION OF THE INVENTION

[0040] The embodiments of the present disclosure will now be described in detail in relation to the Figures.

[0041] The embodiments of this disclosure solve the image decomposition task. More formally, the technical problem to solve in this invention is the following: given a common natural RGB image, how to decompose an image into distinct layers 102 and reconstruct the occluded areas in layers 102 of the input image. The input image may be an RGB image.

[0042] Towards that end the following key challenges have been identified:

[0043] · Instance discovery and their ordering: this task requires identifying instances of interest in an image, segmenting them, and determining an accurate layer ordering.

[0044] · Reconstructing occluded instances and backgrounds as most instances in an image will be occluded by other elements. Reconstructing occluded areas is important for achieving accurate RGBA decomposition.

[0045] · Accurate image reconstruction: in order to faithfully reconstruct the original image upon flattening layers, it is beneficial to create accurate opacity maps (alpha layers) for each RGBA image. These alpha layers take into account instance ordering, as well as mutual occlusions.

[0046] A central idea in this disclosure relates to providing an image processing apparatus for automatically decomposing an image such that the image is represented as a stack of RGBA layers comprised of the background and each instance that are isolated on their own as RGBA layers. Such a decomposition can be seen in Figure 1. The present disclosure also relates to flattening the RGBA stack results in order to produce a faithful reconstruction of the initial image.

[0047] Figure 1 of the present disclosure illustrates an exploded view of an image that has been decomposed into a plurality of layers, each layer being either the background layer 101 or a layer that contains one or more instance, preferably one instance. In this disclosure an instance is a portion of an image (input image 100) that is desirable to separate from other objects within the image. Figure 1 demonstrates the final state of image decomposition that the apparatus and method of this disclosure achieve. As can be seen in Figure 1, the background layer 101 is distinct from the instance layers 102 and is considered the first layer 101 as it sits at the bottom of the stack. When the stack of RGBA layers comprised of the background and instance layers 102 are stacked and combined together they are intended to faithfully reconstruct 202 the original image that is input into the apparatus.

[0048] The present disclosure and in particular the apparatus and method are capable of decomposing a single RGB image into an instance-wise stack comprising a number of RGB-Aimage layers where the A (or Alpha) layer describes the transparency of each RGB instance layer 102. As illustrated in Figure 1 each layer comprises either a background image, or an instance with zero transparency in non-instance areas. In other words, the instance layers 102 may be transparent in areas that do not contain the instance, e.g., areas surrounding the instance. Flattening the stack of layers should yield the original image.

[0049] To achieve this, this disclosure provides an image processing apparatus and method that may implement an image processing pipeline that may comprise a sequence of three main modules / stages. A first process performed by the apparatus and method may be that of a decomposition module 201 that may encompass instance discovery and extraction into two or more layers. This decomposition process (module) focuses on scene understanding and may comprise a sequence of object detection, segmentation and depth estimation models. Part of the pipeline may be thought of as a module that decomposes the input image 100 received by the apparatus into a background image and a series of extracted instances with associated segmentation masks. At this stage, background and extracted instances are missing information due to occlusions.

[0050] This is addressed with the second stage of the pipeline implemented by the apparatus and method of this disclosure. The second stage may be thought of as a second module, an instance completion module. This stage aims to reconstruct 202 each instance individually, as it would look like if there were no occlusions. In other words, restore the instance to its complete state should it not be occluded by other instances. This step leverages depth and relative occlusion information to establish an instance ordering, and state of the art text-to-image generative models to inpaint the occluded areas.

[0051] Finally, in the final stage which may be thought of as a reassembly module, the apparatus and method may generate occlusion aware Alpha layers, and build a RGBA stack such that flattening the stack effectively reconstructs the input image 100 (I) .

[0052] Figure 2 depicts a broad overview of an example of a processing pipeline described above that may be implemented by the apparatus and method of the present disclosure. A further detailed schematic of an example pipeline that may be implemented is shown in Figure 7.

[0053] As shown in Figure 2, the process implemented by the image processing apparatus and method of this disclosure may be implemented in a series of stages that comprise a number of modules indicated in each dashed box in Figure 2. The first objective is, upon receiving an input image 100, decompose 201 the image into two or more layers. The image processing apparatus may therefore comprise one or more processors configured to determine one or more instance within the input image 100. The one or more processors are further configured to decompose 201 the input image 100 into two or more layers by iteratively extracting each instance from the input image 100 based on instance ordering of the one or more instance within the input image 100. This may be achieved by open-set instance detection using an instance detection model, guided image segmentation, image captioning, instance ordering as well as depth estimation. As shown generally in Figure 2. The decomposition 201 may first leverage an object detector and segmenter (segmentation model 204) to find and segment all instances in the image. Relative depth and instance occlusions (using segmentation information) are estimated, which are then used to estimate an instance ordering. The instance ordering may include performing a depth estimation for each input image 100, and inferring a depth of each of the determined one or more instance within the input image 100.

[0054] The decomposed image 205 comprised of two or more layers, which in turn are comprised of a first layer 101 (the background layer 101) and one or more instance layers 102 may then be captioned.

[0055] This disclosure utilises a state-of-the-art captioning model BLIP-2 to generate captions, and combined it with CLIP to select the best one per image. Due to the different nature of instance images (instance on a uniform white background) , captioning models tend to hallucinate so careful tuning of the captioning model might be required. The apparatus and method, in captioning, may then sample multiple captions with different prompts to increase diversity. As an example it is possible to use the following prompts: "Question: Could you please describe the tag? Answer: " , "Task: Write a brief description of the instance tag. Answer: " and "Task: Describe the tag. Answer: " where "tag" is the instance class name for instances and "image" for the background or full (input) image. In order to facilitate the generation of partially recomposed images it is also possible to caption intermediary images composed by the background layer 101 and a subset of the instance layers 102.

[0056] These decomposed images are then ready for image completion (reconstruction) 202 of each of the layers. The image completion stage implemented on the image processing apparatus and by the method of the present disclosure is also shown generally in Figure 2. Although it will be described in more detail later in this disclosure in relation to Figure 5, generally the one or more processors of the image processing apparatus may be configured to inpaint the background layer 101 and each instance layer 102 in an iterative manner. This may be achieved by re-integrating an incomplete instance in the background layer, inpainting the instance, then re-segmenting the instance. This is then used to form an intermediate image which is used as the input image of the next iteration. In other words, the other / further layers may be inpainted based on the ordering of each of the instance layers 102 and in particular the layers that are not between the layer to be inpainted and the background layer 101.

[0057] Once each of the two or more layers are iteratively inpainted as part of the image completion / restoration stage that may be thought of as an image completion module shown in Figure 2, the completed image layers can be reassembled. From the ordered RGBA layers this may be achieved by using image file formats which support multi-layer representation such as ORA and XCF. In restoring the image using the inpainted instances an alpha layer for each the instance layer 102 may be determined based on the occlusions from instances in one or more of the other / further layers that are closer to the camera than the present instance layer 102The reconstruction 203 of the layers may be performed based on the determined alpha layers and the ordering of the two or more layers. The alpha layers may be generated during the reconstruction of the layers. The layers that have been generated are recombined to form a reproduction of the input image 100 in the final step of Figure 2.

[0058] The layer and instance extraction (image decomposition) will now be described in relation to Figures 3a and 3b. Figure 3b provides further detail regarding the decomposition process shown in Figure 3a. The image processing apparatus comprising one or more processors and the method described herein may decompose an image input to / received by the apparatus in the following way.

[0059] The image decomposition of this disclosure takes advantage of the latest developments in the fields of open-set instance detection, guided image segmentation, image captioning, instance ordering as well as depth estimation. This image decomposition step, that may be thought of as an image decomposition module, performed by the image processing apparatus is illustrated in Figure 3a.

[0060] The one or more processors may be configured to leverage an object detector and segmenter (segmentation model) 360 to find and segment all instances in the image. Accurately detecting all relevant instances on an image is the first step configured to be performed by the one or more processors of the image processing apparatus of the present disclosure. In order to achieve good quality decomposition, it is important to be able to detect and separate all instances present in the scene. To this end, the one or more processors may be configured to leverage vision-language object detection techniques, that input a list of categories to detect, alongside the input image 100. Such models are attractive as they allow to perform open-set detection easily, allowing not to be limited to a specific dataset’s class set. The text input can be an accurate list of instances present in an image, obtained using e.g., image tagging methods; or an exhaustive list of all potential categories of interest to be extracted.

[0061] This disclosure considers the latter option, which can be used with a generic object detector. The object detector may be a multimodal object detector but other object detectors may be used. One example is to use detCLIPv2, a state-of-the-art model characterised by its ability to leverage category definitions (and not just class names) to improve detection accuracy. This can be seen in Figures 3a and 3b. It is then possible to construct a text input (the category list) , to ensure all desired categories are detected and extracted from the image. It is possible in some cases for the apparatus and method of this disclosure to use the concept list from the THINGS database, and manually update and simplify it to obtain more generic category names (e.g. merging types of boats, drinks, nuts, etc. ) and removing homonyms and concepts that are not desired to be extracted (e.g. unmovable objects, clothing, bolts and hinges) . This list may constitute an input to the pipeline implemented by the image processing apparatus, allowing easy customisation as to which instances to detect. This class list may then used, alongside their definition obtained from the WordNet database, to identify all relevant instances on an image.

[0062] After accurately detecting instances in the image, the next step is to obtain precise segmentation. To be able to handle a vast number of categories, domains and image qualities; a robust general purpose segmentation model may be used. This disclosure therefore leverages foundational segmentation models which have been trained with the required diversity and scale. One such model is a Segment Anything Model (SAM) which has good robustness and transferability across domains including geospatial imaging, medical imaging and tracking. The ability to use bounding boxes as grounding for segmentation predictions makes this family of models prime candidates to be combined with detCLIPv2. Furthermore, the multimodal grounding ability of SAM (points, segmentations, bounding boxes) allows the enablement of interactive segmentation and adjustments.

[0063] Next, relative depth and instance occlusions (using segmentation information) may then be estimated, which are then used to estimate an instance ordering. Understanding the relative positioning of instances in an image is important in achieving the RGBA decomposition. Depth estimation provides information indicating how close instances were to the camera. One example is to use the BEiTL=512v3.1 from the MiDaS package. This specific model is beneficial due to its robustness. The one or more processors may also be configured to perform depth estimation customization and instance clustering as is known and providing the outputs of these tasks for consideration during instance extraction ordering as shown in Figure 3b. Some examples of depth estimation customization may include the use of ZoeDepth to estimate the metric depth from a relative depth or the use of LERES to enhance the resolution of the depth.

[0064] The one or more processors may further be configured to compute depth and occlusion instance graphs for a more comprehensive scene understanding. Specifically InstaDepthNeto, d may be used, which is a network capable of jointly predicting the occlusion and depth relationships between instances. This is shown in Figure 3b. It may iteratively predict pairwise relationships between instances, using as input the original image and instance segmentations.

[0065] The directional occlusion graph outlines relative occlusion information between pairs of instances. Each instance in the image is a graph node, and an edge from instance A to instance B indicates that A occludes B. There are, however, situations where two instances mutually occlude each other. Similarly, the directed depth graph has instances as nodes, and an edge from instance A to  instance B indicates that A is closer to the camera than B, according to their mean depth value. A bidirectional edge  indicates that instances A and B have the same mean depth.

[0066] One example of an instance ordering process is shown in Algorithm 1 of Figure 4. In Figure 4, L a list of the maximum depth values per instance, where for each instance a determination of the maximum depth that can be found within its segmentation is made. S indicates the list of indices N has been sorted. For each graph N is the list of nodes (same as the list of instances as each instance is a graph node) , and ε is the list of edges in the graph (i.e. the connections between the graph nodes) that may be stored as an adjacency matrix of size N x N, while e is one edge in that list e.g., variable e is the value of ε at position i, j in the agency matrix of graph ε.

[0067] This Algorithm describes the inputs to the instance ordering procedure that may be performed by the one or more processors. The depth-based ordering that may be performed based on a relative mean depth value of the instance layers 102 and determining the number of instance layers 102 behind (deeper than) the current instance layer 102 (i) . The instance ordering may be performed by the one or more processors by being estimated in the following way. Instances may first be ordered based on their relative mean depth value: instances that are further away (highest depth) will be the first to be reconstructed in the next stage / module. In other words, ordering the one or more instance in the input image 100 based on a relative mean depth value may be performed in that the instances that are more distant from the camera position (those closest to the background image) are ordered first and this ordering may be reused during the reconstruction 202 of each layer based on the ordering that has been determined.

[0068] An occlusion-based ordering correction may then be performed by the one or more processors as described above, based on performing an iterative loop through the one or more instances to correct the instance layer 102 ordering based on the occlusion of an instances within an instance layer 102 by the instances of other layers. When such occlusions are determined, the instance layers 102 in question may be swapped with one another before performing the next iteration. In some cases, each instance is compared to the instances in the other layers to determine if an occlusion exists and the instance layers 102 may be swapped either after comparison with each instance layer 102 or after the instance in the present layer (n) has been compared to all other instance layers 102. The ordering itself is thus adjusted based on occlusion information. Depth information can lack precision when used alone, especially when instances are close to each other. An instance occluded by another instance will therefore be placed before the occluding instance, if it was not the case in the previous step. In other words, the one or more processors may be configured to perform instance ordering determining whether the one or more instance in the input image 100 is occluded by one or more of the other instances within the input image 100.

[0069] Finally, Algorithm 1, that is capable of being performed by the one or more processors, makes a final adjustment to the ordering of the instance layers 102 based on mutual occlusions. As can be seen, the one or more processors that execute the algorithm may be configured to determine mutual occlusions between the instances in each of the two or more layers. The one or more processors may then be configured to update ordering based on mutual occlusions. If two instances mutually occlude each other, the instance with the highest maximum depth will be ordered first, this is known as the mutual occlusion depth based fix. In other words, the one or more processors may be configured to, in performing instance ordering, determining mutual instance occlusion, in which an instance in the input image 100 both occludes and is occluded by a further instance in the input image 100; and correcting the order of one or more instances based on determined occlusion of each instance.

[0070] Once ordered the two or more layers that have been extracted from the input image 100 may be output by the one or more processors. The two or more layers may at this point be comprised of a set of extracted instances with occlusions, and a background image where all instances have been removed. Each instance may be present in a separate layer of the two or more layers.

[0071] The ordering of the layers that is performed based on the Algorithm 1, described above, may then be used during the reconstruction 202 process to determine the order in which the layers and therefore the instances are inpainted.

[0072] At this stage, all instance layers 102 have been isolated from the background layer 101. However, each layer of the multi-layer decomposed image 205 should be a complete instance, such that removing or hiding this layer reveals occluded areas. An important challenge thus remains: reconstructing occluded areas for each individual image layer li (including the background) . Since the decomposition is performed on natural images, this information is not available to us. State-of-the-art generative models may be relied upon to imagine these occluded areas from available context, using inpainting solutions.

[0073] Image inpainting with text-to-image diffusion models 350 can achieve tremendous performance. However, there are some unique difficulties: 1) in contrast with the common strategy of carefully optimising hand-crafted prompts, it is only possible to rely on automatically generated captions to generate an inpainting prompt and shared negative prompts, 2) instance images (layers) comprise the instance over a uniform black or white background, a type of image not commonly seen by these models, and 3) rather than obtaining high quality images, this disclosure seeks the simplest, most accurate completion for the available content. The reconstruction of the first layer 101 and the one or more instance in each subsequent layer will now be described in relation to Figure 5.

[0074] As an overview the inpainting process performed by the apparatus is as follows. Given a pre-defined instance ordering described above, the one or more processors are configured to iteratively inpaint an instance’s occluded areas, from background image to the closest, least occluded instances. For a given instance layer 102, the inpainting process may in more detail proceed as follows: an estimate of an inpainting mask using occlusion information, and segmentation masks from occluding instances. Second, a contextual inpainting image may be formed by re-integrating the incomplete instance in an intermediate composite image 342. This composite image 342 contains inpainted instances 320 processed in previous iterations steps as well as the inpainted background instance. Third, the instance of the instance layer 102 in the present iteration may then be inpainted using a state-of-the-art inpainting generative model and automatic captions as prompts. A segmentation model in the form of a segmentation model 360 may then be used as described above to again re-extract the reconstructed instance 320 using segmentation and matting models. This effectively obtains the complete instance image which will be part of the final multi-layer image representation. Finally, the composite image 340 (new background image to be used in the reconstruction of the next instance in the next iteration) is formed by including in the composite image 340 the newly inpainted instance 320. Importantly, to avoid introducing misleading context information this disclosure replaces information from pixels that are closer to the next instance’s max depth with a constant value.

[0075] In further detail, the inpainting process of Figure 5 is as follows. Once the input image 100 has been decomposed into the two or more layers the first layer 101 and the one or more instance, the one or more processors are configured to reconstruct 202 a first layer 101 of the two or more layers, based on the instance ordering, by inpainting the first layer 101 using a mask based on the one or more instance comprised in the input image 100. As discussed above, the first layer 101 is the background layer 101 that is the deepest layer in the stack of extracted two or more layers. The one or more processors are further configured to the reconstruction of the one or more instance in each subsequent layer comprises iteratively: the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask 310 and one or more preceding reconstructed layer from the previous iteration. The reconstructive steps are performed iteratively for each instance layer 102 after the first layer 101 has been reconstructed 202. The mask applied to the first layer 101 for inpainting may differ from the further mask 310 applied to the subsequent one or more instance layer 102 for inpainting in that the mask used for inpainting the background may take into consideration all other layers (between the camera and the background layer 101) at shallower depths. The mask may be comprised of a composite segmentation of all of the one or more instance within the input image 100. The further mask 310 may be a mask that may not consider "all" layers (for example it doesn't consider the background or layers below the present instance layer 102 or instance layers 102 that do not occlude) . Instead, the further mask 310 may only considers the layers that are between that instance layer 102 and the camera that occlude the instance in that instance layer 102. In other words, the further mask 310 may be comprised of a composite segmentation of all of the one or more instance within the input image 100 that are determined to occlude the instance of that iteration.

[0076] The one or more processors of the image processing apparatus of the present disclosure may be configured to iteratively reconstruct the occluded area in the background and instance layers 102 using a state-of-the-art pre-trained generative model. This disclosure adopts an inpainting strategy, where only a portion of the image (defined by a binary mask) used as input to the generative model will be modified. To accurately inpaint missing areas, it is important to have contextual information from the remainder of the scene. With this in mind, this disclosure describes as an example an instance-wise iterative process, where  instance layers 102 are reconstructed one instance at a time according to pre-established instance ordering. The process is illustrated in Figure 5. The first step is to inpaint the background image using all instances’ segmentation mask and a neutral prompt. This outputs a first RGB layer, which can be considered to be the background image. Then, given a partial instance, the partial instance is reintroduced into the background image. The one or more processors are then configured to estimate an inpainting mask (further mask 310) as the ensemble of segmentation masks from occluding instances. The input image 100, the incomplete extracted instance 330, and further mask 310 are inputted to a generative model, which outputs a complete reconstructed instance320 by inpainting the instance 330 that is inserted in the input image. It is then possible to resegment the reconstructed instance 320, and obtain one of the instance specific RGB layers (instance layer 102) . During the first iteration, the input image may be the background image.

[0077] In other words, the one or more processors are configured to combine the extracted instance with the one or more preceding reconstructed layer and the first layer 101. This reconstructed layer and first layer 101 may be just the first layer 101 if no instance layer 102 is below the instance layer 102 of this iteration or may be the first layer 101 combined with the instance layer 102 below the instance layer 102 of this iteration. Then the one or more processor may be configured to create the further mask 310 based on the instance ordering of the one or more instance and one or more occluding instance comprised in the two or more layers other than the preceding one or more reconstructed layer. The extracted instance (from the present instance layer 102) of the current iteration is then inpainted, in dependence on the further mask 310 and the preceding one or more reconstructed layer, using a generative model to form a composite image. The composite image may be thought of as the reconstructed image after inpainting where the composite image may be a combination of all layers that have been reconstructed in the present iteration and previous iterations, including the background layer 101. Finally, the one or more processors are configured to extract the inpainted instance 320 from the composite image to form a reconstructed layer.

[0078] The one or more processors may then be configured to repeat the process with the next instance, by reintroducing the completed instance into the background image, and use this new intermediate image 340 as input to the next iteration. To avoid introducing irrelevant and misleading context, it is possible to mask, with a constant value, regions of the intermediate image 340 with lower depth than the next instance’s maximum depth.

[0079] Once all of the two or more layers have been reconstructed and extracted to form the separate layers the image processing apparatus may be configured to output a set of RGB images for all completed instances and background.

[0080] Better instance completion quality can be achieved by inpainting occluded areas within image context rather than directly completing the extracted instance. As a result, establishing a precise instance inpainting schedule is important in progressively enriching the image context without occluding relevant areas. As described above the instance ordering is generated in a number of steps based on instance ordering and occlusion information obtained in the decomposition step.

[0081] To restate this instance ordering generally, the instances are ordered based on their depth information, from further away to closest (according to instance mean depth value) . This can easily be achieved using the instance depth graph, by computing node outdegree: this computes the number of directed edges departing a node, i.e. the number of instances that are behind the node. Second, this disclosure relies on an occlusion graph to refine the ordering: if instance A occludes instance B, instance B will systematically be ordered before instance A. Finally, mutually occluded instances are reordered according to their maximum depth value. This may be achieved based on the Algorithm 1 shown in Figure 4.

[0082] The image processing apparatus of this disclosure may utilise multiple inpainting masks described briefly above. These inpainting masks vary depending on the layer of the two or more layers to be inpainted but estimating an accurate inpainting mask, i.e. describing which image regions will be overwritten, may be important in achieving accurate instance completion. Failing to include key occluded areas risk yielding incomplete results, while a mask that is too large risks altering the original image appearance. Ideally, an accurate complete instance shape should be estimated using amodal completion techniques. Existing methods tend however to be dataset or object class specific with limited generalisation ability. The apparatus and method of this disclosure leverage intrinsic biases of large generative models by providing a large inpainting mask, encompassing  the area where the occluded object could be present. This is achieved simply by building an inpainting mask comprising segmentation masks of all occluding instances.

[0083] Inpainting prompts are kept simple, in order to achieve a fully automated decomposition strategy and cannot engineer an optimal prompt per image / instance. For instance inpainting, the apparatus may leverage automatically generated instance captions described above. To inpaint the background image, it is possible to use a simple generic prompt that ensures the generated inpainting background is as simple as possible. Importantly, the class names of all other instances in all negative prompts may be included, to avoid re-introducing extracted instances. This increases robustness to imperfect segmentations.

[0084] One example of the inpainting procedure for an instance can be seen in Figure 6, wherein the hands of the person are occluding the phone that is held and the phone can be extracted and inpainted using the above technique to form a separate instance layer 102. The phone can then be reintroduced in the composite image 340 behind the fingers of the person such that the image looks complete and can be used in the next iteration. In addition, Figure 6 demonstrates the effect of the alpha layers for each of the instances within the image, e.g., the image of the persons hands and the phone. In the first image of Figure 6 the alpha layers are set such that the transparency of the phone is low and thus it appears above the fingers of the person. In contrast, the second image of Figure 6 demonstrates the adjustment of the alpha layers of the instances such that the fingers of the user occlude portions of the inpainted phone.

[0085] Once each of the two or more layers have been inpainted as described above and re-extracted to form separate and distinct layers that can form part of the RGB image stack representing the input image 100, they are not ready for reassembly 203.

[0086] It is further an objective of the image processing apparatus and method of this disclosure to provide a faithful reconstruction of the original image when the RBG layers are recombined. This may be achieved by the processors of the present disclosure since the one or more processors are further configured to: determine alpha layers for each reconstructed layer and the first layer 101 based on the further mask 310 for each of the one or more instance. The alpha layers may further be determined based on occlusion information comprised of information relating to mutual and non-mutual occlusions. Further, the alpha layers may also be generated by first approximating the matting segmentation and then adjusting it based on the occlusion information from the segmentations of the occluding instances. In this way the alpha layers may take a value between 0 and 1 based on the transparency of the layer in question and / or a portion of the layer in question. Each of the two or more layers may have an associated alpha layer describing the transparency of the whole of a portion of that layer. Once these alpha layers have been determined for each reconstructed layer including the first layer 101 the one or more processors may then be configured to reassemble 203 the input image 100 by stacking the one or more reconstructed layers and the first layer 101 based on the instance ordering and the determined alpha layers.

[0087] In other words, the RGB layers are stacked according to the completed instance ordering, and Alpha (transparency) channel for each instance are estimated, yielding RGBA layers. In the absence of mutual occlusions, alpha layers are simply the instance’s segmentation mask obtained during the inpainting process. For mutually occluded instances (i.e. an instance in lower layers is an occluder) , occluded areas are set to be transparent, this describes a portion of the layer being described by an alpha layer as transparent. The impact of this is illustrated in the detailed example given in Figure 7, which includes a portion for instance reintegration ordering leading to the iterative creation of an instance occlusion aware transparency layer as shown in Figure 6 in which the alpha layers are adjusted as previously described. In other words, the instance occlusion aware transparency layer arises where two instances are mutually occluding each other and it is assumed that the instance with the higher depth is behind the other instance. Then the occluding instance’s segmentation may be used to alter the occluding instance’s alpha channel by having the overlapping non-zero values from the occluding instance’s alpha channel turned to zero such that they become transparent. Therefore, for reassembly of the image stack, alpha layers are iteratively generated according to the inpainting ordering, and the new layer is added to the RGBA stack. The apparatus and method may then be configured to iteratively blend each completed instance layer with the background according to its alpha layer using a process such as that used to prepare the inpainting of the first layer.

[0088] Figure 7 shows an example of a complete process that may be performed as part of the method of this disclosure and the functions that are configured to be performed by the one or more processors of the image processing apparatus of the present disclosure. As can be seen, Figure 7 provides a detailed combination of the processes described above in Figures 2, 3a and 3b as well as the processes that are performed as part of the reassembly process 203. This can be seen in the flow diagram in Figure 7 that relates to the features of general processes performed in Figure 2. In addition, it can be seen that Figure 7 includes the image ordering process of Figure 3b and demonstrates how such a process may be integrated by the apparatus into the image processing pipeline of this disclosure. This may be achieved by passing the image ordering information from the image ordering process of Figure 3b to the modules responsible for inpainting the background layer and an iterative process that inpaints each of the instances in turn as described in Figure 5.

[0089] Finally, Figure 7 demonstrates how the inpainted background layer and each inpainted instance layer may be reassembled in dashed box 703 to approximately reproduce the input image. Once alpha layers have been determined and associated with the two or more layers extracted from the input image 100 and inpainted, the completed stack of RGBA images may then be reassembled 203 to reproduce the input image 100 in a faithful manner. In other words, the one or more processors may further be configured to reassemble 203 the input image 100 by alpha blending based on instance ordering and occlusion of the instances in each layer. Alpha blending may be performed such that the current alpha layer Xt and all other layers (that are already blended X<t are blended based on the alpha layer t. An example process from input image 100 decomposition, through instance ordering and instance inpainting to reassembly 203 of the two or more layers can be seen in Figure 7. The dashed lines represent processes to be performed iteratively by the apparatus and method for each of the two or more layers of the decomposed input image 100.

[0090] A key innovation of this disclosure is the instance ordering estimation, which enables a sequential inpainting strategy, as well as occlusion-aware alpha layer estimation. The advantages of the present apparatus are that there are no training costs or dataset domain sensitivity. This is achieved by leveraging frozen models which allows for easy replacement of pipeline components with specialized models if needed (e.g., models trained on cartoon images) . A further advantage is that the decomposition pipeline of this disclosure can uniquely decompose any RGB image into a RGBA stack, including an instance-wise foreground decomposition, without requiring additional inputs. The pipeline outputs images in a format that is natively editable (e.g., removal, resizing, moving and reordering) by common image editing software.

[0091] The applicant hereby discloses in isolation each individual feature described herein and any combination of two or more such features, to the extent that such features or combinations are capable of being carried out based on the present specification as a whole in the light of the common general knowledge of a person skilled in the art, irrespective of whether such features or combinations of features solve any problems disclosed herein, and without limitation to the scope of the claims. The applicant indicates that aspects of the present invention may consist of any such individual feature or combination of features. In view of the foregoing description, it will be evident to a person skilled in the art that various modifications may be made within the scope of the invention.

Claims

1.An image processing apparatus, the apparatus comprising one or more processors configured to:receive an input image;determine one or more instance within the input image;decompose the input image into two or more layers by iteratively extracting each instance from the input image based on instance ordering of the one or more instance within the input image;reconstruct a first layer of the two or more layers, based on the instance ordering, by inpainting the first layer using a mask based on the one or more instance comprised in the input image;reconstruct the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask and one or more preceding reconstructed layer from the previous iteration.2.An image processing apparatus according to claim 1, wherein the reconstruction of the one or more instance in each subsequent layer comprises iteratively:combining the extracted instance with the one or more preceding reconstructed layer and the first layer,creating the further mask based the instance ordering of the one or more instance and one or more occluding instance comprised in the two or more layers other than the preceding one or more reconstructed layer,inpainting the extracted instance, in dependence on the further mask and the preceding one or more reconstructed layer, using a generative model to form a composite image, andextract the inpainted instance from the composite image to form a reconstructed layer.3.An image processing apparatus according to any one of claims 1 or 2, wherein the one or more processors are further configured to:determine alpha layers for each reconstructed layer and the first layer based on the further mask for each of the one or more instance; andreassemble the input image by stacking the one or more reconstructed layers and the first layer based on the instance ordering and the determined alpha layers.4.An image processing apparatus according to any one of claims 1 to 3, wherein the instance ordering performed by the one or more processes comprises:performing a depth estimation for each input image, andinferring a depth of each of the determined one or more instance within the input image.5.An image processing apparatus according to any one of claims 1 to 4, wherein the instance ordering performed by the one or more processes further comprises:determining whether the one or more instance in the input image is occluded by one or more of the other instances within the input image;determining mutual instance occlusion, in which an instance in the input image both occludes and is occluded by a further instance in the input image;ordering the one or more instance in the input image based on a relative mean depth value; andcorrecting the order of one or more instances based on determined occlusion of each instance.6.An image processing apparatus according to any one of claims 1 to 5, wherein the mask is comprised of a composite segmentation of all of the one or more instance within the input image.7.An image processing apparatus according to any one of claims 1 to 6, wherein the further mask is comprised of a composite segmentation of all of the one or more instance within the input image that are determined to occlude the instance of that iteration.8.An image processing apparatus according to any claim 3, wherein the one or more processors are further configured to reassemble the input image by alpha blending based on instance ordering and occlusion of the instances in each layer.9.An image processing apparatus according to any one of claims 1 to 7, wherein each of the one or more instance is determined using an object detector.10.An image processing apparatus according to any one of claims 1 to 8, wherein the one or more processors are further configured to use a segmentation model to perform the iterative extraction of each of the one or more instances present within the input image in turn.11.A method of image processing, the method comprising:receiving an input image;determining one or more instance within the input image;decomposing the input image into two or more layers by iteratively extracting each instance from the one or more determined instance based on instance ordering of the one or more instance within the input image;reconstructing a first layer of the two or more layers, based on the instance ordering, by inpainting the first layer using a mask based on the one or more instance comprised in the input image; andreconstructing the one or more instance in each subsequent layer of the two or more layers, using a generative model to iteratively inpaint each instance based on the instance ordering, a further mask and one or more preceding reconstructed layer from the previous iteration.12.A method of image processing according to claim 11, wherein the reconstruction of the one or more instance in each subsequent layer comprises iteratively:combining the extracted instance with the one or more preceding reconstructed layer and the first layer,creating the further mask based the instance ordering of the one or more instance and one or more occluding instance comprised in the two or more layers other than the preceding one or more reconstructed layer,inpainting the extracted instance, in dependence on the further mask and the preceding one or more reconstructed layer, using a generative model to form a composite image, andextract the inpainted instance from the composite image to form a reconstructed layer.13.A method of image processing according to any one of claims 11 or 12, wherein the method further comprises:determining alpha layers for each reconstructed layer and the first layer based on the further mask for each of the one or more instance; andreassembling the input image by stacking the one or more reconstructed layers and the first layer based on the instance ordering and the determined alpha layers.14.A method of image processing according to any one of claims 11 to 13, wherein the instance ordering comprises:performing a depth estimation for each input image, andinferring a depth of each of the determined one or more instance within the input image.15.A method of image processing according to any one of claims 11 to 14, wherein the instance ordering is performed by:determining whether the one or more instance in the input image is occluded by one or more of the other instances within the input image;determining mutual instance occlusion, in which an instance in the input image both occludes and is occluded by a further instance in the input image;ordering the one or more instance in the input image based on a relative mean depth value; andcorrecting the order of one or more instances based on determined occlusion of each instance.16.A method of image processing according to any one of claims 11 to 15, wherein the mask is comprised of a composite segmentation of all of the one or more instance within the input image.17.A method of image processing according to any one of claims 11 to 16, wherein the further mask is comprised of a composite segmentation of all of the one or more instance within the input image that are determined to occlude the instance of that iteration.18.A method of image processing according to any claim 13, further comprising reassembling the input image by alpha blending based on instance ordering and occlusion of the instances in each layer.19.A method of image processing according to any one of claims 11 to 17, wherein each of the one or more instance is determined using an object detector.20.A method of image processing according to any one of claims 11 to 18, further comprising performing the iterative extraction of each of the one or more instances present within the input image in turn using a segmentation model.

Citation Information

Patent Citations

  • Training method and device of image processing model and image processing method and device

    CN114863216A

  • Mapping object instances using video data

    US20210166426A1

  • Method and apparatus with object pose estimation

    US20220198707A1

  • InSeGAN: A Generative Approach to Instance Segmentation in Depth Images

    US20220309672A1

  • Learning parameters for generative inpainting neural networks utilizing object-aware training and masked regularization

    US20230259587A1