Advanced Sharpen and dual threshold

Moderator: jsachs

tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Advanced Sharpen and dual threshold

Post by tomczak »

In the AS Sharpen tab, low roughness areas/minor edges can be excluded by thresholding sliders. I find it often useful to also exclude the most contrasty edges as they are often responsible for the most visible, largest halos which make the image, if nothing else, look unprofessional. The way I do it is by edge masking, but it's quite finicky an operation (the edge finding radius, its bluring radius and its intensity need to match the sharpening halos for the major edges to effectively cut them down, but leave lesser edges still sharpened). Another way is to fix those edges by hand after sharpening by e.g. 1:1 cloning from unsharpened version.

I was thinking that if AS Sharpen had dual threshold sliders (similar to Mask Colour Range) then one could exclude either or both ends of the roughness histogram, fluidly. Blocking sharpening to both the fine noise and the largest edges would allow AS to be used as local contrast enhancer, similarly to Bilateral Sharpen.
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

An example of restricting major halos, in addition to AS.
Attachments
AS Sharpened + roughest edges reduced
AS Sharpened + roughest edges reduced
3ASharpenedMasked.jpg (42.6 KiB) Viewed 5955 times
AS Sharpened
AS Sharpened
2ASharpened-1.JPG (47.26 KiB) Viewed 5967 times
Unsharpened RAW
Unsharpened RAW
1Unsharpened.jpg (32.46 KiB) Viewed 5954 times
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

I have finally figured out what the two threshold sliders in AS/Speck Removal actually do, and thus how to use them properly, and I'm so happy about it that I decided to share it with the rest of the world!

It's best explained with a simulated screenshot:

- The Speck Difference Threshold slider exclude specks in the lowest contrast range; this is identical to having an (imaginary) second threshold slider under the histogram instead.
- The existing 'glued-triangles' Threshold slider under the histogram exclude specks in the highest contrast range

Effectively, the AS (but only the Speck Removal tab) already has a dual (hard)threshold logic that allow to isolate and deal with specks of any contrast range, by controlling what's excluded from both tails of the histogram.
Attachments
AS_SpeckThreshold.png
AS_SpeckThreshold.png (21.34 KiB) Viewed 5847 times
Maciej Tomczak
Phototramp.com
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Advanced Sharpen and dual threshold

Post by den »

Maceij...

I downloaded the "Unsharpened RAW" image and have tried various Speck Removal and Sharpen tab settings to duplicate your AS examples...

Is there a combination of settings that does not produce the single bright pixels yet minimizes halos and retains sharpness?
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

In Mask/Texture, there are 3 roughness computing methods. Which of them would give closest results to the method that AS is using to calculate Blur and Sharpen roughness histograms?
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

Den,

I'm not sure what settings I've used anymore, I'll experiment again and let you know.

The whole idea was to show, as a proof of concept, that if AS Sharpen (and perhaps Blur) tab had the ability to restrict blurring/sharpening to both ends of the roughness histograms, that would make AS much, much more powerful, without having to change much of its logic!

All I've done is to use Sharpen Tab only, and simulated nonexistent high roughness thresholding slider (to reduce sharpening and thus halos on rough edges) by using a Texture mask that was thresholded (and blurred a little) so that only rough edges were covered (Average Difference seems to work best).

The white specs are probably the result of too small radius and too high sharpen amount, without much room in the highlights to accommodate sharpening white overshoots - sharpening was admittedly overdone to illustrate the concept.

But incidentally, this is a good example for practicing the thresholding in Specks tab (see above for how it does it). The Speck Difference Threshold (lower threshold) and the Histogram threshold (higher threshold) sliders need to be adjusted so that only the specks are shown in the Difference view. Since the specs were pronounced (or produced) by sharpening tab, it may be actually easier to isolated them with Speck Removal by running AS again and using only the Specks tab.
Maciej Tomczak
Phototramp.com
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Advanced Sharpen and dual threshold

Post by den »

Thank you Maciej for the expanded explanation.

I was trying for a single AS transform application to achieve the "AS Sharpened+roughest edges reduced" look without the bright pixels but when their frequency was included in the Speck Removal tab or by extending the Sharpen tab fader (white slider) further away from the black slider... the Preview became too soft...

I could easily clean up the bright single pixels with a second AS-Speck Removal application; or PWP6 Noise reduction or the Bilateral Sharpen transforms set for skin smoothing settings...
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

It's quite possible that with true dual threshold in AS/Sharpen tab, those white specks could have been excluded from sharpening in the first place. The texture Mask simulating the upper sharpen threshold, especially blurred, probably had missed them. It is finicky a method, presently.
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Advanced Sharpen and dual threshold

Post by tomczak »

When AS builds 'roughness' histogram, it uses some algorithm along with Sharpen Radius value to compute the roughness of a kernel? and assigns it to its central pixel, I believe. Mask Texture also estimates roughness having a choice of 3 algorithms and a 'Neighborhood Size'. Which of these 3 methods correspond the closest to what AS is doing and how to best approximate the Neighborhood with the AS Radius (or vice versa)?

Cheers!
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4217
Joined: January 22nd, 2009, 11:03 pm

Re: Advanced Sharpen and dual threshold

Post by jsachs »

There is no direct correspondence between the roughness histogram and the texture mask. The roughness histogram is a histogram of the differences between each pixel in the sharpness radius and the central pixel, for all pixels in the image. The texture mask computes various measures of the variation within a neighborhood around each pixel and sets the mask value accordingly.
Jonathan Sachs
Digital Light & Color
Post Reply