Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th January 2014, 14:00   #21  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Nice filter, thanks. I am trying remove this rainbow but I be not able to do it.

I post a split of original source. Rainbow shows in white T-shirt. https://db.tt/zvbOXyTE

Thanks.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 25th January 2014, 21:09   #22  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Overdrive80 View Post
Nice filter, thanks. I am trying remove this rainbow but I be not able to do it.

I post a split of original source. Rainbow shows in white T-shirt. https://db.tt/zvbOXyTE

Thanks.
You are not able to because the rainbow moves. Bifrost can't fix rainbows that move.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 27th January 2014, 00:01   #23  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Ok, thanks.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 28th January 2014, 12:33   #24  |  Link
Kurosu
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 432
My solution some years ago was to use a strong blurring (like an adaptive gaussian filter with high thresholds) followed by some warpsharping on chroma-only to reduce chroma bleeding. Maybe the two could be combined with a temporal activity mask.
Kurosu is offline   Reply With Quote
Old 30th January 2014, 13:18   #25  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Overdrive80 View Post
Ok, thanks.
try

from sh0dan script but with masktools2

Code:
function DeRainbow(clip org, int "thresh")
{ 
  assert(org.isYV12(),"DeRainbow() requires YV12 input!")
  thresh = default(thresh, 10)

  org_u = utoy(org)
  org_v = vtoy(org)

  msharpen(org, threshold = thresh, mask=true)
  reduceby2()
  greyscale()
  uv = blur(1.5).levels(0,2.0,255,0,255, coring=false).blur(1.5).blur(1.5).levels(50,2.0,255,0,255, coring=false)

  filtered_u = org_u.blur(1.5).blur(1.5).blur(1.5).temporalsoften(2,255,0,3,2)
  filtered_v = org_v.blur(1.5).blur(1.5).blur(1.5).temporalsoften(2,255,0,3,2)

  u_final = mt_merge(org_u, filtered_u, uv)
  v_final = mt_merge(org_v, filtered_v, uv)

  return ytouv(u_final, v_final, org)
}
Usage:

YV12: DeRainbow(int thresh)

Threshold is optional, and defaults to 10 (which is fairly strong).

Required plugins:
MipSmooth.
Masktools2.
mSharpen.

I found it in my avs autoload folder that I originally take it from a friend

it work good on your sample
real.finder is offline   Reply With Quote
Old 1st February 2014, 07:24   #26  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Quote:
Originally Posted by Kurosu View Post
My solution some years ago was to use a strong blurring (like an adaptive gaussian filter with high thresholds) followed by some warpsharping on chroma-only to reduce chroma bleeding. Maybe the two could be combined with a temporal activity mask.
Sounds heavy-handed and suboptimal. I recommend using motion-compensation instead.

Here is what I routinely use:

Code:
#you need to have progressive video for this.
prerb = last
derbmask = tedgemask(threshY=9).mt_inflate()
derbsuper = MSuper()
derbbackward_vectors = MAnalyse(derbsuper, truemotion = true, isb = true, chroma=false)
derbforward_vectors = MAnalyse(derbsuper, truemotion = true, isb = false, chroma=false)
derbforward_compensation = MCompensate(derbsuper, derbforward_vectors)
derbbackward_compensation = MCompensate(derbsuper, derbbackward_vectors)
interleave(derbforward_compensation,last,derbbackward_compensation)
dfmderainbow(maskthresh=10) # Divine Buster!
selectevery(3,1)
mt_merge(prerb,last, derbmask,luma=true)
DFMDerainbow is hell of an old function, but sadly I have not found anything better so far. It must be possible to make something better, but alas nobody with the right skills/knowledge has done so
I definitely don't recommend it without edge-masking and motion-compensating (which the above does). Fluxsmooth is too dumb and the chroma blurring this thing does is quite destructive, if not contained.

(I tried mdegrain for the denoiser part, but that has severe issue with flashing pictures. You will get pretty horrible chroma bleeding into next/previous frames.)

Last edited by mandarinka; 1st February 2014 at 07:28.
mandarinka is offline   Reply With Quote
Old 1st February 2014, 19:07   #27  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by mandarinka View Post
Sounds heavy-handed and suboptimal. I recommend using motion-compensation instead.

Here is what I routinely use:

Code:
#you need to have progressive video for this.
prerb = last
derbmask = tedgemask(threshY=9).mt_inflate()
derbsuper = MSuper()
derbbackward_vectors = MAnalyse(derbsuper, truemotion = true, isb = true, chroma=false)
derbforward_vectors = MAnalyse(derbsuper, truemotion = true, isb = false, chroma=false)
derbforward_compensation = MCompensate(derbsuper, derbforward_vectors)
derbbackward_compensation = MCompensate(derbsuper, derbbackward_vectors)
interleave(derbforward_compensation,last,derbbackward_compensation)
dfmderainbow(maskthresh=10) # Divine Buster!
selectevery(3,1)
mt_merge(prerb,last, derbmask,luma=true)
DFMDerainbow is hell of an old function, but sadly I have not found anything better so far. It must be possible to make something better, but alas nobody with the right skills/knowledge has done so
I definitely don't recommend it without edge-masking and motion-compensating (which the above does). Fluxsmooth is too dumb and the chroma blurring this thing does is quite destructive, if not contained.

(I tried mdegrain for the denoiser part, but that has severe issue with flashing pictures. You will get pretty horrible chroma bleeding into next/previous frames.)
Compared to sh0dan DeRainbow above? I didn't work on any source with rainbow previously, Could you tell me the strengths and weaknesses for each of them?

--------

edit: my try https://pastebin.com/j5JVNwSP using mt_motion for motion and edge, and of course other filters

ASTDR default values may be high, ASTDR(3,15,2,FluxStv=30,edgem=true) should be enough and without noticeable artifacts or use ASTDRmc
__________________
See My Avisynth Stuff

Last edited by real.finder; 12th July 2019 at 03:20. Reason: new ASTDR DeRainbow edit
real.finder is offline   Reply With Quote
Old 1st February 2014, 21:34   #28  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Quote:
Originally Posted by real.finder View Post
Compared to sh0dan DeRainbow above? I didn't work on any source with rainbow previously, Could you tell me the strengths and weaknesses for each of them?
DeRainbow (this? I'd say it is fairly obsolete today...) is IIRC just spatial, so it doesn't make use of temporal filtering. You would be throwing away quality of the source needlessly.
Edit: oh wait, you posted a different version. I didn't try that. It has temporalsoften (instead of fluxsmooth in DFMDerainbow), so you could try to motion compensate it.

DFMDerainbow does something similar to its spatial processing (if not the same, the blur/deen combination looks familiar), but in addition it removes rainbows based on content in next/previous frames - and if you motion compensate it, this works even with motion (to some extent of course). That snippet also has an edge mask to limit the damage.

Last edited by mandarinka; 1st February 2014 at 21:55.
mandarinka is offline   Reply With Quote
Old 4th February 2014, 16:08   #29  |  Link
Kurosu
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 432
Quote:
Originally Posted by mandarinka View Post
Sounds heavy-handed and suboptimal. I recommend using motion-compensation instead.
Sounds slow and mostly applicable to limited amount of rainbows.

But then again, my solution is 10-years-old.
Kurosu is offline   Reply With Quote
Old 5th February 2014, 11:21   #30  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
That's what I meant. 10 years later, more sophisticated techniques are available.
mandarinka is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.