Recensubs HQ

DehardSub

« Older   Newer »
  Share  
Liquid Dr4k3
view post Posted on 11/7/2015, 14:07 by: Liquid Dr4k3     +1   -1
Avatar

Distruttore di mercati

Group:
Utente abilitato
Posts:
682
Reputation:
+163
Location:
Aiur

Status:


Modificata la funzione di masking:

CODICE
function DehardMask(clip clp, int "RGmode", int "expandN", int "inflateN", bool "blur_more", int "LumaTHR", int "BinarizeTHR")
{
Lthr = default( LumaTHR,  233 )
Bthr = default( BinarizeTHR,  1 )
RGmode = default( RGmode,  3)  # spatial filter to remove false positive (noise, compression artifact and so on) , this is its mode
expandN = default( expandN,  7 ) # how many mt_expand
inflateN = default( inflateN,  7 ) #how many mt_inflate
blur_more = default( blur_more,  false ) #additional blur after resize

Luma=clp.mt_binarize(Lthr,upper=false).Removegrain(RGmode,-1).mt_expand().mt_inflate()
Edge=clp.mt_lut("x 2 /").mt_edge("hprewitt",200,250).Removegrain(RGmode,-1).mt_expand().mt_inflate()

Mask=mt_logic(Luma,Edge,"min").Histogram("luma").mt_lut("x 128 - 0 > x 1 - 128 > x 1 - 128 ? x 1 + 128 < x 1 + 128 ? ?",u=1,v=1)

expanded = Mask.expandMask(expandN)
inflated = expanded.inflateMask(inflateN)
final = blur_more ? inflated.Removegrain(12,-1) : inflated
return final.Greyscale().mt_binarize(threshold=Bthr,upper=false)
}

function expandMask(clip clp, int "expandN")
{
return expandN > 0 ? expandMask(clp.mt_expand(u=1,v=1), expandN - 1) : clp
}

function inflateMask(clip clp, int "inflateN")
{
return inflateN > 0 ? inflateMask(clp.mt_inflate(u=1,v=1), inflateN - 1) : clp
}


leggermente meno safe, anche se provandola ho visto che non si perde nulla, ma pił furba visto che riesce a limitare il pił possibile l'area mascherata ai soli sub funi.

Edited by Liquid Dr4k3 - 13/7/2015, 23:16
 
Top
4 replies since 9/7/2015, 15:27   1291 views
  Share