Digital Signal Processing
Digital Signal Processing
Marcin Iwanowski(B)
1 Introduction
The image low-pass filtering using linear (convolution) filters is one of the sim-
plest, oldest, and most often applied image processing techniques. It allows for
image blurring that makes image regions smooth by reducing the high-frequency
image components. There are two kinds of those components: irrelevant noise
and meaningful edges. To the first kind belong all image content, the blurring of
which is desirable: real noise and small objects referred to, e.g. details without
any importance, skin defects on portrait images, the texture of land cover ele-
ments, etc. The second kind of high-frequency component refers to rapid changes
of image intensity value related to boundaries of objects that usually should be
c Springer Nature Switzerland AG 2020
L. J. Chmielewski et al. (Eds.): ICCVG 2020, LNCS 12334, pp. 59–71, 2020.
https://doi.org/10.1007/978-3-030-59006-2_6
60 M. Iwanowski
visible without any blurring influencing contrast at edges. The classic linear
low-pass filters modify both high-frequency components.
The proposed LPMPR (Low-Pass filter with Morphologically Processed
Residuals) method combines the linear low-pass filtering with non-linear pro-
cessing of its residual in order to find and restore the meaningful edges on the
low-pass filtered image1 and is based on the concept described in [6]. The work-
flow of the original approach is as follows. At first, the image is filtered using
the Gaussian filter. Next, its residual is computed and split into two fractions
referred to subsets of pixels of the positive and the absolute value of negative
fraction. Both fractions are subject to thresholding to find strong edges (high-
contrast ones). The thresholding result is next used as markers for the morpho-
logical reconstruction of residuals. Reconstructed residuals that do not contain
irrelevant image components are added to the low-pass filtered image to recover
meaningful edges.
In this paper, the above method is extended by adding three essential func-
tionalities, that overcomes three imperfections of the original. The first one refers
to selecting the relevant regions that have originally been based on the resid-
ual only amplitude. In the proposed approach, it is extended by adding the
second, size-criterion. Secondly, the original method does not allow to control
the contrast of the output image. To solve this problem, a proposed solution
introduces an additional parameter – a contrast coefficient that provides for
increasing/reducing the contrast of the output image. Finally, last but not least,
the original method was restricted to gray-tone images only. In this paper, a way
of extending it to color images is proposed.
The paper is organized as follows. Section 2 contains the discussion on related
papers. In Sect. 3, the graytone case is described. Section 4 is dedicated to color
image processing using the proposed approach. In Sect. 5, the examples are
shown. Finally, Sect. 6 concludes the paper.
2 Related Work
1
The MATLAB code of the proposed filtering method is available at https://www.
mathworks.com/matlabcentral/fileexchange/77581-lpmpr-image-filter.
Image Manipulation by Low-Pass Linear and Morphological Processing 61
3 Graylevel Images
The original approach [6] has been proposed for gray-level images. It is based on
the residual of the Gaussian filter, denoted as:
where Iin stands for the original gray-level image, ∗ is the convolution operator
and L stands for the mask of the Gaussian (or any other linear low-pass) filter.
The linear filter residual is defined as:
residuals are added to the filtered image so that meaningful edges are recovered,
while the image remains blurred within the irrelevant image regions:
The operator M, which is the same for both residuals is defined as:
M(I) = RI min I, St (I)|{min{I},max{I}} , (6)
where RI (A) stands for the morphological reconstruction of the gray-level mask
image I from (also gray-level) markers A, ‘|’ is a mapping operator that converts
a binary image into gray-level one by replacing original values of 0’s and 1’s by
two given ones. Finally, ‘min’ is a point-wise minimum operator of two images.
The most important element of the definition of M (Eq. 6) is the binary marker
S that contains meaningful, relevant regions where contrast should be preserved.
The choice of these regions is based on the amplitude of the residuum:
S is thus the selection operator that extracts (in a form of a binary image)
regions of I of amplitude higher than given threshold t.
Fig. 1. Simple graylevel image filtering: original image (a), result of the Gaussian
filtering with σ = 15 (b), filtering with t = 0.1 positive/negative mask (c) and filtering
result (d)
where ◦(s) is the area opening, removing components smaller than given size
defined by s (number of pixels in the connected component of the thresholded
fraction of the residual).
Fig. 2. Results of filtering for various s values – Gaussian with σ = 15, t = 0.05:
positive/negative mask and filtering result for s = 20 (a), (b); s = 110 (c), (d)
Fig. 3. The influence of the contrast factor c to the final result. The original ‘Lena’
image (a), LPMPR filtering without contrast modification, c = 1, t = 0.2 (b), contrast
enhancement c = 1.5, t = 0.2 (c), contrast enhancement c = 1.5 without residual
filtering (t = 0) (d)
Fig. 4. Color processing (Gaussian with σ = 11, t = 0.12, c = 1.8, s = 0). Original
image (a), blurred image (b), independent processing of color channels (c), luminance-
driven processing (d) (Color figure online)
1. Filter Iin using linear filter with mask L to get Ilf (Eq. 1)
2. Compute Ires , Ires+ , Ires− (Eq. 2, 3, 4)
3. Compute residuals of the luminance Lres+ and Lres− (Eq. 2)
4. For each residual (Lres+ , Lres− ) create binary mask (St,s (Lres+ ), St,s (Lres− ))
applying given t and s (Eq. 8)
cc
5. For each cc ∈ {R, G, B} perform reconstruction of Ires− with mask
cc
St,s (Lres− ) and get M(Ires− ) (Eq. 6)
cc cc
6. Do the same using Ires+ and St,s (Lres+ ) to get M(Ires+ ) (Eq. 6)
7. Combine residuals with If ilt and get final image Iout (Eq. 9) for given c
Fig. 5. Results of processing with various parameter sets (c = 1.5 and σ = 5 are
constant): t = 0.05, s = 0 (a); t = 0.15, s = 0 (b); t = 0.15, s = 2 (c); t = 0.15,
s = 8 (d)
5 Results
The comparison of the proposed method with guided and bilateral filters (with
default parameters in their MATLAB implementations) is shown in Fig. 6. The
proposed approach allows for better extracting the relevant object (not blurred)
from the blurred background. In the case of its competitors the increase of the
expected blurring would affect also to quality and sharpness of relevant object.
Image Manipulation by Low-Pass Linear and Morphological Processing 67
Fig. 6. Original image (a), filtered using the proposed method (b), using guided filter
(c) and bilateral filter (d) (Color figure online)
Due to its four parameters, the LPMPR filters are flexible. They may be
adjusted to get filtering results focused on preserving edges of a particular object
or content classes of the specific image. The image shown in Fig. 7 is a part of
a high-resolution satellite image showing a mountain house located close to the
lake with different types of landcover classes around: trees, bushes, water, stones,
underwater stones, grass, road, etc. Depending on the choice of parameters,
various classes might remain sharp, while the remainder of the image is blurred.
The original image shown at the position (a) has been filtered using multiple
sets of parameters, that are printed below figures at particular positions. All
the operations were performed on the original image (a) with Gaussian filtering
with σ = 15 (b). The results of LPMPR are the following. Having a look at
the position (c) one may see that only the smallest stones at the lakeshore are
blurred (low value of t), in case of (d), for t = 0.1 similar results are obtained
for lower s but now, also the underwater stones disappear. On position (e) it
is visible that, when increasing s, the area covered by bushes and grass became
blurred, on (f) further increase of t results in more robust filtering results. The
remainder of cases illustrates the contrast issues, on (g) high values of t and
s produces an image where most of the area is blurred apart from the house
and some other high-contrasted details. The next one, (h), shows what happens
when going down with s and, in the same, increasing c. It results in a highly
contrasted final image but with small details of texture blurred. The image at
the last position (i) is presented to compare with (h) – it depicts the same level
of contrast enhancement but without morphological processing of residuals is
the result of classic contrast enhancement method.
The method may be also successively applied, to filter portrait images of
human faces, where skin smoothing is one of the most popular tasks. Its appli-
cation allows for reducing considerably the noise level inside the skin regions
(what makes the skin smooth) and preserving the contrast on image edges (face
and its details outlines). The example of such an application is shown in Fig. 8.
68 M. Iwanowski
Fig. 7. LPMPR filtering results of the satellite image with various land-cover classes,
for filtering parameters of see captions below images for description see the text (Color
figure online)
Image Manipulation by Low-Pass Linear and Morphological Processing 69
Fig. 8. Photo enhancement. The original picture (a), filtered one (b), enlarged part of
the original (c) and of the filtered one (d)
In most of the previous examples, the contrast coefficient was set to values
slightly above 0 (1 < c < 1.8). This results in increasing pixel values difference
on edges and improve the contrast of meaningful image objects. This range
of possible changes of c gives, as a result, natural-looking images with visibly
increased contrast of details. Further increase of c (c > 2) causes a somehow
unnatural outlook of images. The boundaries between image regions become so
sharp that its color becomes either black or white. The extremely high contrast
makes image object looking comics-like – flat regions of relatively uniform color
value separated by black or white lines. An effect of transferring an image into
comics is shown in Fig. 9.
Fig. 9. Two examples of comics effect. Filtering with (in both cases) with t = 0.03,
c = 3, s = 1000.
70 M. Iwanowski
6 Conclusions
In the paper, a novel method for edge-aware processing of color images, called
LPMPR, has been proposed. It is based on the principle of extracting the resid-
uals of the low-pass linear filter that is further processed using a non-linear
approach based on morphological operators of area opening and reconstruction.
The result of the latter processing is added back to the low-pass filtering result.
Non-linear filtering aims to localize and extract meaningful edges reconstructed
on the final image so that blurring is not present within their regions. Four
parameters control the method’s behavior: the mask of the Gaussian (on any
other low-pass linear) filter, the threshold t, size coefficient s, and contrast coef-
ficient c. Depending on the choice of these parameters, the final result may be
adapted to particular requirements. The method may be applied to perform
a controllable edge-aware image blur with contrast improvement, to improve
the quality of images with a controlled level of details preserved. The proposed
LPMPR method has been illustrated in the paper by examples demonstrating
its usefulness.
References
1. Barash, D.: Fundamental relationship between bilateral filtering, adaptive smooth-
ing, and the nonlinear diffusion equation. IEEE Trans. Pattern Anal. Mach. Intell.
24(6), 844–847 (2002)
2. Durand, F., Dorsey, J.: Fast bilateral filtering for the display of high-dynamic-range
images. ACM Trans. Graph. 21(3), 257–266 (2002)
3. Grazzini, J., Soille, P.: Edge-preserving smoothing using a similarity measure in
adaptive geodesic neighbourhoods. Pattern Recogn. 42(10), 2306–2316 (2009).
Selected papers from the 14th IAPR International Conference on Discrete Geom-
etry for Computer Imagery 2008
4. He, K., Sun, J., Tang, X.: Guided image filtering. IEEE Trans. Pattern Anal. Mach.
Intell. 35(6), 1397–1409 (2013)
5. Hong, V., Palus, H., Paulus, D.: Edge preserving filters on color images. In: Bubak,
M., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.) ICCS 2004. LNCS, vol.
3039, pp. 34–40. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-
25944-2 5
6. Iwanowski, M.: Morphological processing of Gaussian residuals for edge-preserving
smoothing. In: Angulo, J., Velasco-Forero, S., Meyer, F. (eds.) ISMM 2017. LNCS,
vol. 10225, pp. 331–341. Springer, Cham (2017). https://doi.org/10.1007/978-3-
319-57240-6 27
7. Kuwahara, M., Hachimura, K., Eiho, S., Kinoshita, M.: Processing of RI-
angiocardiographic images. In: Preston, K., Onoe, M. (eds.) Digital Processing
of Biomedical Images, pp. 187–202. Springer, Boston (1976). https://doi.org/10.
1007/978-1-4684-0769-3 13
8. Nagao, M., Matsuyama, T.: Edge preserving smoothing. Comput. Graph. Image
Process. 9(4), 394–407 (1979)
9. Perona, P., Malik, J.: Scale-space and edge detection using anisotropic diffusion.
IEEE Trans. Pattern Anal. Mach. Intell. 12(7), 629–639 (1990)
Image Manipulation by Low-Pass Linear and Morphological Processing 71
10. Saint-Marc, P., Chen, J., Medioni, G.: Adaptive smoothing: a general tool for early
vision. IEEE Trans. Pattern Anal. Mach. Intell. 13(6), 514–529 (1991)
11. Soille, P.: Morphological Image Analysis: Principles and Applications. Springer,
Berlin (2004). https://doi.org/10.1007/978-3-662-05088-0
12. Tomasi, C., Manduchi, R.: Bilateral filtering for gray and color images. In: Sixth
International Conference on Computer Vision (IEEE Cat. No.98CH36271), pp.
839–846, January 1998
13. Wheeler, M.D., Ikeuchi, K.: Iterative smoothed residuals: a low-pass filter for
smoothing with controlled shrinkage. IEEE Trans. Pattern Anal. Mach. Intell.
18(3), 334–337 (1996)