VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 56
Thread
  1. As the title states. I use mt_masks and would like to know if it's possible to do this. I'm currently working with animated content and have already figured out how to use mt_binarize, combined with levels in order to apply aggressive degraining to white/light pixels while masking out dark ones.

    So, just like I was able to do this with light pixels, I was wondering if I can incorporate some color function into mt_binarize (or another mask function) in order to aggressively filter red pixels, while masking light/dark pixels. Here's what my current script looks like for filtering light pixels, but masking the others.

    Code:
    mpg2sourece=(blah)
    a=last
    b=Mctemporaldenoise(settings="high", sharp=false, deblock=true, truemotion=true)
    mask = mt_binarize(threshold=65, Levels(20, 0.6, 255, 16, 235). Blur(1.5). FastLineDarkenMOD(). Toonlite(1.0). Toonlite(1.0). santiag(). santiag())
    Overlay(a,b,mask=mask)
    Quote Quote  
  2. In YUV by hue/saturation range - maskhs
    http://avisynth.nl/index.php/MaskHS

    In RGB , you can key out a color range to help create the mask with ColorKeyMask
    http://avisynth.nl/index.php/Layer#ColorKeyMask
    Quote Quote  
  3. Yes, but you can't use this filter in RGB
    Quote Quote  
  4. Originally Posted by Betelman View Post
    Yes, but you can't use this filter in RGB
    Which filter ?
    Quote Quote  
  5. I'm getting an error stating that "mask and overlay must have the same image size! (width is not the same)"

    Here's my script:

    a=last
    b=blankclip(a, color=color_orange)
    mask = MaskHS(startHue=075, endHue=115)
    Overlay(a,b,mask=mask)
    Quote Quote  
  6. [/QUOTE]

    Which filter ?[/QUOTE]

    The masks filter
    Quote Quote  
  7. maskhs works in YUV

    Use ConvertToYV24() before maskhs, if your source is subsampled

    You should view the mask first, and tweak the parameters to see if it covers what you want. You can adjust the parameters (e.g. you might want a high minsat value to exclude lower saturation "reds") . If the hue range is too "wide" you're going to include too many colors


    (Sometimes, it's better to do some operations in RGB. For example, some types of complex keying work better in RGB . You might have to go to RGB and back to YUV in those cases)
    Quote Quote  
  8. Ok, let's backtrack a bit: Nevermind the RGB one, I'm using MaskHS. But it's not working. What's wrong with my script?
    Quote Quote  
  9. Originally Posted by Betelman View Post
    Ok, let's backtrack a bit: Nevermind the RGB one, I'm using MaskHS. But it's not working. What's wrong with my script?
    a=last
    b=blankclip(a, color=color_orange)
    mask = MaskHS(startHue=075, endHue=115)
    Overlay(a,b,mask=mask)
    Specify which clip the mask refers to (in this case, "a"). You need it 4:4:4 (full color), so ConvertToYV24() before MaskHS.

    Try this

    Code:
    a=last
    b=blankclip(a, color=color_orange)
    mask = a.ConvertToYV24().MaskHS(startHue=075, endHue=115)
    Overlay(a,b,mask=mask)
    Tweak the mask for better coverage
    Quote Quote  
  10. Ok, I see what you mean....I converted to YV24(). I'm testing it using the color yellow to see where my actual degrainer would be applied to, but it looks like a splotchy mess! Take a look. No red being filtered here that's for sure.


    Image
    [Attachment 49786 - Click to enlarge]
    Quote Quote  
  11. MaskHS is not very accurate in general. If your goal was the lips (only) , you probably need to soften and expand the mask . You also need to exclude the BG elements, possibly by increasing minsat and adjusting the hue range

    RGB keyers (in composting software, such as after effects, nuke) are a lot more accurate for this type of mask/isolation work by color/hue
    Quote Quote  
  12. Take a look at this one, I used levels from 0-200 and aaaah! she exploded into a yellow mess of post-flu mucus!Image
    [Attachment 49787 - Click to enlarge]
    Quote Quote  
  13. My goal was not the lips at all...my goal is her hair only.
    Quote Quote  
  14. And why is it that every time I post an image, it comes out under your post as well as mine?
    Quote Quote  
  15. Originally Posted by Betelman View Post
    My goal was not the lips at all...my goal is her hair only.

    Most people probably wouldn't call the hair "red" in that screenshot

    This approach will have potential issues on that shot, because there are overlapping hues/colors in the nails , bead necklace, parts of the shading on the phone
    Quote Quote  
  16. Originally Posted by poisondeathray View Post
    you probably need to soften and expand the mask . You also need to exclude the BG elements, possibly by increasing minsat and adjusting the hue range
    Can you please show me a sample script on how to carry this out? I'm not too well-versed in Avisynth.

    Thanks.
    Quote Quote  
  17. Originally Posted by Betelman View Post
    Originally Posted by poisondeathray View Post
    you probably need to soften and expand the mask . You also need to exclude the BG elements, possibly by increasing minsat and adjusting the hue range
    Can you please show me a sample script on how to carry this out? I'm not too well-versed in Avisynth.

    Thanks.
    Don't bother with this approach, too many overlapping hues here if you wanted to isolate the hair

    I assumed you wanted "red" , and I guessed "red lips" (I don't know what color the lips were, you never posted an original shot). But you actually wanted the orangey-red hair
    Quote Quote  
  18. Originally Posted by poisondeathray View Post

    Most people probably wouldn't call the hair "red" in that screenshot
    Then what color is it?

    Originally Posted by poisondeathray View Post
    This approach will have potential issues on that shot, because there are overlapping hues/colors in the nails , bead necklace, parts of the shading on the phone
    I've been noticing that issue when using mt_binarize, although it helped alot for other purposes.
    Quote Quote  
  19. So what approach would be more effective here?
    Quote Quote  
  20. Originally Posted by Betelman View Post
    So what approach would be more effective here?
    If you wanted accurate mask of only the hair? - Using other programs . Mask tracking, assisted rotoscoping
    Quote Quote  
  21. Wait a sec, look at this---I'm using starthue=50 and endhue=130 and I'm getting an improvement in coverage! (yes, I changed the color to green, but remember, this is just so I can see where my degrainer would go. I'm not trying to change any colors here). Ok, so can you show me a script where I can tweak this?

    Image
    [Attachment 49788 - Click to enlarge]
    Quote Quote  
  22. Just play with the parameters until you get something that you think is acceptable. Also play with minsat, maxsat

    It's unlikely that you will get an accurate mask with this method of the hair only. It will include the necklace/beads, parts of the phone, nails, possibly the lips - because of the shared hues/colors
    Quote Quote  
  23. Don't leave me now, Poison as I'm about to discover the holy grail of avisynth masking!! You know they call me the "Mask Figure-Outer" and I want to live up to that reputation.
    Quote Quote  
  24. You've mentioned her lips twice---you want to see her actual lips don't you? Oh you devil you!
    Quote Quote  
  25. You might be able to refine it by using other adding/subtracting other masks

    For example, if "dark" background is unwanted, so might be able to exclude that by using a luma mask . But this also raises potential issues with dark lines

    It's just that using that hue/saturation method alone isn't going to work well. It's like wearing a green shirt to a green screen shoot.
    Quote Quote  
  26. Originally Posted by poisondeathray View Post
    the "dark" background is unwanted, so you can exclude that by using a luma mask
    or a binary mask.

    But yes, I'm toying around with other parameters and I seem to be getting what I want. I don't mind other reddish items in the clip filtered, honestly as long as the black background doesn't get involved in my business.
    Quote Quote  
  27. Woohoo, look at me go!! This is actually pretty damn good. Thanks Poison!

    Image
    [Attachment 49789 - Click to enlarge]
    Quote Quote  
  28. There are those lips ! And they are.... pink

    I hated her voice

    Looks like slimer on her head . (Yes I know, the green is just visualizing the mask)
    Quote Quote  
  29. Hey! I didn't mean for you to see her lips!!! that was what I call a ...lip slip.

    Ok, but don't go posting them all over the internet now. Keep it here!

    Her lips are our secret.
    Quote Quote  
  30. The last thing I would use for this would be AVISynth. It is a piece of cake to do in Vegas (Pro or the consumer version) using the "Secondary Color Corrector." Just click on the color you want to use as a mask, and then adjust the mask parameters (hue range, luminosity range, and saturation range) while watching the mask. You can then easily feather the mask, if you wish (probably not useful for anime). Once the mask is created, you can then modify the area you've selected in just about any way you can imagine.

    AVISynth seems, to me, to be the wrong tool for this, although it is certainly an interesting discussion.

    This is less than 30 seconds of work.

    Image
    [Attachment 49790 - Click to enlarge]
    Last edited by johnmeyer; 13th Aug 2019 at 21:32. Reason: added image
    Quote Quote  



Similar Threads

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