7 Replies Latest reply on Jun 20, 2017 7:47 AM by Szalam

    Expected better results using Difference Matte

    www.5mingamer.com

      I'm having trouble creating transparency using a Difference Matte. I have a still background image without moving object that I use for the Difference Layer and the footage. The camera is mounted on a tripod so there's no camera shake.

       

      Here is the still Difference Layer image

      No Moving Car.png

      The object I want to isolate is the car in the foreground

      object to be isolated.png

      This is the best result using the Difference Matte and Matte Choker

      Moving Car - Final Output.png

      And this is the Matte Only so you can see what the differences are

      Moving Car - Matte Only.png

      Is there anyway to improve this as it just look ridiculous?

       

      Thank you in advance.

       

      Anthony

        • 1. Re: Expected better results using Difference Matte
          davidarbor Adobe Community Professional

          You actually answered the problem yourself—those are the differences. The difference blend mode visualizes the differences between two layers. Everything else in your shot is the same, with the exception of the foreground car. This is why your matte is mostly black, because there's no difference between the two layers.

           

          If you want to isolate the car you need to rotoscope it. You can start by checking out the Roto Brush (After Effects Roto Brush, Refine Edge, and Refine Matte), but it depends what you're trying to do with that isolated car. If you want to completely cut it out then you're going to have to do a lot of work on the windows, as you can see right through them; so if you're trying to put the car on another layer you'll have BG elements from the above shot mixed in with your car. If you're trying to color correct the car then you can just use the Rigid Mask Tracker and attach that mask to a Lumetri Effect.

          1 person found this helpful
          • 2. Re: Expected better results using Difference Matte
            www.5mingamer.com Level 1

            davidarbor  wrote

             

            You actually answered the problem yourself—those are the differences. The difference blend mode visualizes the differences between two layers. Everything else in your shot is the same, with the exception of the foreground car. This is why your matte is mostly black, because there's no difference between the two layers.

             

            The problem is the blue car! In the Final Output image (3rd down) the blue car in the background can be seen through the black car in the foreground, this I assume is because the Difference Matte algorithm has detected no different between parts or the blue car and parts of the black car. This can't be the case because when the footage is played in Final Output mode the blue car can clearly be seen as a ghostly image as the black car passes in front of it. If there were no differences between the two layers then the blue car ghost wouldn't be visible.

             

            Have a look at pictures 2 and 3 (from the top). You can clearly see in picture 2 the black car in front obscures the blue car behind it and a nobody would never say that there isn't difference between the two, except for those bits that appear through the window.

             

            I want to isolate the car because it's going to appear in the same place but later on in the footage. Bits that appear through the windows don't matter because the car will still be driving passed that car anyway.

             

            Thank you

             

            Anthony

            • 3. Re: Expected better results using Difference Matte
              davidarbor Adobe Community Professional

              Sorry, I was thinking more about the Difference Blend mode than the Difference Matte effect. It looks like a contrast issue then. Your BG blue car is too similar to the FG black car, which is indicated by how the matte looks. The darkest parts of the blue car are black, indicating no differences.

               

              Here's one option: you could try color correcting your still image. You didn't say what version of Ae you're using, so there are two different ways to go about this. If you're using CC 2017 then you can add a Lumetri effect to your still image, go back to your Difference Matte effect and choose "Effects and Masks" (next to the Difference Layer dropdown). This will allow the Difference Matte effect to reference the post-effected clip.

               

              If you don't have this option then you have to pre-compose the shot and move the Lumetri effect inside the pre-comp.

              1 person found this helpful
              • 4. Re: Expected better results using Difference Matte
                Dave LaRonde Level 6

                I'm with davidarbor.   You need to use Rotobrush.

                 

                The Difference matte pretty much stinks because each & every pixel has to be identical to isolate the different item.  And I mean identical!  That's fine if you're working with $80 K Sony cinema-quality camera recording in 4-4-4 color resolution, but few people do.  There will almost always be differences in pixels that screw up the transparency.

                 

                Sorry, but you chose to use one of the most useless things in AE -- the Difference Matte.

                1 person found this helpful
                • 5. Re: Expected better results using Difference Matte
                  Mylenium Most Valuable Participant

                  What the others said - you are expecting the Difference Matte to work different from how it actually works. What you have is no proper clean plate to begin with. A good workflow would have been to have the street and buildings without any cars at all, but as it is, a dark blue and a black-ish grey are too close to produce any opaque difference matte. You can't fix that even with manually mangling channels. There's simply not enough headroom and the aliasinag and clipping would make it look rubbish one way or the other. If at all you could build a motion-based difference keyer, but that's some sophisticated stuff and would require commercial plug-ins, so for the time being manually masking out the car would be much easier.

                   

                  Mylenium

                  1 person found this helpful
                  • 6. Re: Expected better results using Difference Matte
                    Rick Gerard Adobe Community Professional & MVP

                    Image compression, slight differences in exposure, the placement of shadows, anything at all that is not exactly the same in the scene will foul up a difference matte. It is a procedural al effect with very limited controls. The imperfect matte around the roof line and the other details look like they could be subtle lighting changes, maybe slight exposure differences and even compression artifact differences in the two images. The only time I have had any success using the difference matte effect was with a locked off camera, uncompressed footage and identical lighting.                                                                                                                                                                                                                                                                                                                                                                                                                      

                    1 person found this helpful
                    • 7. Re: Expected better results using Difference Matte
                      Szalam Adobe Community Professional & MVP

                      This shot looks really simple to do with a mask. You probably don't even need to use the Roto Brush. You could probably put a mask on the car when it's in the middle of the shot, set a keyframe for the mask path, then move to the beginning and end and scoot the mask off screen to the left and right respectively. Then split the difference between the new keyframes and adjust a bit. Repeat that last step as needed.