Skip to main content
Participating Frequently
August 4, 2020
Question

I need help cloning away objects from a mirror that actors walk in front of

  • August 4, 2020
  • 1 reply
  • 803 views

In After Effects, I'm trying to clone away unwanted objects that are being reflected in a rectangular mirror. So the objects are not free floating where Content Aware Fill can easily track it, they touch the bottom edge of the mirror the entire length. So I have been using a reference frame from Photoshop that I made while attempting to make Content Aware Fill work, I'm using it as a time remapped layer under the source footage layer. The source footage has a mask layer around the mirror "Subtracted" so that the reference layer shows through. My problem is that the camera moves slightly, so I need to get the reference layer to move its' position and track with the camera movement in the source layer. How do I get that reference layer to seamlessly move with the mirror in the source layer? Or is there another way to solve this a lot faster? People walk infront of the mirror and the objects so I need to mask around them as well, so I'm trying to find the best solution. Thankfull for anyones help!

This topic has been closed for replies.

1 reply

Community Expert
August 4, 2020

If the camera moves, tilts or pans, you need to motion stabilize the shot so that the mirror does not move. Then you need to create mattes every time an actor comes between the mirror and the camera. The matte only needs to cover the mirror and only needs to start when an actor enters the frame of the mirror, and end as soon as they exit. Rotobrush might work, but it will probably take some hand roto and combined with procedural matte. When the mattes are created for every actor you can combine them in a single pre-comp and use that as a track matte for the replacement image for the mirror.

 

When all of that is done you can add a null to the comp, tie the position, rotation and scale of the null to the Anchor Point, Scale, and Rotation of the stabilized footage, then move to the first frame of the comp and parent the replacement image, the track matte pre-comp and the stabilized footage to the null to put the movement back in the shot and add it to the replacement image and track matte.

 

 If the camera is locked down you can eliminate the motion stabilizing. If the camera movement is erratic, you may need to do a Stabilized Corner Pin workflow to help simplify the roto work. 

 

Here's what one of the frames of the shot you sent us would look like as you are creating the matte:

I used Curves and Linear Color Key to create a black matte for the hair then added a rotoscoped white layer to hide the other objects in the mirror and leave the actor. That was pre-composed and used as a luma track matte for the mirror replacement.

 

As I said before, if the camera is moving there is a lot more to do, but the procedure is the same. Create a matte as efficiently as you can that just separates the actors from the mirror, then use that matte to poke a hole in the replacement mirror image (the blue solid in my sample comp). Then all that is left is to do the final color correction of the replacement image and put the motion back in the shot and add it to the matte and the replacement image.

 

The reason you want to motion stabilize the footage is to make masking the mirror and the actors easier. 

lydiahallAuthor
Participating Frequently
August 5, 2020

Hi Rick,

Thank you very much for this detailed workflow. I've starting prepping the mask for the roto and came across a confusing part. I used Warp Stabilizer on the original footage in the original comp and then copied that file into the new comp for the matte. But when I'm making the mask for the inside of the mirror, the line of the mask and the actual area are not lining up because of the cropping the stabilizer had to do. So I'm not sure if I'm making the mask correctly. If I turn the stabilizer off then the area shrinks to realign with the mask line. I am totally new to this to kind of work, so I'm happy to learn but this is just not familiar to me, so I might have more questions..

lydiahallAuthor
Participating Frequently
August 13, 2020

As is shown in the screenshot, the Background Matte is just a white solid with a mask.

 

You'll also want to have the Info panel open so you can mouse over the different parts of the comp and check the color values to make sure your luma matte works. 


Okay, what's the purpose of the white solid? 

 

And then for seperating the hair from the TV, I see that you have Roto in a different layer, how did you do that? Is that a null object or an adjustment layer?  How do I use Roto to recognize the black of that tv to seperate it from the hair? Whenever I try to use roto it only selects the white inside the mirror.