Directionnal median tool?

Hi there.
Was wondering if there is a way to make a median filter but directional? Have been in a massive cleanup job recently where it would have been a super great tool.

Thx all.

A2Beauty has an angle option, Bilateral also gives you an X and Y amount…

Sapphire Median also has an X and Y value.

Not sure if that helps though, if you’re looking to “stretch” your Median directionally.

Object Obliterator, maybe?

Thx for the feedback. Tried all these options but not quite what I’m looking for.
All that blurs in on direction (and some options like A2beauty get some details back) but I’m looking for something like Dollface that would retain hi contrast transitions but only in one direction instead of x and y equally. Don’t know if that makes sense.

1 Like

Haven’t tried Sapphire option though.

Sapphire Median is quite close yes, thx.

Any chance someone would be smart enough to make a matchbox for that?

1 Like

What about frequency separate and blur the bits you want then put it back together? Use Lewis Saunders matchbox to separate and combine.

Yes. Still not exactly what I have in mind but I do that all the time as I do a lot of beauty work.
Thx for the input.

If you’re just working on a small part of the frame could you stretch the image 1000% on desired axis, run a regular median, and then squash it back down 10% on same axis to restore image to normal aspect again? Thus reducing the effect of the median on one particular axis?

2 Likes

Interesting approach! Will keep that in mind.

I do non uniform and directional medians all the time! Total bread and butter in my workflow.

My base median workflow is this:

Denoise node, with the median box checked. Now, instead of applying this to the plate and cranking it up, which is slow as heck, I resize much smaller first, do a median of 2 and then resize back up. It’s great, because the stronger you make the effect, the FASTER is processes.

For a 1920x1080 plate, I’ll resize to 10% so 192x108 to start. This is already 100x faster in terms of amount of pixels to process. From there, to REDUCE the effect, I’ll make the input resize LARGER. To INCREASE the effect, I’ll make the input res SMALLER. Note, that as you adjust this, the flame tries to help and adjust the median value so you’ll need to keep changing this back to 2. You can adjust the X and Y resolution of the first resize independently for biased median effects.

You’ll want to adjust the filtering of the resize nodes. Lanczos is a little too sharp and can be steppy. You want something softer. I use quadratic on the downres and triangle on the upres. You can adjust the crisp/soft slider of the triangle filter to soften to taste. You can certainly use other filtering, but this has worked well for me. At the end of the day you have a giant median/blur so softness is your friend.

Plate > resize down ~10% to start (adjust to taste), quadratic filtering > denoise with median checked, set to 2 > resize to orig res, triangle

Now to the directional part:

A directional blur is basically a rotate, blur on X, rotate back. So we just do the same with our median. Rotate to desired blur angle before the median workflow, median only on X, rotate back.

To median on X, simply leave the Y resolution of the first resize at the original res before the median. Yes this will technically still apply a median of 2 but at the full res it’s not very noticeable. You could double your Y res if it really matters.

When you rotate, if the picture is near edge of frame it will crop. To solve this, you can rotate in action with overscan turned on, rotate, median, rotate back and crop back down.

1920x1080 would be something like this:

Plate > 2D transform/action (rotate) > resize to 192x1080 (if overscan turned on, 1080 should equal new height), adjust X to taste > denoise with median checked, set to 2 > resize to orig res > rotate back (crop to original res if necessary)

That’s basically it!

7 Likes

Thx. Sounds really interesting . I’ll put my hand on it so it becomes clearer this weekend.
I’ll try to let you know.

I thank you, TheMotizzle. You showed me this years back and this basic setup has forever since been in the first five slots of my User node bin.

digitalbanshee’s Object Obliterator is well known here and I’ve always thought of your technique as the Detail Destroyer®! :grin:

I would add to your process notes above that I set the first and last Resize nodes to w:h aspect and Fill mode. This will prevent any window- / pillar-boxing as part of the process.

Yes I almost forgot about setting resize to fill and w:h. Very important. Good call Chris! Detail Destroyer: I like it! It’s no Edge Assure, though amirite?

TheMotizzle –

Your Detail Destroyer® is far more useful than the ol’ EA.

One other thing that I remember you doing was directional diagonal medians on all angles between 0Âş and 180Âş with two 2D Transform nodes + some expressions to rotate and un-rotate the source!

Yes linking the rotate and unrotate def speeds up the process. You can also set the first 2d transform to auto scale so it doesn’t crop and have the second one crop back to original res.

Hi TheMotizzle.
So I’ve been doing a few tests with your method and it’s very nice.
I really love the fact that the more effect you want, the faster it is. Brilliant.

Very nice tip. It’ll surely have a place in my user been bin. Thx.

I still think it would deserve a Matchbox node as I’ll use it a lot. If anyone feels gifted enough… :wink:

1 Like

Awesome, glad it’s working out for you!

1 Like