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 > Avisynth Usage
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 25th October 2014, 08:23   #1  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
New approach to fine detail sharpening without edge halos. Very fast, HD also.

Hi,

this message has been edited to point your attention to ready to go solution of how you can

1. fine-sharpen your Full-HD material
2. without edge halos or pushed up contrast of mid-detail
3. with optional and highly effective temporal degraining and denoising

Look at post #62 of page 4 in this thread.

---- Old discussion
I have had so much benefit from this forum in search of "my" sharpening solution. It seems I´ve got it now and would like to share it with you.

The Full-HD videos of my Nikon D5300 Camera are best with defensive internal sharpening and sharpening in post. Due to agressive noise-reduction out-of camera fine detail is somewhat underdeveloped. So a detail-sharpener is needed which emphasizes fine contrast without pushing overall contrast of mid-detail and without ugly edge haloing. After WEEKS of research I came back to this 10-year old avisynth code:

http://forum.doom9.org/archive/index.php/t-76257.htm.

This is a fast and simple yet very effective unsharp mask with edge limiting. Thanks to who ever wrote this!

If you set strength (s) to 40 and small edge mask width (w) to 1-5, you will get a fine detail emphasizing effect without new edge halos. There are only two remaining issues: Deliberatly soft structures like clouds tend to form colour blocks and may get sharp edges where there are none. Second, already EXISTING edge halos (due to in-camera presharping) will get emphasized too. So I added/changed the following:

I replaced the old simple blur(1.58) with the more developed binominalBlur() from the variableblur package and the cloud-issue was almost gone (GaussianBlur did not show better results but only slowed down performance heavily). Second I applied DeHalo_alpha() to reduce remaining edge halos.

This is now my favourite sharpening solution among those I tried out. Consider that you have to balance detail sharpening and noise enhancement using the "s" and "w" parameters.

Feel free to try out this code with your high-definition footage. Your comments and suggestions are most welcome.

#################
# Sharpening (unsharp masking) of fine details avoiding edge halos or harsh contrast (by Hotte).
#
# Make sure you installed external filters "variableblur" and "DeHalo_alpha" with dependant filters
# Load source and convert. Binominal blur needs YV12.

x=avisource("blabla.avi").convertToYV12

# Set unsharp-mask parameters.
# s=strength of sharpening, 1 to 40=subtle, 70=significant, 100=strong (few artefacts), 127=maximum (strong artefacts)
# w=width of mask, 1-5=very fine detail only (almost no halos), 12=overall (some stronger halos)

s=40
w=5

# perform unsharp masking (see link above): fine blur, subtract negative, subtract whole mask from original

i=x.binomialBlur(varY=0.5, varC=0, Y=3, U=2, V=2, useMMX=true)
j=subtract(i,x).levels(0+s,1,255-s,0,255)
w=w*(128/s)
k=j.levels(127-w,1,128+w,127-w,128+w)
subtract(x,k)

# A subtle dehalo of large sharpening edges. highsens limits edgemask to larger edges rather than fine ones.
# DeHaloAlpha reduces sharpening a tiny bit. Increase width of sharpening mask by 1 or 2 for compensation.
# If you like geometrical structures being less aliased turn ss to 1.5, but it will reduce speed to 40%.

DeHalo_alpha(highsens=100,ss=1.0)
#################

In my environment this code runs multithreaded without issues if you put the following statements on top. This way I am getting crazy 35fps and 'round 80% CPU usage on an elderly i7 Quadcore (supersampling switched off (ss=1.0)):

SetMemoryMax(1024)
SetMTMode (4,4) # announce multithreading Mode 4, use 4 cpu-cores

Last edited by Hotte; 18th November 2014 at 21:52.
Hotte is offline   Reply With Quote
 

Tags
detail, fine, full-hd, sharpen, unsharp mask


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 00:24.


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