Log in

View Full Version : How to recover details of dark areas


Overdrive80
23rd October 2014, 13:56
Hi, I need help with masktools expressions, I am lost in that. My script is this:


original=last

#/*Prefiltrado*/#

pre=original.BrightDfttestMod(sbright=6.5, smedium=1, sdark=0,tbsize=1,lsb=true)

mascara=original.mt_edge("hprewitt",thY1=8, thY2=255,thc1=0,thc2=255)#.mt_inflate(thY=16)

prefiltrado=mt_merge(pre, original, mascara,u=2,v=2)

#return prefiltrado

#/*Filtrado temporal*/#

tr = 6

super= MSuper(prefiltrado,mt=true)

multi_vec = MAnalyse (super, multi=true, delta=tr, overlap=4,search=4)

last=prefiltrado.MDegrainN (super, multi_vec, tr, thSAD=470, thSAD2=210,plane=4,lsb=true).ditherpost()

#last=mt_lutxy(last,prefiltrado,yexpr="x y - 0 < x y ?") #Recover details of dark areas

I need any expression for recovering details of dark areas, in this case of "prefiltrado" clip. Could somebody help me, please?

fvisagie
24th October 2014, 08:15
What do you mean with "recovering details of dark areas"? Do you want to extract information for some external process or purpose, or do you want to improve detail and/or contrast in dark areas within the video?

If the former, you may need to provide a little more information. If the latter, why not use something straight-forward like HDRAGC()?

feisty2
24th October 2014, 10:49
play with curve kinda stuff
dither_lut16 can get ur work done
just enlight the color, denoise, then restore the color via a reverse curve

bxyhxyh
24th October 2014, 12:05
I use something like this

Original = Source()
# vectors etc...
Denoised = MDegrain()
mask = Denoised.mt_lut("255 x - 1.5 ^ 16 / 64 -") # Values higher than 155 won't be masked.
# Medium values like 118 will be masked lightly.
# Dark parts will be masked heavily.
mt_merge(Denoised,Original,mask)

or just mt_lut("159 x -") works too. Same as above, less biased to dark parts.

Overdrive80
25th October 2014, 14:37
Ok, thanks, but isn't it more accurate to make mask using original.mt_lut("255 x - 1.5 ^ 16 / 64 -")?

bxyhxyh
25th October 2014, 21:54
Ok, thanks, but isn't it more accurate to make mask using original.mt_lut("255 x - 1.5 ^ 16 / 64 -")?

It creates white mask on dark parts of denoised clip, that helps to recover details.

If you use it on original, it would create darker mask on "white grains" and brighter mask on "black grains".
That would be less efficient to keep details on dark parts and less efficient to remove noises on white parts.