That is certainly something to consider except for the fact that I want to apply Avisynth filters to it. So even if I get Vegas and mask these parts, how can I go about completing my task?
So for example, I would want to apply McTemporalDenoise at strong settings to the hair and face, while perfectly masking the lines and the dark background (since McTemporalDenoise is terrible with dark scenes and figures). Then on the second pass, I'd use smdegrain() to degrain the entire clip, but with the focus on the dark backgrounds and figures.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 56 of 56
Thread
-
-
I have tried line masking, but that doesn't cover dark figures and backgrounds. Mt_binarize does that, but it doesn't mask the lines as accurately. I wish there was some way to merge the two (mt_edge and mt_binarize) and create a mask that can complete both tasks, masking lines AND dark backgrounds/figures.
-
-
-
Oh I didn't know I could do that (mask it with one program, and proceed with Avisynth). I was under the impression that Avisynth would not recognize the mask, since it wasn't created using Avisynth to begin with. Interesting. Well, it's back to the old drawing board for me. I'll keep you posted. Thanks PDR and JohnMeyer.
-
I do this all the time. I do something in Vegas and then use the free frameserver (from Debugmode.com) to serve into AVISynth. If you want to pass AVISynth the mask, then in Vegas replace the section that is masked with pure black. Even in animation, nothing is pure black. Then, in AVISynth you just look for pure black, which is a trivial operation, and do whatever you want.
Vegas Pro is indeed expensive, but Vegas Movie Studio is less than $50, and it has the Secondary Color Corrector, as I stated in my last post. What's more, you can get it for next to nothing if you order a version that is one or two versions out of date. I still do 98% of my editing on versions (I have four different Vegas installation) that are almost ten years old. You really don't need the latest version, at all. I did zero research, and here is one listing that for the previous version (14) for $19:
https://www.amazon.com/VEGAS-Movie-Studio-14-Platinum/dp/B01NBYOMJD/
If you are willing to deal with eBay, here is an in-the-box version 13 (which is the latest version I own, and perfectly adequate for doing anything) for $6.50, shipped. -
-
I finally downloaded the trial, and I have no other way of knowing how to put this because I'm actually not really used to working with these type of editors but: What on earth am I supposed to do with this software? It is extremely overwhelming. There have to be more than three million options and that's just for saving the thing as a project. I don't understand why or how anyone can work with this arrogant, overly engineered P.O.S. Heaven forbid there's just a simple button that says "color corrector", where you click it and then the options are there. No, you have to go through an enchanted forest just to find the damn thing. Why did they design it like this? Who has the ******* patience? The task in and of itself is difficult as it is, so they can't at the very least make the interface user friendly?
-
Just for fun I made a function that works like MaskHS() but works with YUV:
Code:function MaskYUV(clip c, int "min_y", int "max_y", int "min_u", int "max_u", int "min_v", int "max_v") { min_y = default(min_y, 0) max_y = default(max_y, 255) min_u = default(min_u, 0) max_u = default(max_u, 255) min_v = default(min_v, 0) max_v = default(max_v, 255) mask_y = Overlay(mt_binarize(c,min_y), mt_binarize(c, max_y, upper=true), mode="multiply") mask_u = Overlay(mt_binarize(c.UtoY(),min_u), mt_binarize(c.UtoY(), max_u, upper=true), mode="multiply").PointResize(c.width, c.height) mask_v = Overlay(mt_binarize(c.VtoY(),min_v), mt_binarize(c.VtoY(), max_v, upper=true), mode="multiply").PointResize(c.width, c.height) fullmask = Overlay(mask_v, mask_u, mode="multiply") fullmask = Overlay(fullmask, mask_y, mode="multiply") return(fullmask) }
Code:ImageSource("image1.jpg", start=0, end=240, fps=23.976) ConvertToYV12() a=last b=blankclip(a, color=color_green) m1 = MaskYUV(min_y=50, max_y=80, min_u=90, max_u=120, min_v=150, max_v=175) m2 = MaskYUV(min_y=35, max_y=50, min_u=110, max_u=115, min_v=150, max_v=160) mask = Overlay(m1, m2, mode="add") Overlay(a,b,mask=mask)
[Attachment 53541 - Click to enlarge]
As you can see, I built two masks, one for the lighter parts of the hair, one for the darker parts of the hair, then added them together. -
Just for fun, or just to help?
I don't believe I asked for anyone here to toy around with my question "just for fun", so I'll take it you did it to help. In which case, just say so. Don't try to be all suave about it Jagabo, I promise it won't take anything away from your super-duper macho-manic Monday.
Now, your mask is an interesting one, but I have to ask: I notice a pattern in your mask of min/max numbers. What is that all about? (In plain English, if possible) -
Those are YUV bounding boxes around the two main colors in her hair. You can get the YUV values in many ways. One is like this:
Code:ImageSource("image1.jpg") ConvertToYV24() Crop(240,34, 24,24) # look at just the brighter hair color StackHorizontal(greyscale(), UtoY(), VtoY()) # view Y, U, V planes as greyscale ConvertToRGB(matrix="pc.601") # convert to RGB with pc.601 matrix to retain actual values (Y=R=G=B)
[Attachment 53581 - Click to enlarge]
Then read the values of the three blocks in an editor, with a screen RGB reader, etc. You can see that the Y block is about 63, the U block about 100, and the V block about 168. The the min values are set a little lower than those, the max values a little higher. Adjust to suit.
Code:min_y=50, max_y=80, min_u=90, max_u=120, min_v=150, max_v=175
-
Another way to get YUV values is to use ColorYUV(analyze=true):
Code:ImageSource("image1.jpg") ConvertToYV24() Crop(240,34, 24,24) # look at just the brighter hair color PointResize(640,256) # needs to big enough to show text ColorYUV(analyze=true) # show YUV stats
[Attachment 53584 - Click to enlarge] -
Well that's gonna be a load to study. Thanks. I'll check into it this weekend and come back with maybe 1 or 2 more questions or comments.
-
Ok, just by looking at this, please tell me if I have this correctly:
1. You checked the YUV color values of her hair on an editor. The editor showed you what the average/max/min values are for each channel on her hair color (the Y luma, the U chorma and the V chroma).
2. You then took those values and incorporated them in your mask, adjusting the values little lower than the minimum, and a little higher than the maximum, according to coverage needed.
am I correct so far?Last edited by Betelman; 29th May 2020 at 17:46.
-
Also, this is based on the understanding that, just like the RGB colorspace, YUV rangers from 0 (0 being total black) to 255 (255 being total white), yes?
-
Yes.
And yes. Though note that rec.601 video only Y values from 16 to 235, and U/V values from 16 to 240 are "legal" colors.
Note that MaskHS() usually makes more sense for this type of masking. When you have an object of a solid color in light and shade it typically has the same hue in both the bright and dark areas.
[Attachment 53591 - Click to enlarge]
Notice how all the shades (dark to bright) of the three different hues (yellow, red, blue) of the hot air balloon fall in lines from the center (low saturation, grey-ish) toward the edges (high saturation, pure color).
Here's an animation that shows 10 degree wide hue wedges (across all saturations), 10 percent wide saturation rings (across all hues), and the combination of the two:
Code:function GreyRamp() { black = BlankClip(color=$000000, width=1, height=256, pixel_type="RGB32") white = BlankClip(color=$010101, width=1, height=256, pixel_type="RGB32") StackHorizontal(black,white) StackHorizontal(last, last.RGBAdjust(rb=2, gb=2, bb=2)) StackHorizontal(last, last.RGBAdjust(rb=4, gb=4, bb=4)) StackHorizontal(last, last.RGBAdjust(rb=8, gb=8, bb=8)) StackHorizontal(last, last.RGBAdjust(rb=16, gb=16, bb=16)) StackHorizontal(last, last.RGBAdjust(rb=32, gb=32, bb=32)) StackHorizontal(last, last.RGBAdjust(rb=64, gb=64, bb=64)) StackHorizontal(last, last.RGBAdjust(rb=128, gb=128, bb=128)) } function AnimateHS(clip v, int StartH, int EndH, int StartS, EndS) { black = BlankClip(v) hsmask = v.MaskHS(StartHue=StartH, EndHue=EndH, MinSat=StartS, MaxSat=EndS) Overlay(v, black, mask=hsmask) Subtitle("StartHue="+String(StartH)+" EndHue="+String(EndH)) Subtitle("StartSat="+String(StartS)+" EndSat="+String(EndS), y=20) } GreyRamp() ConvertToYV24() YtoUV(last, TurnRight(last), ColorYUV(cont_y=-256)) black = BlankClip(last) ah = Animate(0, 180, "AnimateHS", last,0,10,0,100, last,350,360,0,100) as = Animate(0, 180, "AnimateHS", last,0,360,0,10, last,0,360,90,100) ab = Animate(0, 180, "AnimateHS", last,0,10,0,10, last,350,360,90,100) StackHorizontal(ah, as, ab)
[Attachment 53592 - Click to enlarge] -
Ok, whoah whoah slow down there my friend!
I appreciate the knowledge but you throwing the entire library at me doesn't help! Easy!
I'm asking these questions piece by piece because I know that folks here tend to go off in tangents like these. I'm not an expert at this nonsense in any way shape or form, so take it easy and use some knowledge lube on me, okay? -
None of this is tangential to what you want to do. It's an attempt to help you understand what MaskHS is doing.
-
It's ok....in reality I'm just doing some noise filtering and only used the colors (in my initial post) to show where I was applying which denoiser. Thanks though, Mr. Brittanica
-
You don't need to understand how the script in post #50 works. Just look at what it does. Note how the masking changes as the numbers change.
Similar Threads
-
Avisynth mask to target plain colors?
By nMaib0 in forum Newbie / General discussionsReplies: 18Last Post: 23rd Apr 2018, 17:55 -
Encode for Target Size Fixed!!
By Cauptain in forum Video ConversionReplies: 13Last Post: 21st Oct 2016, 16:32 -
encode with X264 @ target size
By marcorocchini in forum Newbie / General discussionsReplies: 4Last Post: 2nd Sep 2016, 08:48 -
X264VFW encoding @ target size
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 11th Feb 2016, 20:34 -
VirtualDub, Xvid and target size
By lagartixa in forum Newbie / General discussionsReplies: 57Last Post: 8th Nov 2014, 08:11