image enhancement algorithms in floss: sharpeningsubstantiated algorithms for image sharpening,...

18
Image enhancement algorithms in FLOSS: sharpening Anton Lytvynenko, Kyiv, Ukraine

Upload: others

Post on 31-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

Image enhancement algorithms in FLOSS:

sharpening

Anton Lytvynenko, Kyiv, Ukraine

Page 2: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

Getting supplementary data on LVEE

wget -m --limit-rate=100k http://192.168.1.107/share/

Page 3: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

3

Sources of image fuzziness

● Focusing error;● Lenses low quality or softness;● Flatbed scanners peculiarities;● Camera shake due to hands trembling or other reasons of motion.

Page 4: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

4

FLOSS projects to be considered

● GIMP (GPL3+);● ImageMagick (Apache 2.0);● G'MIC (CeCILL License) – GIMP plugin and standalone program;

● Krita (GPL2).

Page 5: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

5

USM (unsharp mask)

● Algorithmically: mixing an image with the result of its gaussian blur;

● Present in any editor declaring image processing capabilities (GIMP, ImageMagick, G'MIC, Krita, even optical printing from film negatives!);

● Parameters of USM in different software differ.

Page 6: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

6

USM (unsharp mask)● Pro:

– Present everywhere;

– It is possible to apply threshold value to leave smooth area untouched (otherwise noise will be enhanced too);

● Contra:– Low selectivity, a morphology of the image is not taken

into account;

– USM relies on visual enhancement, no compensation of real blurring effects is applied;

– Artifacts may be produced on severe sharpening levels.

Page 7: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

7

Example: USM

Source Result

Page 8: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

8

Morphology-based algorithms

● Searching for contours and their enhancement.– Laplacian of gaussian (ImageMagick):

convert 1.png -define convolve:scale='100,100%' -morphology Convolve 'Log:0x2' 1_sharpen.pnghttp://www.imagemagick.org/Usage/convolve/#sharpen

– Erosion sharpening (GIMP plugin)The image is mixed with results of „dilate“ and „erode“ operations with some weight coefficients.

● Pro: More selective in respect to USM.● Contra: Threshold is usually not applicable, preliminary denoising should be applied.

Page 9: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

9

Example: erosion sharpening

Source Result

Page 10: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

10

Wavelet sharpen● Contours are selected using wavelets and enhanced

(some components of the image wavelet decomposition are enhanced);

● Implemented as GIMP plugin;● Pro:

– One of the most effective methods of image sharpening;

– May be combined with wavelet denoising.

● Contra:– No threshold usage is available, so preliminary denoising

should be applied.

Page 11: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

11

Example: wavelet sharpen

Source Result

Page 12: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

12

PSF-based algorithms● Image blurring =

= stochastic (e.g. noise, accidental defects) + deterministic (motion blur, focusing error);

● If deterministic blurring prevails and point spread function (PSF) is known, one can restore initial image exactly (but borders);

Problems:– PSF usually unknown;– Noise.

http://en.wikipedia.org/wiki/File:Convolution_Illustrated_eng.png

Page 13: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

13

PSF estimation● G'MIC: deconvolution sharpening

(Richardson-Lucy algorithm: JOSA, 62, 1, pp. 55-59 (1972); Astronomical Journal, 79, p. 745 (1974));

● Refocus plugin for GIMP (Wiener filter: N. Wiener. Extrapolation, Interpolation, and Smoothing of Stationary Time Series. New York: Wiley, 1949) – focusing errors etc.;

● Refocus-it plugin for GIMP (Hopfield neural network: PNAS, 79, 8, pp. 2554—2558 (1982)) – motion blur, focusing errors etc.

Page 14: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

14

PSF-based algorithms● Pro:

– Try to compensate physical effects leading to fuzziness;

– Can help to extract information from the image where other methods cannot (e.g. vehicle number blurred by motion and so on);

● Contra:– Require a lot of computational resources;– Often produce images with artifacts (ripple).

Page 15: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

15

Example: Refocus

Source Result

Page 16: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

16

Conclusions● FLOSS projects deliver a lot of powerful theoretically

substantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons leading to fuzziness;

● Image sharpening algorithms substantially differ in different programs (mostly as plugins or scripts). The most of them are implemented as GIMP plugin (especially taking into account G'MIC);

Basing on personal experience, author recommends wavelet algorithm usage in the majority of cases.

Page 17: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

17

Yet another example :)

Source Wavelet Refocus

Page 18: Image enhancement algorithms in FLOSS: sharpeningsubstantiated algorithms for image sharpening, based both on visual sharpness enhancement as well as on compensation of physical reasons

18

And yet another ;)

Source Wavelet Deconvolution sharpening