Skip to main content
Inspiring
August 29, 2023
Question

Content-aware fill issues when anything passes in front of the mask

  • August 29, 2023
  • 2 replies
  • 943 views

I've been using content-aware fill to great effect lately, especially in combination with a PS reference frame. However, anytime a person or object passes in front of the mask, it grabs details from those passing pixels and incorporates them into the fill layer. So the patch looks perfect right up until the person passes, at which point their clothing warps into the background patch. Any tips for how to avoid this?

 

I'm masking out the object I want removed from the background (subtract mask) and then masking back in the objects passing in front of it (add mask) so that I have a perfect transparent mask around only the section I want to cover up. One trick I tried was to temporarily switch that second mask, the passing object, into a subtract mask as well. That way all of those pixels are gone too, and the software only has the background pixels to look at for context. This worked okay a couple times, but it makes the transparency so large that the resulting generated fill layer isn't very good.

 

I know I could make a second reference frame after the object passes, but (a) the fill needs to be identical to the fill beforehand, not a new generated fill; and (b) I still think the passing object would bleed into the fill layer in the frames around the passing moment.

 

Any advice is greatly appreciated!

This topic has been closed for replies.

2 replies

Community Expert
August 29, 2023

It sounds like you need another copy of the footage with just the front object rotoscoped. There is no easy way to do what you want to do with one layer. 

 

Full UI screenshots added to your post instead of Uploaded using the Drag & drop here... button would help us help you. Select the problem layers and press the 'u' key twice to show us all the modified properties.

Mylenium
Legend
August 29, 2023

Probably a task for manual Roto, to be honest. You simply don't have that levcel of control in CAF, which kind of is the point. I'd just generate a clean background and patch it together, then roto out the foreground stuff and use it as an inverted track matte to fill in whatever needs to be filled in.

 

Mylenium

Inspiring
August 29, 2023

Well I'm not really talking about roto here, I'm talking about the fill/patch. All the roto work is already done. I did manually roto out the foreground stuff, and I rotoed out the background stuff using Mocha. Both worked swimmingly. Then I'm using CAF to fill the patch in, which is also working swimmingly -- it is much, much better at matching motion blur and lighting changes than if I were to build a fill layer out myself. It's only causing problems for a second or so whenever something crosses the mask.

 

So yes, the workaround is to use CAF all the way up until the person/object crosses, then to manually freeze the fill, copy that as a reference frame after the object has finished crossing, and then let CAF finish filling everything after that. But that is cumbersome and introduces potentially unnecessary human error.

 

Maybe the feature isn't available yet, but ideally CAF would understand mask layers the way Mocha understands it for planar tracking. In Mocha you can create a second mask for objects passing in front of your first mask, and the software knows to ignore those pixels, allowing a seamless track even when the mask is interrupted. I'm wondering if there's a way to get CAF to behave similarly, to "ignore" the pixels I tell it to ignore. Perhaps that's not possible yet and the only solution is to fill that gap manually. If so, I hope the functionality gets added soon, it doesn't seem too difficult.