Next Article in Journal
On Novel Results about the Algebraic Properties of Symbolic 3-Plithogenic and 4-Plithogenic Real Square Matrices
Next Article in Special Issue
An Improved Sorting Algorithm for Periodic PRI Signals Based on Congruence Transform
Previous Article in Journal
Integrating Node Importance and Network Topological Properties for Link Prediction in Complex Network
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Analysis of the Recursive Locally-Adaptive Filtration of 3D Tensor Images

by
Roumen Kountchev
1,
Rumen Mironov
1,* and
Roumiana Kountcheva
2
1
Department of Radiocommunications and Videotechnology, Faculty of Telecommunications, Technical University of Sofia, 1000 Sofia, Bulgaria
2
TK Engineering, 1582 Sofia, Bulgaria
*
Author to whom correspondence should be addressed.
Symmetry 2023, 15(8), 1493; https://doi.org/10.3390/sym15081493
Submission received: 25 May 2023 / Revised: 24 July 2023 / Accepted: 25 July 2023 / Published: 27 July 2023

Abstract

:
This work is focused on the computational complexity (CC) reduction of the locally-adaptive processing of 3D tensor images, based on recursive approaches. As a basis, a local averaging operation is used, implemented as a sliding mean 3D filter (SM3DF) with a central symmetric 3D kernel. Symmetry plays a very important role in constructing the working window. The presented theoretical approach could be adopted in various algorithms for locally-adaptive processing, such as additive noise reduction, sharpness enhancement, texture segmentation, etc. The basic characteristics of the recursive SM3DF are analyzed, together with the main features of the adaptive algorithms for filtration of Gaussian noises and unsharp masking where the filter is aimed at. In the paper, the ability of SM3DF implementation through recursive sliding mean 1D filters, sequentially bonded together, is also introduced. The computational complexity of the algorithms is evaluated for the recursive and non-recursive mode. The recursive SM3DF also suits the 3D convolutional neural networks which comprise sliding locally-adaptive 3D filtration in their layers. As a result of the lower CC, a promising opportunity is opened for higher efficiency of the 3D image processing through tensor neural networks.

1. Introduction

Three-dimensional tensors suit very well the representation of sequences of correlated images from various sources: CTI, MRI, endoscopic, US, multidimensional encephalographic, or electrocardiographic images, and also seismic signals, spatio-temporal video sequences, etc. One of the basic tools used for their processing are the algorithms for locally-adaptive 3D filtration [1,2,3]. The leading part in this processing belongs to the local averaging, implemented by using the sliding mean 3D filter (SM3DF) with a central symmetric 3D kernel. Symmetry plays a very important role in the working window construction. It is suitable for many algorithms for local processing of tensor images, such as for example, the adaptive reduction of additive noises [4,5], sharpness enhancement through unsharp masking, segmentation through variable thresholding [1], texture extraction through variation methods and wavelets [6], etc. Most of the famous algorithms for locally-adaptive processing are aimed at the 2D matrix images. Their efficiency is significantly increased when applied to image sequences of various kinds [3,7,8]. Recently, tensor neural network development [9] has been aimed at the decomposition of 3D convolutional neural networks (CNN) [10], where multiple locally-adaptive 3D tensor filtration is used. Various solutions already exist, aimed at multidimensional image filtering. In [11], a non-local filter is introduced, which combines the adaptive median filtering technique and the non-local means filtering, and is aimed at the processing of various kinds of medical images. In [12], the authors present one multiresolution version of the non-local means filter, which adapts the denoising according to the spatial and frequency information in the image. In [13], a new non-local algorithm for image denoising is proposed, and references [14,15,16,17] are focused on the significance of image filtering in image processing. Most of these approaches present the obtained results, but the computational complexity is not evaluated in detail.
In [18,19], one approach for fast 2D mean filtering technique is presented. The authors propose a method which reduces the number of additions to a large extent and completely eliminates the need for any division in calculating the mean. The presented algorithms are aimed at the efficiency enhancement of the mathematical implementation in 2D processing, and could be generalized towards the 3D filtering.
In this work, we propose a new approach of higher efficiency in the processing of 3D images, which could be extended for calculation of multidimensional information. Due to the high volume of multidimensional data which have to be processed, the computational complexity (CC) of the operations executed by the locally-adaptive sliding mean filters increases significantly. One possible approach to settle the problem is to utilize the recursive SM3DF.
The main objectives of this work are to present an efficient approach for locally-adaptive processing of tensor 3D images based on the recursive SM3DF, to analyze its most significant characteristics, and to evaluate the CC as compared to that of the similar non-recursive algorithms. The next sections of the work are as follows: in Section 2 the characteristics of the recursive SM3DF in the spatial and frequency domains are analyzed; in Section 3 and Section 4 we present the corresponding algorithms for the adaptive suppression of additive noises in tensor 3D images and for sharpness enhancement through adaptive unsharp masking, based on the recursive SM3DF; and Section 5 contains the discussion and conclusions and the ideas for future work.

2. Analysis of the Recursive Sliding Mean 3D Filter Characteristics

For the analysis of the recursive 3D filter, the non-recursive structure should be first analyzed. The non-recursive sliding mean 3D filter is presented below as a generalization of the well-known non-recursive sliding mean 2D filter.
The non-recursive SM3DF is analyzed in the z-area, and on the basis of this, the execution algorithm of the corresponding recursive filter and its implementation are defined, based on recursive sliding mean 1D filters, sequentially bonded together. The exact description of the sliding recursive 3D filter needs to understand its previous states, which define the corresponding causal area. The form of the area depends on the chosen way to scan the tensor voxels. It is supposed here that the filter scans the voxels following a trajectory which corresponds to the well-known progressive 3D linear scan (used in most applications for image processing), as shown on Figure 1, for a tensor of size 5 × 5 × 4.

2.1. Non-Recursive Sliding Mean 3D Filter

The non-recursive SM3DF with a central symmetrizing 3D kernel w(s, m, n) is designed for sliding processing of the voxels x(i,r,k) of tensor X, of size M × N × K. At the filter output, the mean value is obtained of the voxels framed by the 3D window, in correspondence with the relation:
μ x ( i , r , k ) = 1 A s = a a m = b b n = h h w ( s , m , n ) x ( i + s , r + m , k + n ) ,   for   w ( s ,   m ,   n ) = 1 ,
where μx(i, r, k) denotes the filtered output voxel, and A = (2a + 1)(2b + 1)(2h + 1) is the number of voxels, framed by the 3D sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1). For the filtration of voxels placed on the first and the last horizontal and lateral rows, and also on the first and the last vertical columns, the tensor X should be extended in all three directions (zero padding), and as a result it becomes of size (M + 2a) × (N + 2b) × (K + 2h).

2.2. Recursive Sliding Mean 3D Filter

After applying the 3D z-transform [20] on Equation (1), the following is obtained:
Μ x ( z 1 , z 2 , z 3 ) = 1 A s = a a m = b b n = h h X ( z 1 , z 2 , z 3 ) z 1 s , z 2 m , z 3 n = 1 A X ( z 1 , z 2 , z 3 ) s = a a m = b b n = h h z 1 s , z 2 m , z 3 n .
In accordance with the condition for SM3DF kernel divisibility [7], from Equation (2) the following 3D transfer function is obtained:
H ( z 1 , z 2 , z 3 ) = Μ x ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = ( 1 A 1 s = a a z 1 s ) ( 1 A 2 m = b b z 2 m ) ( 1 A 3 n = h h z 3 n ) = H 1 ( z 1 ) H 2 ( z 2 ) H 3 ( z 3 ) ,
where A1 = (2a + 1), A2 = (2b + 1), A3 = (2h + 1) and A = A1A2A3.
Here, H 1 ( z 1 ) , H 2 ( z 2 ) , H 3 ( z 3 ) are the transfer functions of the corresponding 1D recursive filters, which could be represented in the following way:
H 1 ( z 1 ) = 1 A 1 s = a a z 1 s = z 1 a z 1 ( a + 1 ) A 1 ( 1 z 1 1 ) , H 2 ( z 2 ) = 1 A 2 m = b b z 2 s = z 2 b z 2 ( b + 1 ) A 2 ( 1 z 2 1 ) , H 3 ( z 3 ) = 1 A 3 n = h h z 3 s = z 3 h z 3 ( h + 1 ) A 3 ( 1 z 3 1 ) .
To answer the requirement for the 1D recursive filter stability, the relations |z1| > 1, |z2| > 1 and |z3| > 1 should be satisfied.
Then the 3D transfer function H ( z 1 , z 2 , z 3 ) from Equation (3) is reorganized as follows:
H ( z 1 , z 2 , z 3 ) = Μ x ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = ( z 1 a z 1 ( a + 1 ) A 1 ( 1 z 1 1 ) ) ( z 2 b z 2 ( b + 1 ) A 2 ( 1 z 2 1 ) ) ( z 3 h z 3 ( h + 1 ) A 3 ( 1 z 3 1 ) ) = = 1 A ( z 1 a z 2 b z 3 h z 1 a z 2 ( b + 1 ) z 3 h z 1 ( a + 1 ) z 2 b z 3 h + z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 h z 1 a z 2 b z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 + + z 1 a z 2 ( b + 1 ) z 3 ( h + 1 ) + z 1 ( a + 1 ) z 2 b z 3 ( h + 1 ) z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 )
From Equation (5) it follows that:
Μ x ( z 1 , z 2 , z 3 ) ( 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 ) = = 1 A X ( z 1 , z 2 , z 3 ) [ z 1 a z 2 b z 3 h z 1 a z 2 ( b + 1 ) z 3 h z 1 ( a + 1 ) z 2 b z 3 h + z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 h z 1 a z 2 b z 3 ( h + 1 ) + + z 1 a z 2 ( b + 1 ) z 3 ( h + 1 ) + z 1 ( a + 1 ) z 2 b z 3 ( h + 1 ) z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 ( h + 1 ) ] .
After applying the inverse 3D z-transform on Equation (6), at the output of SM3DF the mean local value, μ x ( i , r , k ) , is obtained:
μ x ( i , r , k ) = μ x ( i 1 , r , k ) + μ x ( i , r 1 , k ) + μ x ( i , r , k 1 ) μ x ( i 1 , r 1 , k ) μ x ( i 1 , r , k 1 ) μ x ( i , r 1 , k 1 ) + + μ x ( i 1 , r 1 , k 1 ) + 1 A [ x ( i + a , r + b , k + h ) x ( i + a , r b 1 , k + h ) x ( i a 1 , r + b , k + h ) + x ( i a 1 , r b 1 , k + h ) x ( i + a , r + b , k h 1 ) + x ( i + a , r b 1 , k h 1 ) + + x ( i a 1 , r + b , k h 1 ) x ( i a 1 , r b 1 , k h 1 ) ]
In Figure 2, the spatial positioning of the voxels, used for the recursive calculation of μx(i, r, k), in correspondence with Equation (7), is shown:
The voxels, used for the recursive calculation, are colored in blue, and the current voxel μx(i, r, k) is white. In the causal area of the filter, the following voxels of the output 3D image are placed: μ x ( i 1 , r , k ) ,   μ x ( i , r 1 , k ) ,   μ x ( i , r , k 1 ) ,   μ x ( i 1 , r 1 , k ) ,   μ x ( i 1 , r , k 1 ) ,   μ x ( i 1 , r 1 , k 1 ) , and μ x ( i , r 1 , k 1 ) . These voxels are already calculated, because for the selected direction of the linear scan (as shown in Figure 1), they correspond to the previous positions of the current voxel μx(i, j, k) at the output of the recursive SM3DF.

2.3. Analysis of the Recursive Sliding Mean 3D Filter Frequency Response

To analyze the frequency response of the recursive sliding mean 3D filter, in Equation (5) the following are set: z 1 = e j ω 1 ,   z 2 = e j ω 2 , and z 3 = e j ω 3 , where ω 1 = 2 π ( f x T x )   ω 2 = 2 π ( f y T y ) , and ω 3 = 2 π ( f z T z ) . Here, fx, fy, and fz denote the spatial frequencies, and Tx, Ty, Tz are the distances between the neighboring voxels in a horizontal, vertical and lateral direction, respectively.
After replacing the variables in Equation (5) for the 3D complex frequency response (CFR) of SM3DF, we obtained:
H ( e j ω 1 , e j ω 2 , e j ω 3 ) = Μ x ( e j ω 1 , e j ω 2 , e j ω 3 ) X ( e j ω 1 , e j ω 2 , e j ω 3 ) = H 1 ( e j ω 1 ) H 2 ( e j ω 2 ) H 3 ( e j ω 3 ) ,
where, for the corresponding one-dimensional CFR in respect to ω1, ω2, ω3, the following relations are obtained:
H 1 ( e j ω 1 ) = e j a ω 1 e j ( a + 1 ) ω 1 A 1 ( 1 e j ω 1 ) = { cos ( a ω 1 ) cos ( a + 1 ) ω 1 } + j { sin ( a ω 1 ) + sin ( a + 1 ) ω 1 } A 1 [ ( 1 cos ω 1 ) + j sin ω 1 ] ,
H 2 ( e j ω 2 ) = e j b ω 2 e j ( b + 1 ) ω 2 A 2 ( 1 e j ω 2 ) = { cos ( b ω 2 ) cos ( b + 1 ) ω 2 } + j { sin ( b ω 2 ) + sin ( b + 1 ) ω 2 } A 2 [ ( 1 cos ω 2 ) + j sin ω 2 ] ,
H 3 ( e j ω 3 ) = e j h ω 3 e j ( h + 1 ) ω 3 A 3 ( 1 e j ω 3 ) = { cos ( h ω 3 ) cos ( h + 1 ) ω 3 } + j { sin ( h ω 3 ) + sin ( h + 1 ) ω 3 ] } A 3 [ ( 1 cos ω 3 ) + j sin ω 3 ] .
After applying the necessary trigonometric relations:
cos ( a ω 1 ) cos ( a + 1 ) ω 1 = 2 sin ( ( 2 a + 1 ) ω 1 / 2 ) sin ( ω 1 / 2 ) = 2 sin ( A 1 ω 1 / 2 ) sin ( ω 1 / 2 )
and
sin ( a ω 1 ) + sin ( a + 1 ) ω 1 = 2 sin ( ( 2 a + 1 ) ω 1 / 2 ) cos ( ω 1 / 2 ) = 2 sin ( A 1 ω 1 / 2 ) cos ( ω 1 / 2 ) ,
the corresponding 1D quadratic amplitude–frequency response (AFR) is defined:
M 1 2 ( ω 1 ) = | H 1 ( e j ω 1 ) | 2 = { cos ( a ω 1 ) cos ( a + 1 ) ω 1 } 2 + { sin ( a ω 1 ) + sin ( a + 1 ) ω 1 } 2 A 1 2 [ ( 1 cos ω 1 ) 2 + sin 2 ω 1 ] = = 4 sin 2 ( A 1 ω 1 / 2 ) 2 A 1 2 ( 1 cos ω 1 ) = 1 A 1 2 [ sin ( A 1 ω 1 / 2 ) sin ( ω 1 / 2 ) ] 2 = 1 A 1 2 [ A 1 sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) ] 2 = = [ sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) ] 2   ,   f o r sin c ( x ) = sin ( x ) x .
M 2 2 ( ω 2 ) = { cos ( b ω 2 ) cos ( b + 1 ) ω 2 } 2 + { sin ( b ω 2 ) + sin ( b + 1 ) ω 2 } 2 A 2 2 [ ( 1 cos ω 2 ) 2 + sin 2 ω 2 ] = [ sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) ] 2 ;
M 3 2 ( ω 3 ) = { cos ( h ω 3 ) cos ( h + 1 ) ω 3 } 2 + { sin ( h ω 3 ) + sin ( h + 1 ) ω 3 } 2 A 3 2 [ ( 1 cos ω 3 ) 2 + sin 2 ω 3 ] = [ sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) ] 2 .
Then, the 3D AFR of SM3DF is represented as:
M ( ω 1 , ω 2 , ω 3 ) = M 1 2 ( ω 1 ) M 2 2 ( ω 2 ) M 3 2 ( ω 3 ) = = | sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) | × | sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) | × | sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) | .
The phase–frequency response (PFR) in respect to ω1, is:
ϕ ( ω 1 ) = a r c t g β 1 γ 1 α 1 ψ 1 α 1 γ 1 + β 1 ψ 1 = a r c t g sin ω 1 sin ω 1 1 + sin ω 1 cos ω 1 = 0 ,
where α 1 = 2 sin ( A 1 ω 1 / 2 ) sin ( ω 1 / 2 ) ; β 1 = 2 s sin ( A 1 ω 1 / 2 ) cos ( ω 1 / 2 ) ; ψ 1 = A 1 sin ( ω 1 ) ; γ 1 = 2 A 1 sin 2 ( ω 1 / 2 ) .
In a similar way, we defined ϕ ( ω 2 ) = ϕ ( ω 3 ) = 0 . Then, for the 3D CFR of SM3DF, the following is obtained:
ϕ ( ω 1 , ω 2 , ω 3 ) = ϕ ( ω 1 ) + ϕ ( ω 2 ) + ϕ ( ω 3 ) = 0 .
In this case, the following relation is obtained for 3D CFR, 3D AFR and 3D PFR:
H ( e j ω 1 , e j ω 2 , e j ω 3 ) = M ( ω 1 , ω 2 , ω 3 ) e j ϕ ( ω 1 , ω 2 , ω 3 ) = M ( ω 1 , ω 2 , ω 3 ) .
Hence, the SM3DF does not introduce phase distortions in the output tensor. From Equations (17) and (20) it follows that AFR and CFR obtain values equal to zero for each frequency, ω 1 = 2 π n / A 1 , ω 2 = 2 π n / A 2 , ω 3 = 2 π n / A 3 , for n = 1, 2, ....
Example 1: Let a = b = h = 1, i.e., the sliding window W(i, r, k) is of size 3 × 3 × 3. Moreover, in the case of M = N = K = 4, the input tensor X is of size 4 × 4 × 4. Then, for i = r = 3 and k = 2, from Equations (1) and (7) we obtain the corresponding relations for the non-recursive and the recursive calculation of μx(3, 3, 2):
-
for the non-recursive calculation:
μ x ( 3 , 3 , 2 ) = 1 27 s = 1 1 m = 1 1 n = 1 1 x ( 3 + s , 3 + m , 2 + n ) = 1 27 { [ x ( 3 , 3 , 2 ) + x ( 2 , 3 , 2 ) + x ( 4 , 3 , 2 ) + x ( 3 , 2 , 2 ) + + x ( 3 , 4 , 2 ) + x ( 2 , 2 , 2 ) + x ( 4 , 4 , 2 ) + x ( 4 , 4 , 2 ) + x ( 2 , 4 , 2 ) ] + [ x ( 3 , 3 , 1 ) + x ( 2 , 3 , 1 ) + x ( 4 , 3 , 1 ) + x ( 3 , 2 , 1 ) + + x ( 3 , 4 , 1 ) + x ( 2 , 2 , 1 ) + x ( 4 , 4 , 1 ) + x ( 4 , 4 , 1 ) + x ( 2 , 4 , 1 ) ] + [ x ( 3 , 3 , 3 ) + x ( 2 , 3 , 3 ) + x ( 4 , 3 , 3 ) + x ( 3 , 2 , 3 ) + + x ( 3 , 4 , 3 ) + x ( 2 , 2 , 3 ) + x ( 4 , 4 , 3 ) + x ( 4 , 4 , 3 ) + x ( 2 , 4 , 3 ) ] } .
-
for the recursive calculation:
μ x ( 3 , 3 , 2 ) = μ x ( 2 , 3 , 2 ) + μ x ( 3 , 2 , 2 ) + μ x ( 3 , 3 , 1 ) μ x ( 2 , 2 , 2 ) μ x ( 2 , 3 , 1 ) μ x ( 3 , 2 , 1 ) + μ x ( 2 , 2 , 1 ) + + 1 27 [ x ( 4 , 4 , 3 ) x ( 4 , 1 , 3 ) x ( 1 , 4 , 3 ) + x ( 1 , 1 , 3 ) x ( 4 , 4 , 0 ) + x ( 4 , 1 , 0 ) + x ( 1 , 4 , 0 ) x ( 1 , 1 , 0 ) ]   .
Let the values of the tensor X voxels x(i, r, k) be defined as elements of the four matrices Xk+1, Xk, Xk−1, and Xk−2 (sections of tensor X), each of size 4 × 4, for i/j = 1, 2, 3, 4, and k = 2:
X 3 = [ 1 2 2 1 2 1 3 1 1 2 4 2 2 2 1 1 ] ,   X 2 = [ 2 2 3 3 1 2 2 3 2 3 1 1 3 4 3 3 ] ,   X 1 = [ 4 1 1 1 1 2 1 1 2 3 2 1 3 2 3 2 ] ,   X 0 = [ 3 2 1 1 1 2 2 1 2 3 2 2 3 1 1 2 ]
In this case, the value of μ x ( 3 , 3 , 2 ) is calculated non-recursively in accordance with the relation:
μ x ( 3 , 3 , 2 ) = 1 27 [ ( 3 + 1 + 1 + 2 + 2 + 3 + 4 + 3 + 3 ) + ( 3 + 2 + 1 + 2 + 1 + 1 + 2 + 3 + 2 ) + + ( 2 + 4 + 2 + 1 + 3 + 1 + 2 + 1 + 1 ) ] = 56 27 = 2.074 ( 074 ) .
To calculate recursively the value of μ x ( 3 , 3 , 2 ) , we should calculate in advance the preceding values: μ x ( 2 , 3 , 2 ) ,   μ x ( 3 , 2 , 2 ) ,   μ x ( 2 , 2 , 2 ) ,   μ x ( 2 , 3 , 1 ) ,   μ x ( 3 , 2 , 1 ) ,   μ x ( 3 , 3 , 1 ) , and μ x ( 2 , 2 , 1 ) .These values are calculated recursively, in accordance with the relations below:
μ x ( 2 , 3 , 2 ) = ( 1 / 27 ) [ ( 2 + 3 + 1 + 1 + 2 + 2 + 3 + 4 + 3 ) + ( 1 + 2 + 4 + 2 + 1 + 3 + 2 + 2 + 1 ) + + ( 1 + 2 + 1 + 2 + 3 + 2 + 3 + 2 + 3 )   ] = 58 / 27
μ x ( 3 , 2 , 2 ) = ( 1 / 27 ) [ ( 2 + 2 + 1 + 1 + 3 + 1 + 2 + 4 + 2 ) + ( 2 + 3 + 3 + 2 + 2 + 3 + 3 + 1 + 1 ) + + ( 1 + 1 + 1 + 2 + 1 + 1 + 3 + 2 + 1 )   ] = 51 / 27
μ x ( 3 , 3 , 1 ) = ( 1 / 27 ) [ ( 3 + 2 + 1 + 2 + 1 + 1 + 2 + 3 + 2 ) + ( 3 + 1 + 1 + 2 + 2 + 3 + 4 + 3 + 3 ) + + ( 3 + 2 + 2 + 2 + 2 + 1 + 1 + 1 + 2 )   ] = 55 / 27
μ x ( 2 , 2 , 2 ) = ( 1 / 27 ) [ ( 1 + 2 + 2 + 2 + 2 + 3 + 2 + 3 + 1 ) + ( 2 + 1 + 3 + 1 + 2 + 2 + 1 + 2 + 4 ) + + ( 1 + 2 + 1 + 4 + 1 + 1 + 2 + 3 + 2 )   ] = 53 / 27
μ x ( 2 , 3 , 1 ) = ( 1 / 27 ) [ ( 2 + 3 + 2 + 1 + 2 + 1 + 3 + 2 + 3 ) + ( 2 + 3 + 1 + 1 + 2 + 2 + 3 + 4 + 3 ) + + ( 2 + 3 + 2 + 1 + 2 + 2 + 3 + 1 + 1 )   ] = 57 / 27
μ x ( 3 , 2 , 1 ) = ( 1 / 27 ) [ ( 2 + 1 + 1 + 1 + 1 + 1 + 3 + 2 + 1 ) + ( 2 + 2 + 3 + 2 + 3 + 3 + 3 + 1 + 1 ) + + ( 2 + 2 + 1 + 2 + 1 + 1 + 3 + 2 + 2 )   ] = 49 / 27
μ x ( 2 , 2 , 1 ) = ( 1 / 27 ) [ ( 1 + 2 + 1 + 4 + 1 + 1 + 2 + 3 + 2 ) + ( 1 + 2 + 2 + 2 + 2 + 3 + 2 + 3 + 1 ) + + ( 1 + 2 + 2 + 3 + 2 + 1 + 2 + 3 + 2 )   ] = 53 / 27
Here, it should be taken into account that in order to avoid division errors in the calculation of the intermediate values used for the recursive case, the division should be executed last.
Then, for the recursive calculation of μ x ( 3 , 3 , 2 ) and in accordance with Equation (7), it follows that:
μ x ( 3 , 3 , 2 ) = 58 27 + 51 27 + 55 27 53 27 57 27 49 27 + 53 27 + 1 27 ( 1 1 2 + 1 2 + 1 + 3 3 ) = 56 27 .
The obtained result confirms that the recursive and the non-recursive filtering are equivalent in respect of the calculated value of μx(3, 3, 2).

2.4. Computation Complexity of the Recursive SM3DF

The computation complexity (CC) of the recursive SM3DF is evaluated, taking into account the number of operations needed to calculate the central voxel in the part framed by the sliding window W(i, r, k), in accordance with Equation (7). The number of additions is S = 14, and the number of multiplications is M = 1. Then, the number of operations needed is O = (S + M) = 15, i.e., O does not depend on the values of parameters a, b, and h of the window W(i, r, k).
To define the CC regarding the central voxel, for the non-recursive SM3DF, the following should be calculated: the number of additions, S = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) 1 , and the number of multiplications, M = 1. Then, the total number of operations is defined by the relation:
O = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 )
The CC reduction for the recursive SM3DF is:
R 1 = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) / 15

2.5. SM3DF Implementation through Cascade Sliding Recursive Mean 1D Filters

The SM3DF transfer function in correspondence with Equation (3), is given by the relation:
H ( z 1 , z 2 , z 3 ) = Μ x ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = ( Μ 1 ( z 1 ) X ( z 1 ) ) ( Μ 2 ( z 2 ) M 1 ( z 2 ) ) ( Μ 3 ( z 3 ) M 2 ( z 3 ) ) = H 1 ( z 1 ) H 2 ( z 2 ) H 3 ( z 3 ) ,
where
H 1 ( z 1 ) = z 1 a z 1 ( a + 1 ) A 1 ( 1 z 1 1 ) ;   H 2 ( z 2 ) = z 2 b z 2 ( b + 1 ) A 2 ( 1 z 2 1 ) ;   H 3 ( z 3 ) = z 3 h z 3 ( h + 1 ) A 3 ( 1 z 3 1 ) .
Each of the transfer functions could be presented by the relations:
H ( z ) = Μ ( z ) X ( z ) = z a z ( a + 1 ) A ( 1 z 1 ) ,   or   Μ ( z ) = M ( z ) z 1 + ( 1 / A ) [ X ( z ) z a X ( z ) z a 1 ] .
Then, 3D filtering is executed by three sequential mean 1D filters, which scan the 3D image in directions x, y, z, and are defined by the relations below:
μ 1 ( i ) = μ 1 ( i 1 ) + ( 1 / A 1 ) [ x ( i + a ) x ( i a 1 ) ] ;
μ 2 ( r ) = μ 2 ( r 1 ) + ( 1 / A 2 ) [ μ 1 ( r + b ) μ 1 ( r b 1 ) ] ;
μ 3 ( k ) = μ 3 ( k 1 ) + ( 1 / A 3 ) [ μ 2 ( k + h ) μ 2 ( k h 1 ) ] .
The result, obtained at the output of the third 1D recursive filter, coincides with that at the output of the recursive 3D filter.

2.6. CC of the Recursive SM3DF, Implemented through Triple Recursive Mean 1D Filter

In this case, the CC is evaluated by the number of operations, O, needed to calculate the central voxel in the window W(i, j, k). As was mentioned above, Oi = Si + Mi (here Si and Mi represent the number of additions and multiplications for the 1D filtering, which is executed 3 times). In this case, for Si = 2 and Mi = 1, the total number of operations is:
O = O 1 + O 2 + O 3 = 9 .
In correspondence with Equation (21), the CC of the non-recursive 3D filter is:
O = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) .
In respect to this, the CC reduction coefficient for one voxel is:
R 2 = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) 3 [ 2 ( a + b + h ) + 3 ] .
Example 2: a = b = h = 5 (i.e., 3D window of size 11’11 × 11), and R 2 = 11 3 / 99 = 13.44 .
The execution time for the 3D filtration of the voxels in a window of size (2a + 1)(2b + 1)(2h + 1), when triple 1D filtration is used, is:
T = 3(2a + 1)(2b + 1)(2h + 1)t,
where t is the time needed to scan one voxel of the tensor X. The reduced CC of the recursive filtration with one 3D filter, compared to the reduced CC for the case when it is implemented as three sequential 1D filters, for the same values of parameters a = b = h = c, is defined by the relation:
R 1 / R 2 = 3 ( 2 c + 1 ) / 5 .
For example, if c = 5 (cubic window of size 11), is obtained R 1 / R 2 = 6.6 , i.e., the global CC is reduced by more than 6 times.
The comparison between the recursive and the non-recursive filtration shows that the recursive filtration, implemented as three sequential 1D filters, reduces the CC significantly.

2.7. Computation Complexity of the Sliding Mean 3D Filter, Based on 3D FFT

The filtration of tensor X of size M × N × K could be replaced by similar filtration, but in the frequency domain of the 3D discrete Fourier transform (3D-DFT) [7]. To accelerate calculations, the 3D-DFT is usually replaced by the 3D fast Fourier transform (3D-FFT). For this, the implementation is based on the one-dimensional fast Fourier transform (FFT) of the M-dimensional vector, which needs M 2 log 2 M mathematical operations [7]. In this case, each operation comprises one complex multiplication and two complex summations. For a tensor of size M × N × K, the number of M-dimensional vectors in one tensor section is N, and, correspondingly, NK for all K sections. Then, the total number of operations needed to execute FFT for NK vectors with horizontal orientation is N K M 2 log 2 M .
For the 3D FFT calculation, FFT should be applied sequentially on all NK vectors with horizontal, vertical, and lateral orientation, respectively, and as a result, the total number of operations is:
O F F T 1 = 3 N K M 2 log 2 M .
The number of operations needed to calculate the module of each complex frequency coefficient in the 3D spectrum of the tensor X comprises two multiplications: one summation and one rooting. Hence, for all MNK frequency coefficients, this number is:
O F F T 2 = 4 M N K .
The total number of operations needed to calculate the filtered spectrum coefficients after multiplication with the corresponding coefficients of 3D AFR of SM3DF is:
O F F T 3 = M N K .
The total number of operations needed to execute the 3D inverse FFT for all 3NK vectors in directions x, y, z, differs from that in Equation (33) by one operation only, needed for the restored voxels’ normalization:
O F F T 4 = 3 N K M 2 log 2 M + 1 3 N K M 2 log 2 M .
Hence, the total number of operations needed for the filtration of a tensor of size M × N × K in the frequency domain is:
O F F T = O F F T 1 + O F F T 2 + O F F T 31 + O F F T 4 = M N K ( 5 + 3 log 2 M ) .
The total number of operations needed for the recursive 3D locally-adaptive filtration of the tensor X of size M × N × K does not depend on the window dimensions (2a + 1) × (2b + 1) × (2h + 1), and is defined by the relation:
O R F = 15 M N K .
Then, the relation R3 of OFFT towards ORF is:
R 3 = O F F T / O R F = 0.33 + 0.2 log 2 M .
For example, if M = 512, then R 3   = 32/15 = 2.13, i.e., the filtration CC in the tensor frequency space is twice as low as that in the voxel space. Together with the M increase, the relation R3 grows proportionally to log2M, and is not influenced by the filter window size. For the case when M = 2m, the values obtained for the relation of R 3 for m = 3,4, …, 10, are shown in Table 1.
The total number of operations needed for the non-recursive 3D locally-adaptive filtration of the tensor X of size M × N × K, through a filter window of size (2c + 1) × (2c + 1) × (2c + 1), for c = a = b = h, is:
O N R F = M N K ( 2 c + 1 ) 3 .
Then, the relation R 4 for OFFT regarding ONRF, is represented as given below:
R 4 = O F F T / O N R F = ( 5 + 3 log 2 M ) / ( 2 c + 1 ) 3 .
To satisfy the condition R 4   > 1 (i.e., to obtain a lower CC for the filtration in the tensor space compared to that for the frequency domain of 3D-DFT), the parameter c of the window must satisfy the condition:
c < 1 2 ( 5 + 3 log 2 M 3 1 ) .
For example, for N = 512, c < 1.08 . In fact, for c = 1 (window of size 3 × 3 × 3), we obtain R 2   = 1.18 > 1. Unlike the recursive calculation, for the non-recursive calculation the filter window size is limited by the horizontal size of the tensor M, in correspondence with Equation (42), which is a significant advantage of the recursive filtration.

3. Locally-Adaptive 3D Image Noise Filtration, Based on the Recursive SM3DF

3.1. Reduction of the Additive Gaussian Noise through Locally-Adaptive 3D Filter

The locally-adaptive 3D filter aimed at the reduction of the additive Gaussian noise is the generalized Wiener 2D filter [8], represented by the relation:
g ( i , r , k ) = { μ x ( i , r , k ) + σ x 2 ( i , r , k ) v 2 σ x 2 ( i , r , k ) [ x ( i , r , k ) μ x ( i , r , k ) ]     f o r   σ x 2 ( i , r , k ) v 2 , μ x ( i , r , k )                         f o r σ x 2 ( i , r , k ) < v 2 ,
where:
-
g(i, r, k) denotes the filtered input pixel x(i, r, k);
-
μ x ( i , r , k ) = 1 A s = a a m = b b n = h h x ( i + s , r + m , k + n ) is the mean value of pixels x(i, r, k) in the sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1);
-
A = ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) —the number of voxels in the sliding window W(i, r, k) (it is recommended that a square window W(i, r, k) of size (2c + 1) × (2c + 1) × (2c + 1) is used for (a = b = h = c);
-
σ x 2 ( i , r , k ) = 1 A s = a a m = b b n = h h x 2 ( i + s , r + m , k + n ) μ x 2 ( i , r , k ) —the local variance of the voxels x(i, r, k), enveloped by the sliding window W(i, r, k);
-
v 2 = 1 M N K i = 1 M r = 1 N k = 1 K σ x 2 ( i , r , k ) —the mean noise variance in the tensor image X, of size M × N × K.
For the case when σ x 2 ( i , r , k ) v 2 , from Equation (33) it follows that:
g ( i , r , k ) = { [ σ x 2 ( i , r , k ) v 2 ] / σ x 2 ( i , r , k ) } x ( i , r , k ) + [ v 2 / σ x 2 ( i , r , k ) ] μ x ( i , r , k )
To accelerate the calculation of the local mean value μx(i, r, k) in the above relation for the case of a linear scan of the input tensor X, (excluding the first and the last horizontal and lateral row, and the first and the last column), Equation (7) should be used.
For the acceleration of the local variance σ x 2 ( i , r , k ) = p ( i , r , k ) μ x 2 ( i , r , k ) calculation, for its first component p ( i , r , k ) = 1 A s = a a m = b b n = h h x 2 ( i + s , r + m , k + n ) a relation similar to the recursive Equation (7) should be used, where the values of voxels x ( i + s , r + m , k + n ) are replaced by their squares, x 2 ( i + s , r + m , k + n ) :
p ( i , r , k ) = p ( i 1 , r , k ) + p ( i , r 1 , k ) + p ( i , r , k 1 ) p ( i 1 , r 1 , k ) p ( i 1 , r , k 1 ) p ( i , r 1 , k 1 ) + + p ( i 1 , r 1 , k 1 ) + 1 A [ x 2 ( i + a , r + b , k + h ) x 2 ( i + a , r b 1 , k + h ) x 2 ( i a 1 , r + b , k + h ) + + x 2 ( i a 1 , r b 1 , k + h ) x 2 ( i + a , r + b , k h 1 ) + x 2 ( i + a , r b 1 , k h 1 ) + + x 2 ( i a 1 , r + b , k h 1 ) x 2 ( i a 1 , r b 1 , k h 1 ) ]   .

3.2. Transfer Function of the Locally-Adaptive Denoising 3D Filter

Let us present Equation (43) as given below:
g ( i , r , k ) = C x ( i , r , k ) + D A s = a a m = b b n = h h x ( i + s , r + m , k + n ) ,
where C = [ σ x 2 ( i , r , k ) v 2 ] / σ x 2 ( i , r , k ) ; D = v 2 / σ x 2 ( i , r , k ) .
After applying the 3D z-transform on Equation (46), the 3D transfer function is defined:
H g ( z 1 , z 2 , z 3 ) = G ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = C + D A ( s = a a z 1 s ) ( m = b b z 2 m ) ( n = h h z 3 n ) .
In accordance with Equation (24), the relation (47) is transformed as follows:
H g ( z 1 , z 2 , z 3 ) = C + D A ( z 1 a z 1 ( a + 1 ) 1 z 1 1 ) ( z 2 b z 2 ( b + 1 ) 1 z 2 1 ) ( z 3 h z 3 ( h + 1 ) 1 z 3 1 ) = = A C ( 1 z 1 1 ) ( 1 z 2 1 ) ( 1 z 3 1 ) + D ( z 1 a z 1 ( a + 1 ) ) ( z 2 b z 2 ( b + 1 ) ) ( z 3 h z 3 ( h + 1 ) ) A ( 1 z 1 1 ) ( 1 z 2 1 ) ( 1 z 3 1 ) ,
from which it follows:
H g ( z 1 , z 2 , z 3 ) = G ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = C 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 + + D A z 1 a z 2 b z 3 h z 1 a z 2 ( b + 1 ) z 3 h z 1 ( a + 1 ) z 2 b z 3 h z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 h z 1 a z 2 b z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 + + D A z 1 a z 2 ( b + 1 ) z 3 ( h + 1 ) + z 1 ( a + 1 ) z 2 b z 3 ( h + 1 ) z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1
After applying the inverse 3D z-transform on Equation (49), the recursive relation is obtained, which represents the performance of the sliding locally-adaptive denoising 3D filter:
g ( i , r , k ) = g ( i 1 , r , k ) + g ( i , r 1 , k ) + g ( i , r , k 1 ) g ( i 1 , r 1 , k ) g ( i 1 , r , k 1 ) g ( i , r 1 , k 1 ) + g ( i 1 , r 1 , k 1 ) + C [ x ( i , r , k ) + x ( i 1 , r , k ) + x ( i , r 1 , k ) + + x ( i , r , k 1 ) x ( i 1 , r 1 , k ) x ( i 1 , r , k 1 ) x ( i , r 1 , k 1 ) + x ( i 1 , r 1 , k 1 ) ] + + D A [ x ( i + a , r + b , k + h ) x ( i + a , r b 1 , k + h ) x ( i , a 1 , r + b , k + h ) x ( i a 1 , r b 1 , k + h ) x ( i + a , r + b , k h 1 ) + x ( i + a , r b 1 , k h 1 ) + + x ( i a 1 , r + b , k h 1 ) x ( i a 1 , r b 1 , k h 1 ) ]
From Equation (50) it follows that for the recursive calculation of g(i, r, k), and in accordance with the above relation, 25 additions and 2 multiplications only are needed. In Figure 3, we show the spatial positioning of the voxels, used for the recursive calculation of the g(i, r, k) value.

3.3. Frequency Response Analysis of the Recursive Sliding Locally-Adaptive Denoising 3D Filter

The CFP of the filter is defined after replacing z 1 = e j ω 1 ,   z 2 = e j ω 2 , and z 3 = e j ω 3 in Equation (48):
H g ( e j ω 1 , e j ω 2 , e j ω 3 ) = C + D A ( e j a ω 1 e j ( a + 1 ) ω 1 1 e j ω 1 ) ( e j b ω 2 e j ( b + 1 ) ω 2 1 e j ω 2 ) ( e j h ω 3 e j ( h + 1 ) ω 3 1 e j ω 3 ) .
Taking into account that:
| e j a ω 1 e j ( a + 1 ) ω 1 1 e j ω 1 | = sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) ,   | e j b ω 2 e j ( b + 1 ) ω 2 1 e j ω 2 | = sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) , and | e j h ω 3 e j ( h + 1 ) ω 3 1 e j ω 3 | = sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) , for A 1 = ( 2 a + 1 ) , A 2 = ( 2 b + 1 ) , and A 3 = ( 2 h + 1 ) ,
from Equation (51), it follows that:
H g ( e j ω 1 , e j ω 2 , e j ω 3 ) = C + D A | sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) | | sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) | | sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) |
Correspondingly, the filter AFR and PFR are defined by the relations:
M g ( ω 1 , ω 2 , ω 3 ) = C + ( D A ) | sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) | | sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) | | sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) | , and   ϕ ( ω 1 , ω 2 , ω 3 ) = 0 .
The obtained results prove that the filter does not introduce phase distortions. For the low frequencies ω 1 = ω 2 = ω 3 = 0 , M g ( 0 , 0 , 0 ) = C + ( D / A ) , while for the high frequencies ω 1 = 2 π n / A 1 , ω 2 = 2 π n / A 2 , and ω 3 = 2 π n / A 3 , for n = 1,2,…, M g ( ω 1 , ω 2 , ω 3 ) = C . The term D / A = v 2 / A σ x 2 ( i , r , k ) defines the reduction of the AFR value for the high frequencies divisible by n towards that for the low frequencies, for ω 1 = ω 2 = ω 3 = 0 . The reduction is proportional to the relation v 2 / σ x 2 ( i , r , k ) , and correspondingly, together with the increase in v 2 towards σ x 2 ( i , r , k ) , the suppression grows with regard to the high frequencies, divisible by n, whose main part are the additive noise components.

3.4. CC of the Algorithm for Locally-Adaptive Recursive 3D Image Denoising

The number of operations OR needed for the recursive calculation of g(i, r, k) for all voxels of tensor X of size M × N × K in correspondence with Equation (39), is defined on the basis of the relations below:
-
The number of operations needed for the recursive calculation of μx(i, r, k): O1 = 15 MNK;
-
The number of operations needed for the recursive calculation of p(i, r, k): O2 = 31 MNK;
-
The number of operations needed for the calculation of σ x 2 ( i , r , k ) : O3 = 2 MNK;
-
The number of operations needed for the calculation of v 2 : O4 = MNK;
-
The number of operations needed for the calculation of C and D: O5 = 3 MNK;
-
The number of operations needed for the recursive calculation of g(i, r, k): O6 = 27 MNK.
The total number of operations needed for the recursive calculation of g(i, r, k) is: O R = i = 1 6 O i = 79 M N K . For the non-recursive calculation of g(i, r, k): O N R = i = 1 4 O i = M N K [ 3 ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) + 3 ] .
In this case, the reduction coefficient for CC is:
R 5 = O N R / O R = [ 3 ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) + 3 ] / 79 .
Example 3: Let a = b = h = 5 (3D window of size 11 × 11 × 11). Then R 5 = 50.58. In this case, the calculations needed for the recursive approach are accelerated more than 50 times, compared to the non-recursive. On Figure 4 we show the graphic representation of R c for c = a = b = h, i.e., for a cubic window of size c × c × c.
It is easy to notice from Figure 4, that for small parameter values the reduction coefficient R is also relatively small, and increases together with the linear growth of the parameter.

4. Recursive 3D Image Sharpness through Adaptive Unsharp Masking

4.1. Description of the Non-Recursive 3D Image Sharpness through Sliding Adaptive Unsharp Masking 3D Filter

In this work, the non-recursive 3D image filtering is based on the mathematical description of the sliding adaptive unsharp masking 2D filter. The 3D generalization is represented by the relation below:
g ( i , r , k ) = { x ( i , r , k ) + λ [ x ( i , r , k ) μ x ( i , r , k ) ]   f o r   | x ( i , r , k ) μ x ( i , r , k ) | δ , x ( i , r , k ) i n o t h e r c a s e s ,   for   0 < λ < 1 ,
where g(i, r, k) denotes a voxel from the filtered image, with enhanced sharpness; λ is a coefficient, used to control the sharpness enhancement, whose value is chosen experimentally in the range 0 < λ < 1; δ is a threshold, δ ≥ 2σ; (σ—the noise variance); μx(i, r, k) is the local mean value of the voxels in the window W(i, r, k), recursively calculated in correspondence with Equation (7).

4.2. Transfer Function of the Recursive Adaptive Unsharp Masking 3D Filter

For the case when | x ( i , r , k ) μ x ( i , r , k ) | δ , the filter transfer function is defined by the relation:
H g ( z 1 , z 2 , z 3 ) = G ( z 1 , z 2 , z 3 ) X ( z 1 , z 2 , z 3 ) = 1 + λ [ 1 ( z 1 a z 1 ( a + 1 ) ) ( z 2 b z 2 ( b + 1 ) ) ( z 3 h z 3 ( h + 1 ) ) A ( 1 z 1 1 ) ( 1 z 2 1 ) ( 1 z 3 1 ) ] = = ( 1 + λ ) ( 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 ( λ A ) z 1 a z 2 b z 3 h z 1 a z 2 ( b + 1 ) z 3 h z 1 ( a + 1 ) z 2 b z 3 h + z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 h z 1 a z 2 b z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 ( λ A ) z 1 a z 2 ( b + 1 ) z 3 ( h + 1 ) + z 1 ( a + 1 ) z 2 b z 3 ( h + 1 ) ) z 1 ( a + 1 ) z 2 ( b + 1 ) z 3 ( h + 1 ) 1 z 1 1 z 2 1 z 3 1 + z 1 1 z 2 1 + z 1 1 z 3 1 + z 2 1 z 3 1 z 1 1 z 2 1 z 3 1 .
After inverse 3D z-transform, from Equation (56) the following is obtained:
g ( i , r , k ) = g ( i 1 , r , k ) + g ( i , r 1 , k ) + g ( i , r , k 1 ) g ( i 1 , r 1 , k ) g ( i 1 , r , k 1 ) g ( i , r 1 , k 1 ) + + g ( i 1 , r 1 , k 1 ) + ( 1 + λ ) [ x ( i , r , k ) x ( i 1 , r , k ) x ( i , r 1 , k ) x ( i , r , k 1 ) + x ( i 1 , r 1 , k ) + + x ( i 1 , r , k 1 ) + x ( i , r 1 , k 1 ) x ( i 1 , r 1 , k 1 ) ] ( λ / A ) [ x ( i + a , r + b , k + h ) x ( i + a , r b 1 , k + h ) x ( i a 1 , r + b , k + h ) + x ( i a 1 , r b 1 , k + h ) x ( i + a , r + b , k h 1 ) + + x ( i + a , r b 1 , k h 1 ) + x ( i a 1 , r + b , k h 1 ) x ( i a 1 , r b 1 , k h 1 ) ] .
The spatial positioning of the voxels, used for the recursive calculation of g(i, r, k) in correspondence with Equation (57), coincides with those of the voxels, defined for the previous algorithm (shown in Figure 3).

4.3. Amplitude–Frequency Response of the Recursive Adaptive Unsharp Masking 3D Filter

The AFR is defined by the SM3DF response, in correspondence with Equations (17) and (47):
M g ( ω 1 , ω 2 , ω 3 ) = 1 + λ [ 1 M ( ω 1 , ω 2 , ω 3 ) ] = = 1 + λ [ 1 | sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) | | sin c ( A 2 ω 2 / 2 ) sin c ( ω 2 / 2 ) | | sin c ( A 3 ω 3 / 2 ) sin c ( ω 3 / 2 ) | ] .
If   ω 2 = ω 3 = 0 ,   then   M g ( ω 1 ) = 1 + λ [ 1 M ( ω 1 ) ] = 1 + λ [ 1 | sin c ( A 1 ω 1 / 2 ) sin c ( ω 1 / 2 ) | ]
If   ω 1 = 0 ,   then   M g ( 0 ) = 1 + λ [ 1 M ( 0 ) ] = 1 + λ [ 1 | sin c ( 0 ) sin c ( 0 ) | ] = 1 .
If   ω 1 = 2 π / A 1 ,   then   M g ( 2 π / A 1 ) = = 1 + λ [ 1 | sin c ( π ) sin c ( π / A 1 ) | ] = 1 + λ
Hence, the amplitudes of the high frequencies ω 1 = 2 π n / A 1 , divisible to n = 1,2,…, are accelerated ( 1 + λ ) times towards those of the low frequencies, ω 1 = 0 . Similar properties have the adaptive unsharp masking 1D filters, whose AFRs are M g ( ω 2 ) and M g ( ω 3 ) , correspondingly.

4.4. Implementation of the Recursive Unsharp Masking 3D Filter through Cascade Recursive Unsharp Masking 1D Filters

For further simplification, it is possible, instead of applying one 3D filter, to use three 1D filters: the first one in the horizontal direction, the second in the vertical direction, and the third in the lateral direction, represented by the relations below:
-
for the first line of the image in directions x/y/z respectively, we use the relations:
y ( i , r , k ) = x ( i , r , k ) + λ 1 [ x ( i , r , k ) ( 1 / A 1 ) s = a a x ( i + s , r , k ) ] ,
z ( i , r , k ) = y ( i , r , k ) + λ 2 [ y ( i , r , k ) ( 1 / A 2 ) m = b b y ( i , r + m , k ) ] ,
g ( i , r , k ) = z ( i , r , k ) + λ 3 [ z ( i , r , k ) ( 1 / A 3 ) n = h h z ( i , r , k + n ) ] ,
where λ = λ 1 × λ 2 × λ 3 , y(i, r, k) and q(i, r, k) represent the voxel (i, r, k) of the intermediate images, obtained as a result of the first, second and third filtration. By analogy with Equation (4), for the remaining lines of the image, Equations (62)–(64) are presented in a recursive form:
y ( i , r , k ) = y ( i 1 , r , k ) + ( 1 + λ 1 ) [ x ( i , r , k ) x ( i 1 , r , k ) ] +   + ( λ 1 / A 1 ) [ x ( i + a , r , k ) x ( i a 1 , r , k ) ] ; q ( i , r , k ) = q ( i , r 1 , k ) + ( 1 + λ 2 ) [ y ( i , r , k ) y ( i , r 1 , k ) ] +   + ( λ 2 / A 2 ) [ y ( i , r + b , k ) y ( i , r b 1 , k ) ] ; g ( i , r , k ) = g ( i , r , k 1 ) + ( 1 + λ 3 ) [ q ( i , r , k ) q ( i , r , k 1 ) ] +   + ( λ 3 / A 3 ) [ q ( i , r , k + h ) q ( i , r , k h 1 ) ] .
If λ 1 = λ 2 = λ 3 = λ 0 = η = λ 3 , then the system of Equation (65) turns into:
y ( i , r , k ) = y ( i 1 , r , k ) + ( 1 + η ) [ x ( i , r , k ) x ( i 1 , r , k ) ] + η A 1 [ x ( i + a , r , k ) x ( i a 1 , r , k ) ] ; q ( i , r , k ) = q ( i , r 1 , k ) + ( 1 + η ) [ y ( i , r , k ) y ( i , r 1 , k ) ] + η A 2 [ y ( i , r + b , k ) y ( i , r b 1 , k ) ] ; g ( i , r , k ) = g ( i , r , k 1 ) + ( 1 + η ) [ q ( i , r , k ) q ( i , r , k 1 ) ] + η A 3 [ q ( i , r , k + h ) q ( i , r , k h 1 ) ] .
The system of Equation (66) replaces the recursive relations in Equation (57).

4.5. Computational Complexity of the Recursive Sliding Adaptive Unsharp Masking 3D Filter

For the CC evaluation of the recursive sliding adaptive unsharp masking 3D filter, the number of executed arithmetic operations should be defined.
The number of terms in Equation (57) is always 25, and does not depend on the filter window size ( 2 a + 1 ) × ( 2 b + 1 ) × ( 2 h + 1 ) . The reduced number of arithmetic operations is defined by the following relation:
R 6 = ( 1 / 24 ) [ ( 2 a + 1 ) ( 2 b + 1 ) ( 2 h + 1 ) + 2 ]
Example 4: if a = b = h = 5 (i.e., for a 3D window of size 11 × 11 × 11), then the reduction coefficient is R 6 = 55.54 , i.e., the number of operations, executed by the recursive filter, is more than 55 times lower. In Figure 5 we show the relation between R 6 and the cubic window size, for a = b = h = c.
For the case when three cascade recursive unsharp masking 1D filters are used, the reduced number of arithmetic operations R 7 for each voxel, in correspondence with Equation (66), is:
R 7 = 2 a + 4 6 + 2 b + 4 6 + 2 h + 4 6 = ( 1 / 3 ) ( a + b + h ) + 2 .
Example 5: for a = b = h = 5 (3D cubic window of size 11 × 11 × 11) we obtain R 7 = 7 , i.e., as a result of the recursive approach, the number of operations is 7 times lower. The algorithm efficiency is additionally enhanced after triple use of the 1D filter.
The comparison between the CC of the recursive filtration through one 3D filter and that calculated for the case when three cascade 1D filters of the same parameters (a = b = h = c) are used, gives the result below:
R 6 / R 7 = [ ( 2 c + 1 ) 3 + 2 ] / 24 ( c + 2 ) .
In this example, for c = 5 we obtain R 6 / R 7 = 7.93 .

5. Discussion and Conclusions

In this work, two basic algorithms for the locally-adaptive processing of tensor 3D images are presented, based on the use of the recursive SM3DF with a central symmetric 3D kernel: for adaptive noise filtration, and for sharpness enhancement. The main characteristics (spatial and frequency) of the algorithms are analyzed for when a progressive linear image scan is used. The CC of each of the analyzed algorithms is also evaluated.
As it is known, the famous recursive and non-recursive filters have their advantages and shortcomings. For example, recursive filters have higher computational efficiency, and offer easier usage, but the software implementation is more complicated and additional buffer is needed to maintain the recursive coefficients’ values. In addition to this, the non-recursive approach does not use feedback, has lower sensitivity, and the delay in providing a response is greater and (depending on the application) needs more processing power [21]. In brief, depending on the objectives, recursive or non-recursive filters are preferred. Their use for multidimensional visual information processing implies a more sophisticated approach. As a result of the analysis presented in this research, it follows that:
-
The obtained results confirm that the recursive and the non-recursive locally-adaptive filtering presented in our approach are practically equivalent in respect of the calculated mean output voxel value;
-
The SM3DF filter does not introduce phase distortions;
-
The recursive 3D filter could be replaced by three identical recursive 1D filters, sequentially bonded together, which use simplified algorithms for the processing in horizontal, vertical and lateral directions. In this case, however, three scans of the input tensor are needed, instead of one;
-
The comparison between the recursive and the non-recursive filtration shows that the recursive filtration, implemented as three sequential 1D filters, reduces the CC significantly. Moreover, in the case of non-recursive processing, the filter window size is limited by the horizontal size of the tensor, which is an advantage, when compared to the recursive filtration;
-
Some considerations exist about the filter window size. The minimum possible size is 3 × 3 × 3, and it offers a small CC reduction, but the algorithm is really efficient for a larger window size. As it is shown in the examples, the CC reduction is very high for windows of size 5 or more. The relation is shown in Example 3, where the CC is reduced by approximately 50 times, for a window of size 11 × 11 × 11. Naturally, the window size should be selected in accordance with the image dimensions, and for very large pictures (for example, satellite images of size 10,000 × 10,000 or more) the window could be increased correspondingly, which will give better results;
-
The recursive approach needs additional memory to save the recursive coefficients, but it is incomparably smaller than the buffer, which is needed for image processing;
-
The use of the analyzed recursive 3D algorithms for locally-adaptive processing of tensor images results in significant CC reduction, when compared to similar non-recursive algorithms’ performance;
-
The filtration CC in the tensor frequency space, evaluated through the number of basic operations needed, is twice as low as that needed for the voxel space.
-
The trends of future work will be aimed at the development of new recursive algorithms, with application to various areas, mainly focused on:
-
Adaptation of the created new algorithms to the casual area shape, by using other kinds of 3D scan for the tensor voxels, such as, for example, the recursive scans of Hilbert, Peano, Morton and Sierpinski [22], etc. Compared to the linear, the recursive scans in the three spatial orthogonal directions retain better the existing correlation between neighboring voxels, which enhances the tensor processing efficiency;
-
Application of the recursive SM3DF in the 3D CNN, where locally-adaptive 3D filtering is performed in the network layers. As a result of the CC reduction in the 3D filtration, new capabilities are available for the efficiency enhancement of the tensor CNN;
-
Creation of recursive algorithms for locally-adaptive non-linear 3D filtration of tensor images;
-
Software implementation of the algorithm;
-
Creation of recursive algorithms for parallel processing of multidimensional signals, appropriate for hardware implementation, etc.

Author Contributions

Conceptualization, R.K. (Roumen Kountchev) and R.M.; methodology, R.K. (Roumen Kountchev); software, R.M.; validation, R.K. (Roumen Kountchev), R.M. and R.K. (Roumiana Kountcheva); formal analysis, R.K. (Roumen Kountchev) and R.M.; investigation, R.M.; resources, R.K. (Roumen Kountchev), R.M. and R.K. (Roumiana Kountcheva); data curation, R.K. (Roumen Kountchev) and R.M.; writing—original draft preparation, R.K. (Roumen Kountchev); writing—review and editing, R.M. and R.K. (Roumiana Kountcheva); visualization, R.K. (Roumen Kountchev), R.M. and R.K. (Roumiana Kountcheva); supervision, R.M.; project administration, R.M.; funding acquisition, R.M. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the Bulgarian National Science Fund: Project No. KP-06-H27/16: “Development of efficient methods and algorithms for tensor-based processing and analysis of multidimensional images with application in interdisciplinary areas”.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Gonzalez, R.; Woods, R. Digital Image Processing, 4th ed.; Pearson: New York, NY, USA, 2018. [Google Scholar]
  2. Pratt, W. Introduction to Digital Image Processing; CRC Press: Boca Raton, FL, USA, 2014. [Google Scholar]
  3. Reed, T. Digital Image Sequence Processing, Compression, and Analysis; CRC Press: Boca Raton, FL, USA, 2004. [Google Scholar] [CrossRef]
  4. Ali, R.; Hardie, R. Recursive Non-Local Means Filter for Video Denoising. EURASIP J. Image Video Process. 2017, 2017, 29. [Google Scholar] [CrossRef] [Green Version]
  5. Erkan, U.; Enginoglu, S.; Thanh, D. A Recursive Mean Filter for Image Denoising, Intern. In Proceedings of the Conference on Artificial Intelligence and Data Processing (IDAP), Malatya, Turkey, 21–22 September 2019. [Google Scholar] [CrossRef]
  6. Tran, M. 3D Image Analysis with Variational Methods and Wavelets: Applications to Medical Image Processing. Ph.D. Thesis, Université d’Orléans, Orléans, France, 2012. [Google Scholar]
  7. Woods, J. Multidimensional Signal, Image, and Video Processing and Coding, 2nd ed.; Academic Press: Cambridge, MA, USA; Elsevier: Amsterdam, The Netherlands, 2012. [Google Scholar]
  8. Jin, F.; Fieguth, P.; Winger, L.; Jernigan, E. Adaptive Wiener Filtering of Noisy Images and Image Sequences. In Proceedings of the International Conference on Image Processing, Barcelona, Spain, 14–17 September 2003. [Google Scholar] [CrossRef]
  9. Cichocki, A.; Lee, N.; Oseledets, I.; Phan, A.; Zhao, Q.; Mandic, D. Tensor Networks for Dimensionality Reduction and Large-Scale Optimization, Part 1: Low-Rank Tensor Decompositions. Found. Trends Mach. Learn. 2016, 9, 249–429. [Google Scholar] [CrossRef] [Green Version]
  10. Kamnitsas, K.; Ledig, C.; Newcombe, V.; Simpson, J.; Kane, A.; Menon, D.; Rueckert, D.; Glocker, B. Efficient multi-scale 3D CNN with fully connected CRF for accurate brain lesion segmentation. Med. Image Anal. 2017, 36, 61–78. [Google Scholar] [CrossRef] [PubMed]
  11. Subhojit, S.; Chowdhury, S.; Laha, S.; Dey, D. Use of Non-local Means Filter to Denoise Image Corrupted by Salt and Pepper Noise. Signal Image Process. Int. J. SIPIJ 2012, 3, 223–235. [Google Scholar]
  12. Coupe, P.; Manjon, J.; Robles, M.; Collins, L. Adaptive Multiresolution Non-Local Means Filter for 3D MR Image Denoising, IET Image Processing. Inst. Eng. Technol. 2011; preprint. [Google Scholar]
  13. Buades, A.; Coll, B.; Morel, J.M. A non-local algorithm for image denoising. In Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), San Diego, CA, USA, 20–25 June 2005. [Google Scholar] [CrossRef]
  14. Westin, C.F.; Knutsson, H.; Kikinis, R. Adaptive Image Filtering. In Handbook of Medical Imaging; Bankman, I., Ed.; Academic Press: Cambridge, MA, USA, 2000; 22p. [Google Scholar]
  15. Mirmozaffari, M. Filtering in image processing. ENG Trans. 2020, 1, 1–5. [Google Scholar]
  16. Li, Z.; Yu, L.; Trzasko, J.D.; Lake, D.; Blezek, D.; Fletcher, J.; McCollough, C.; Manduca, A. Adaptive nonlocal means filtering based on local noise level for CT denoising. Med. Phys. 2014, 41, 011908. [Google Scholar] [CrossRef] [PubMed]
  17. Golilarz, N.; Addeh, A.; Gao, H.; Ali, L.; Roshandeh, A.M.; Munir, H.M.; Khan, R. A new automatic method for control chart patterns recognition based on ConvNet and Harris Hawks meta heuristic optimization algorithm. IEEE Access 2019, 7, 149398–149405. [Google Scholar] [CrossRef]
  18. Rakshit, S.; Ghosh, A.; Shankar, B.U. Fast mean filtering technique (FMFT). Pattern Recognit. 2007, 40, 890–897. [Google Scholar] [CrossRef]
  19. Nakariyakul, S. Fast spatial averaging: An efficient algorithm for 2D mean filtering. J. Supercomput. 2013, 65, 262–273. [Google Scholar] [CrossRef]
  20. Palani, S. The z-Transform Analysis of Discrete Time Signals and Systems. In Signals and Systems; Palani, S., Ed.; Springer: Cham, Switzerland, 2021; pp. 921–1055. [Google Scholar] [CrossRef]
  21. Abbas, M.; Gustafsson, O.; Wanhammar, L. Power Estimation of Recursive and Non-Recursive CIC Filters Implemented in Deep-Submicron Technology. In Proceedings of the 2010 International Conference on Green Circuits and Systems, Shanghai, China, 21–23 June 2010; pp. 221–225. [Google Scholar]
  22. Jin, G.; Crummey, J. SFCGen: A framework for efficient generation of multi-dimensional space filling curves by recursion. ACM Trans. Math. Softw. 2005, 31, 120–148. [Google Scholar] [CrossRef]
Figure 1. 3D progressive linear scan representation for the tensor X of size 5 × 5 × 4.
Figure 1. 3D progressive linear scan representation for the tensor X of size 5 × 5 × 4.
Symmetry 15 01493 g001
Figure 2. Spatial positioning of voxels (in blue) used for the recursive calculation of μx(i, r, k) in the 3D sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1).
Figure 2. Spatial positioning of voxels (in blue) used for the recursive calculation of μx(i, r, k) in the 3D sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1).
Symmetry 15 01493 g002
Figure 3. Spatial positioning of voxels (in blue) used for the recursive calculation of g(i, r, k) in a 3D sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1).
Figure 3. Spatial positioning of voxels (in blue) used for the recursive calculation of g(i, r, k) in a 3D sliding window W(i, r, k) of size (2a + 1) × (2b + 1) × (2h + 1).
Symmetry 15 01493 g003
Figure 4. CC reduction of the locally-adaptive recursive 3D image denoising, as a function of the cubic window size.
Figure 4. CC reduction of the locally-adaptive recursive 3D image denoising, as a function of the cubic window size.
Symmetry 15 01493 g004
Figure 5. CC reduction of the recursive sliding adaptive unsharp masking 3D filter, as a function of the cubic window size.
Figure 5. CC reduction of the recursive sliding adaptive unsharp masking 3D filter, as a function of the cubic window size.
Symmetry 15 01493 g005
Table 1. Experimental results for R3 values.
Table 1. Experimental results for R3 values.
m345678910
R 3 0.931.131.331.531.731.932.132.33
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kountchev, R.; Mironov, R.; Kountcheva, R. Analysis of the Recursive Locally-Adaptive Filtration of 3D Tensor Images. Symmetry 2023, 15, 1493. https://doi.org/10.3390/sym15081493

AMA Style

Kountchev R, Mironov R, Kountcheva R. Analysis of the Recursive Locally-Adaptive Filtration of 3D Tensor Images. Symmetry. 2023; 15(8):1493. https://doi.org/10.3390/sym15081493

Chicago/Turabian Style

Kountchev, Roumen, Rumen Mironov, and Roumiana Kountcheva. 2023. "Analysis of the Recursive Locally-Adaptive Filtration of 3D Tensor Images" Symmetry 15, no. 8: 1493. https://doi.org/10.3390/sym15081493

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop