Log in

View Full Version : new filter: "sharpmask" - please test


E-Male
20th December 2004, 20:52
http://e-rels.dyndns.org/downloads/sharpmask.rar

this filter creates a mask from the luma sharpness

usage:
sharpmask(strength, mode)

what it outputs for each pixel:
abs((pixel - avg)*strength)

avg=
mode 1: average of the 8 neighboars
mode 2: min-max-average of the 8 neighboars
mode 3 is the average of mode 1 and 2

it's not optimized nor well tested and surely has room for improvements

please test this 1st version and post everything here

thx
E-Male

Socio
21st December 2004, 00:42
What are the settings for strength? 1-100 1-10 1-3?

E-Male
21st December 2004, 10:11
basicly 1-255
but more like 10-100
you have to try, i guess it'll depend a lot on the source and on what you wanna do with the mask

Fizick
21st December 2004, 23:12
E-Male,
What YOU want to do with this mask?

May be, to finish your grain removers test? ;)

E-Male
22nd December 2004, 13:20
i think it can be used for example to further blur already blured parts to save bits, without hurting sharp parts
maybe even sharpen the sharp parts in the same process
it also might help with artefact detection

(i stopped that comnparison when i noticed how uncomparable the filters are, but that's OT here)

Didée
22nd December 2004, 14:54
Small Nitpicking: this isn't a "sharpness" mask, but rather a traditional "local luma distortion" mask. Evaluating "sharpness" requires a little more work ;)

There's not that awesome much information one can squeeze out of a simple 3x3 kernel ... things start getting more interesting when one gathers information from a 3x3 cell as well as from a 5x5 cell (at least). Then one can build different, more meaningful, metrics. (Very simple ones, though. Like "poor man's slope evaluation".)


For example:

("min1" = "minimum-of-3x3", "max2"="maximum of 5x5", etc.):

( ( difference(min1,min2) = {small} ) OR ( difference(max1,max2) = {small} ) )
AND ( difference(min2,max2) = {big} )

==> "Halo" areas in edge's direct neighborhood.


Or:

average(min1,max1) =[equal]= average(min2,max2)
AND difference(min2,max2) = {big enough}

==> we're on the neutral part of a gradient


... like that, and so on.

E-Male
22nd December 2004, 18:34
i know it is primitive, just as most of my work here
but i'll keep improving it when i see a way

i got some questions:
-what do "kernel" and "cell" mean in this context?
-what would be better formulars for sharpness then?

tsp
26th December 2004, 00:55
E-Male you can check this (http://www.mic-d.com/java/digitalimaging/kernelmaskoperations/) homepage out for information about kernels and I think cell in this context is the (number of) pixels you look at to calculate one pixel. Also if you need help to create a mmx optimized version just ask. It should be fairly easy.

E-Male
26th December 2004, 18:02
thx for the link and the offer

i'll post here again when i got news

i still hope someone can point to a source with information (formulas) on sharpness