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. |
7th August 2015, 17:50 | #1 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Which blur to use for Local Contrast Enhancement?
On the one hand,
Code:
#Unsharpen (it will sharpen the image) function unsharpen(clip c,float variance,float k) { blr=gaussianblur(c,vary=variance,varc=2,Y=3,U=2,V=2,border=1) return yv12lutxy(blr,c,"y x - "+string(k)+" * y +",y=3,u=2,v=2) } Using this radius-variance relationship to provide similar settings for comparing MedianBlur() and GaussianBlur() LCE outputs with the function Code:
function unsharpenmod(clip c, float "variance", float "strength", bool "chroma", string "blurfn") { variance = Default(variance, 128.0 ) strength = Default(strength, 0.2 ) chroma = Default(chroma , true ) blurfn = Default(blurfn , "gaussian") vbU = chroma ? 3 : 1 vbV = vbU radiusY = Round(Sqrt(variance)*Sqrt(Log(255)/Log(2)) - 1) radiusU = chroma ? radiusY : -256 radiusV = radiusU mtU = chroma ? 3 : 4 mtV = mtU blurfn = blurfn == "gaussian" ? \ "gaussianblur(c, varY=" + String(variance) + ", varC=" + String(variance) + ", Y=3, U=" + String(vbU) + ", V=" + String(vbV) + ")" : \ blurfn == "median" ? \ "Medianblur(c, radiusY=" + String(radiusY) + ", radiusU=" + String(radiusU) + ", radiusV=" + String(radiusV) + ")" : \ """Assert(false, "unsharpenmod: Invalid blur function")""" blr = Eval(blurfn) return mt_lutxy(blr, c, "y x - " + string(strength) + " * y +", y=3, u=mtU, v=mtV) }
Is that assessment correct and complete (at least for chroma-enabled cases)? If not, what improvements are necessary? What kind of blur is normally preferred for Local Contrast Enhancement, and why? Thanks, François EDIT: Despite the text "Attachments Pending Approval", they are already clickable. Last edited by fvisagie; 7th August 2015 at 17:52. Reason: Attachment status |
8th August 2015, 00:23 | #2 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
|
8th August 2015, 11:25 | #3 | Link | ||
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Quote:
Quote:
|
||
15th August 2015, 16:47 | #4 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
This won't answer your questions but here's a video that I came across yesterday: Local contrast enhancement: gaussian vs. bilateral blurring
|
Thread Tools | Search this Thread |
Display Modes | |
|
|