VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    I need to get rid of the background for a video.
    A snapshot of the video I have is given on the following link:

    www.moviecharts.com/dummy/dummyPicture.JPG

    The character in the video has been cut out.
    What I need to do is take out the background and just have the character.

    OK... yes... I now know that I should have taken the video with a blue or green background... or failing that a pure white background.

    Unfortunately, I've only got the video I have and we can't do a retake.
    I've tried dabbling with After Effects and haven't really got anywhere.

    ANY help/suggestions would be appreciated.

    Thanks.


    Omar
    Quote Quote  
  2. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    I think we need a little more information about the source and the goal. Is this DV-AVI footage, film, mpg2, etc.? You say you want to remove the background from the character, do you intend to replace it with a different background video? How much action is involved with the character? Are you hoping to retain any shadowing? Is this for a home project or something that you are doing for someone else, (semi-pro)?
    If it were me with my non-existant budget, and no high level tools, but plenty of time on my hands, I would probably extract all of the frames to individual stills and do one frame at a time in a photo editor, but obviously that will take a very long time and the reward would really have to be worth it.
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  3. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    thanks for the reply.
    much appreciated.

    i have the original dv footage.
    ideally i'd like to have a 'transparent' background.
    (is that possible!?)
    failing that, a pure white background would do.

    there isn't much movement.
    just the odd arm waiving, nothing else.

    bo shadows required (in fact i wish they weren't there!)

    it's for a project i'm doing for a client.
    the project has dragged on and on and on.
    i need to finish asap.
    so... i would kinda say semi pro.

    high level tools?
    i have the use of lots of advanced software.
    be it on mac or pc.
    what tools would be best to use?

    time...?
    erm... don't really have it.

    how much would it cost to hire someone to edit about 6-7 minutes video altogether?
    Quote Quote  
  4. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    I'm still confused about your goal. Is your final output destined for DVD? or a Web display? or a computer graphic animation? Or are you hoping to mix this with some other footage? For example to have this character standing in front of your clients product.
    what tools would be best to use?
    As I mentioned, I have no high level tools so I'll have to pass that question to one of the more experienced members on the board, but I know it helps to understand the goal so they can steer you in the right direction.
    how much would it cost to hire someone to edit about 6-7 minutes video altogether?
    Strictly amateur here, so I have no idea, but probably more than you'd get from your client
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  5. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    sorry... misunderstood.
    the video footage is for an interactive cd.
    the end video display will be shown in full size.

    hmmm... is there anywhere where there is a place for freelancers doing video work?
    Quote Quote  
  6. Member
    Join Date
    May 2003
    Location
    Peterborough, England
    Search Comp PM
    It's going to take you a while but can be done. I use Ulead Mediastudio Pro which has a Video Paint module. This allows individual frames to be worked on in a workspace very similar to a photo editing package. You would need to do each frame at a time, but it wouldn't take too long as the bulk of the background can simply be erased, it's only close to the edges that will need a bit more care. There's a 30 day trial of Ulead MSP available from www.ulead.co.uk but I have a feeling that not all of the modules are there in the trial. It wouldn't be a lot of use if they don't give you the Video Paint module.
    Quote Quote  
  7. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    is mediastudio pro different to videostudio pro...?
    that's what i've got.
    Quote Quote  
  8. Do you have a shot of the background without the person? Or, did the person move away from the area you marked off at some point (so you could cut/paste to get a clear background image)? If so, there is some hope that you could make the background transparent, although it may not work perfectly.

    The basic idea is to compare each frame to the background image. Where the picture is significantly different than the background will be the person, the rest transparent. I've used this technique with live webcam video (in software I've written). The background must be constant -- lights changing intensity or the person's shadow falling on the wall will mess up the effect. The camera must be perfectly still too.

    This can probably be done with an Avisynth script though I don't know it well enough to write one for you...
    Quote Quote  
  9. What junkmalle proposed might be possible in AviSynth IF indeed the camera doesn't move. If this is the case, perhaps you can post a short clip, then we can give it a try.
    Quote Quote  
  10. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    well... yes and no.
    i have the background with the character in a different place.
    but, the camera is moved to a slightly different location.
    can i still use the footage to do as junkmalle suggests?

    i've uploaded 7 seconds in the following link:

    www.eregeneration.com/andresample/andreSample.avi

    it's the raw dv footage, so it's 22MB in size.

    have a look at that (if you can download!)...
    and tell me what you think.

    thanks.


    om
    Quote Quote  
  11. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    i downloaded an installed avisynth...
    and erm... i can't find the exe??
    am i missing something or what...?
    Quote Quote  
  12. AVISynth doensn't have an EXE like you're expecting. You create text based script files that AVISynth uses to process and feed video to another program. You open the script file as if were a video file in the other program, AVISynth is automatically invoked to process the script.
    Quote Quote  
  13. Member
    Join Date
    Jul 2005
    Location
    UK
    Search Comp PM
    so what might the other program be?
    virtual dubmod?
    and y can't u do what avisynth does in the other program by itself...?
    Quote Quote  
  14. Originally Posted by OM2
    so what might the other program be?
    virtual dubmod?
    Yes, that's one possibility.

    Originally Posted by OM2
    and y can't u do what avisynth does in the other program by itself...?
    AVISynth has lots of filters and logical operators that let you perform manipulations like you're going to need. Most other programs aren't that flexible.
    Quote Quote  
  15. Member havaham's Avatar
    Join Date
    Jan 2002
    Location
    Dallas, TX USA
    Search Comp PM
    You can use After Effects to pull a Difference matte if you have the same scene without your subject matter. (i.e. a blank background) The plugin looks at what's different in the two scenes and keys out what is the same. It's not perfect, but you can use a matte choker plugin downstream to clean up the key a little. This might be the quickest way. The only other way I can see is to rotoscope a mask around her and adjust for every frame...eww!
    Quote Quote  
  16. I don't know AVISynth very well but with a little searching and experimenting I was able to come up with the following script:

    Code:
    LoadPlugin("C:\Program Files\AVISynth 2.5\plugins\MaskTools.dll")
    
    # get the foreground to overlay
    src = AviSource("fg.avi")
    
    #make a YV12 copy of it for the mask
    src12 = ConvertToYV12(src)
    
    #load the clear background to be replaced
    bg = ImageSource("bg.bmp").ConvertToYV12()
    
    #load the new background image
    newbg = ImageSource("newbg.bmp")
    
    #make a mask and contrast stretch it
    mask = YV12Subtract(src12, bg, 10, false).ColorYUV(2560, -50, 0, 0)
    
    #alternate mask with edge smoothing
    #mask = YV12Subtract(src12, bg, 10, false).ColorYUV(2560, -50, 0, 0).SeparateFields.Blur(1.0).Weave
    
    Overlay(newbg, src, 0, 0, mask, 1)
    You'll need to download the MaskTools plugin to use this script.

    I manually created a clear background image with Ulead PhotoImpact's Clone paintbrush tool. I just did a quick dirty job, you can do better if you want to take the time. JPG uploaded here, original was BMP.



    I used some color bars as the new background. Here's a sample of the result:



    As you can see there are a few defects. Her lower legs and feet are partly transparent. Her white shirt is transparent. You might be able to tweek the parameters to get a little better result.
    Quote Quote  
  17. Another sample with a natural background and the alternative smoothed mask:

    Quote Quote  
  18. Here's my attempt. I can't say i'm really satisfied with it



    Used script:
    Code:
    c = AviSource("D:\Temp\andreSample.avi", fourCC="dvsd", pixel_type="yuy2")
    c2 = c.KernelDeint(order=0) # deinterlaced for simplicity
    
    im = ImageSource("D:\Temp\bg.jpg").ConvertToYUY2().Loop(c2.framecount-1)
    diff = subtract(c2,im)
    # the color $7d7d7d is taken from the clip "diff"
    # (between rgb = 100,100,100 and rgb = 150,150,150)
    # can be obtained by corel photopaint for example
    mask_clip = diff.ConvertToRGB32().ColorKeyMask($7d7d7d, 20)
    Overlay(ColorBars(), c2, mask=ShowAlpha(mask_clip), mode="blend", opacity=1)
    Trim(0,c.framecount-1)
    Perhaps the folks at doom9 can help you further
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!