Next Article in Journal
Spatial-Temporal Traffic Flow Control on Motorways Using Distributed Multi-Agent Reinforcement Learning
Next Article in Special Issue
Modeling of Hyperparameter Tuned Deep Learning Model for Automated Image Captioning
Previous Article in Journal
Beyond Topological Persistence: Starting from Networks
Previous Article in Special Issue
Automatic Image Characterization of Psoriasis Lesions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Unified Mathematical Formulation of Monogenic Phase Congruency

by
Manuel G. Forero
1,*,† and
Carlos A. Jacanamejoy
2,*,†
1
Semillero Lún, Grupo D+Tec, Faculty of Engineering, Universidad de Ibagué, Ibagué 730007, Colombia
2
Semillero Lún, Grupo Naturatu, Faculty of Natural Sciences and Mathematics, Universidad de Ibagué, Ibagué 730007, Colombia
*
Authors to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2021, 9(23), 3080; https://doi.org/10.3390/math9233080
Submission received: 20 October 2021 / Revised: 24 November 2021 / Accepted: 25 November 2021 / Published: 30 November 2021
(This article belongs to the Special Issue Mathematical Approaches to Image Processing with Applications)

Abstract

:
Phase congruency is a technique that has been used for edge, corner and symmetry detection. Its implementation through the use of monogenic filters has improved its computational cost. For this purpose, different methods of implementation have been published, but they do not use a common notation, which makes it difficult to understand. Therefore, this paper presents a unified mathematical formulation that allows a general understanding of the Monogenic phase congruency concepts and establishes criteria for its use. A new protocol for parameter tuning is also described, allowing better practical results to be obtained with this technique. Some examples are presented allowing one to observe the changes produced in the parameter tuning, evidencing the validity of the proposed criteria.

1. Introduction

Phase congruency (PC) is a technique used for edge detection, performed in the frequency domain, presenting as advantages that it is equally sensitive to high- and low-intensity changes in the signal, also allowing the detection of edges, in the sense of Canny’s definition [1], ridges and valleys, as shown by Kovesi [2] and illustrated in Figure 1, having as disadvantages its higher computational cost and the complexity for its parameter tuning. PC is a technique, introduced by [3], that appears as consequence of the work developed around the study of Mach bands, which consist of bands adjacent to different light intensities that generate an illusion that exaggerates the edges of the bands. After different works around the Mach bands, it became evident that it is possible to identify structures perceived by the human eye from the phase coincidences of the Fourier components [4], in which it is postulated that its most significiant features, i.e., its edges, are found where the phase coincidence of their frequency components is maximal, using the local energy of the image for its evaluation. Later, Kovesi introduced a new imaging tool based on this model [5]. This method, unlike other segmentation techniques, employs the phase of the frequency components and not the amplitude or frequency of the signal, which at first was unattractive because of its high computational cost and noise sensitivity.
Given the drawbacks of his initial proposal, Kovesi introduced several modifications [6,7], which made it a benchmark. Parallel to Kovesi’s studies, important advances were made in image filter theory. Here, the concept of monogenic filters appears as an alternative to implement more efficiently phase congruency [8]. Later, the mathematical basis of the concept of monogenic signal was established. However, it had as a disadvantage the complexity of the mathematical theory; therefore, it was not given much interest. However, Kovesi implemented phase congruency using these concepts and extracted the direct current (DC) component of the image, as suggested by Moisan et al. [9]. Unfortunately, Kovesi did not publish this work, but this modification appears in the free code that Kovesi published on his website [10]. Thus, although the use of monogenic filters in phase congruency was proposed as an implementation alternative in 2000 [8], it was only until 2014 that a paper appeared, where phase congruency was quantified using this concept.
Phase congruency has been used for edge detection segmentation, corner detection and as a descriptor, among other uses, acquiring particular importance in recent years for the registration of multimodality images since it is not affected by the amplitude of the signals in the different modalities.
Different advances appeared from Kovesi’s seminal work in 1996 [5], but they did not employ a common notation, making the use and understanding of phase congruency difficult, and later works mostly used Kovesi’s original results, without obtaining greater benefit from PC and later advances developed by other researchers. To overcome this difficulty, this work presents a unified mathematical formulation of phase congruency applied in digital image processing. To this end, basic principles for its implementation are taken into account to have a global vision of the unified concepts. In this way, it is sought to show clearly potentially exploitable aspects of the PC, to obtain greater benefit from its capabilities and to adapt it more easily to particular cases of use.
In Section 2, a comprehensive overview is given of the phase congruency described in Kovesi’s seminal paper and its implementation using monogenic filters to show that it can be presented as the product of three factors, a concept previously introduced by the authors. In Section 3, an analysis of new formulations for obtaining phase congruency is made, showing that all of them can be represented in a general way by the consistent mathematical expression of the product of three factors, previously mentioned. Section 4 describes the method to be followed for the adjustment of the technique parameters, taking advantage of the proposed formulation, in which the global parameters are separated from those of each factor. Section 5 presents some results, and Section 6 presents the conclusions.

2. Phase Congruency

The phase congruency principle allows identifying regions where considerable changes occur in a signal, as shown in Figure 2, where it is evident how the phases coincide when the square signal has a high variation. Morrone and Owens [11] mathematically defined the phase congruency function by expanding the Fourier series for a location x as:
P C ( x ) = max ϕ ¯ ( x ) [ 0 , 2 π ] n = 1 N A n cos ϕ n ( x ) ϕ ¯ ( x ) n = 1 N A n ,
where ϕ ( x ) expresses the local phase at x and A n the amplitude of the n-th Fourier component. Each component A n ( x ) is associated with a different η scale. η = 1 corresponds to the smallest scale, determined by the largest frequency component, n = N , i.e., η = N n + 1 . Therefore, a scale η is numerically represented by a value different from its n-th component in frequency. The value of ϕ ¯ ( x ) that maximizes this equation is the average phase weighted by the amplitude at the analyzed point x. Since the variation of ϕ ¯ ( x ) affects the result of the cosine, a rough way to maximize (1) is to minimize ϕ n ( x ) ϕ ¯ ( x ) , because:
lim ( ϕ n ( x ) ϕ ¯ ( x ) ) 0 cos ( ϕ n ( x ) ϕ ¯ ( x ) ) = 1 ,
where the maximum value of the cosine function implies the minimum value of ϕ n ( x ) ϕ ¯ ( x ) , and, in addition, it is consistent with the fact that, as the cosine function approaches the maximum, its argument in absolute value is close to the minimum [2].

2.1. Local Energy and Phase Congruency

Phase congruency, as presented in (1), is difficult to calculate. An alternative was proposed in 1989 by Venkatesh and Owens [12], who found that looking for the points of maximum phase congruency is equivalent to searching for peaks in the local energy function. The local energy function of the luminance profile I ( x ) in a dimension is given by:
E ( x ) = F ( x ) 2 + H ( x ) 2 ,
where F ( x ) is the signal without the direct current (DC) coefficient and H ( x ) is the Hilbert transform of F ( x ) (90° phase shift). Typically, it is possible to have approximations of F ( x ) and H ( x ) using quadrature filter pairs. The relationship between energy and phase congruency is shown in [12], which allows the following equation:
E ( x ) = P C ( x ) n = 1 N A n ( x ) .
Thus, the phase congruency is directly proportional to the local energy function. Therefore, the local energy peaks correspond to the phase congruency ones. The relationship between phase congruency, energy and the sum of the amplitudes of the Fourier components can be seen geometrically in Figure 3a; in which, if the phases of each Fourier component were the same, the magnitude of the resulting vector would coincide with the sum of the different magnitudes of each component—in other words, A n = E ( x ) . Otherwise, if the phases differ, it is always the case that A n > E ( x ) , which implies that P C ( x ) is at most one and decreases according to the phase differences of the components toward a minimum of zero. Figure 3b introduces the concept of mean phase deviation ϕ ( x ) which is defined by the angle of the rectangle triangle originated by representing the triangular inequality, where n A n ( x ) is always greater than or equal to E ( x ) .

2.2. Approximation of Fourier Components

According to Equation (4), it is necessary to calculate the energy and the sum of the components A n ( x ) . For this purpose, approximations were made using bandpass filters at different scales. Therefore, the scales of the filters define the approximation of the components A n ( x ) .
Since it is important to preserve phase information, linear filters in phase must be used. To this end, quadrature filter pairs should be employed, i.e., operators that allow extracting the symmetric and antisymmetric components (difference of 90° in phase) of the original signal. For this purpose, logarithmic Gabor filters [5] were used, whose transfer function is given by:
G ( ω ) = exp ( log ( ω / ω 0 ) ) 2 2 ( log ( k / ω 0 ) ) 2 ,
where ω 0 is the center frequency and k is a parameter that modifies the filter bandwidth. Thus, the bandwidth of each filter is determined by the ratio σ o = k / ω 0 , which, for practical purposes, is made constant on all components n.
Let I be a one-dimensional signal, and M n e and M n o , the filters of the n-th components of the even (cosine) and odd (sine) symmetries the output of each pair of quadrature filters, can be written in vector form:
[ e n ( x ) , o n ( x ) ] = [ I ( x ) M n e , I ( x ) M n o ] ,
obtaining the even e n ( x ) and odd o n ( x ) parts of the n-th component when convolving I with the n even filter M n e and M n o .
From e n and o n , the energy E ( x ) , presented in the (3), can be expressed mathematically as:
E ( x ) = n = 1 N e n ( x ) 2 + n = 1 N o n ( x ) 2 .
The amplitude of the transform obtained for A n is found in the following way [2]:
A n ( x ) = e n ( x ) 2 + o n ( x ) 2 ,
and the phase:
ϕ n ( x ) = a tan 2 ( e n ( x ) , o n ( x ) ) ,
being the function a tan2 the arctangent, whose range is defined in the interval [ π , π ] . In each point x of the signal I, there is a complex vector in each scale, which can be used to obtain the magnitude and phase of the Fourier components in the point and thus to evaluate the phase congruency in x.
The filter bank is designed in such a way that its transfer function is a uniform spectrum, which is achieved by appropriately overlapping the transfer functions of the filters. It is important to note that a wide range of frequencies must be retained from the signal, since phase congruency must be present over a wide range of frequencies to be meaningful; otherwise, the PC in some bands is considered not relevant, as it does not correspond to the presence of a real edge (see Figure 4).
Given the representation in Figure 3a, it is possible to consider
F ( x ) = n = 1 N e n ( x ) ,
H ( x ) = n = 1 N o n ( x ) , and
n = 1 N A n ( x ) = n = 1 N e n ( x ) 2 + o n ( x ) 2 .
If phase congruency is obtained according to (4), a problem arises when all amplitudes are very small. To solve it, Kovesi adds a small positive constant ε < < 1 to the denominator of the phase congruency expression, as follows [2]:
P C ( x ) = E ( x ) n = 1 N A n ( x ) + ε ,
The appropriate value of ε depends on the accuracy of the calculations.

2.3. Calculation of Phase Congruency

Obtaining the even and odd symmetry components e n ( x ) and o n ( x ) requires the use of the Fourier transform to perform the filtering, which makes this operation computationally the most expensive for the calculation of the PC. Kovesi, in his original approach, used wavelet filters to obtain the frequency components [2]. However, this method is inefficient because at each scale, it is necessary to use several directional filters. This is illustrated in Figure 5a, where six filters are used per scale, for a total of 24 operations. Felsberg proposed the generalization of an analytical signal to two dimensions, which he called a monogenic signal, and suggested using it to calculate the phase of such a signal [8]. This form of representation can be used to package the two even and odd symmetry components e n ( x ) and o n ( x ) into a single complex signal, allowing the calculation of phase congruency to be accelerated by requiring only one filter for each scale, as illustrated in Figure 5b. This solution was implemented by Kovesi in a software version of the PC calculation, available on the internet and compatible with Matlab and Octave. Subsequently, the PC calculation employing monogenic filters was formalised by [14]. It should be noted that, although the computation of the PC is much more efficient using monogenic filters instead of wavelet filters, there are still new publications that implement the PC using wavelets [15,16,17,18,19,20,21], which may be due to the lack of knowledge of these advances, the absence of a simpler synthesized representation that facilitates the understanding of phase congruency and the lack of a method for tuning its parameters, which means that Kovesi’s original initial strategy is used without any kind of improvement; therefore, these last two aspects are dealt with in this work.

2.4. Phase Noise Compensation

A disadvantage of the PC is its high sensitivity to phase noise. Therefore, Kovesi makes the value of the PC equal to zero when the local energy does not exceed a threshold T [5], i.e.,:
P C ( x ) = E ( x ) T n = 1 N A n ( x ) + ε ,
where · represents the positive part function of “·”, i.e.,:
E ( x ) T = E ( x ) T if E ( x ) T > 0 0 if E ( x ) T 0 .
T is calculated from a noise estimation. Assuming that F ( x ) and H ( x ) follow a normal distribution, the energy E ( x ) given by E ( x ) = F ( x ) 2 + H ( x ) 2 follows a Rayleigh distribution [22], given by the expression:
R ( x ) = x σ 2 e x 2 2 σ 2 ,
where σ 2 is the normal distribution variance of the functions E ( x ) and H ( x ) . Using the mean μ R and the variance σ R 2 of the Rayleigh distribution yields:
T = μ R + k σ R ,
k is an empirical value that varies between 2 and 3; see [2]. The mean μ R and the variance σ R 2 are calculated as follows:
μ R = σ G π 2 , and σ R 2 = 4 π 2 σ G 2 ,
where σ G is the Rayleigh distribution mode, used as an approach to the energy function. Kovesi calculates σ G using the mode of the component A N ( x ) , called τ . Thus, σ G is expressed by a geometric sum [5]:
σ G = n = 0 N 1 τ 1 m n = τ 1 ( 1 / m ) N 1 ( 1 / m ) .
Kovesi proposed two alternatives for calculating the noise level, τ , at the highest frequency [10]. The first is based on the use of the mode of A N ( x ) , as mentioned previously, while the second assumes that A N ( x ) has a Rayleigh probability distribution, so that the noise level is given by:
τ = median ( A N ( x ) ) ln ( 4 ) .
The latter form is more robust, since it depends on the behavior of a larger histogram data set of A N ( x ) , unlike the first one, where only the mode is employed. Therefore, the scaling factor m between successive filters, the factor k and the mode τ allow one to calculate the noise threshold T according to Equations (16)–(18).
As can be seen in Equations (17) and (18), proposed by Kovesi for the noise threshold estimation T, the parameter σ o , on which the bandwidth of the filters depends is not taken into account. Since this parameter change affects the calculation of T [23], a new strategy was proposed for the estimation of noise from the histogram of the total energy by approximating it to a Weibull distribution [13].

2.5. Importance of the Frequency Component Distribution

To avoid the problem that occurs with extremely soft signals, phase congruency is weighted using a measure of the distribution of all its components in the frequency spectrum [2]. The dispersion of the frequency components s ( x ) is calculated for each position x, which is given by the sum of the component amplitudes divided by the maximum one. To normalize s ( x ) , it is further divided by the number of components used N. Thus, s ( x ) is expressed mathematically by Equation (20), where ε , defined above, is used again to avoid division by zero and also to reduce the effect produced by small values of A n .
s ( x ) = 1 N n = 1 N A n ( x ) ε + A m a x ( x ) .
The phase congruency weighting W ( x ) , given in Equation (21), is obtained as the composition between a sigmoid function and the measure of the dispersion corresponding to the frequency spectrum of different components s ( x ) . Other weighting functions can be employed, but the sigmoid is preferred for its simplicity.
W ( x ) = 1 1 + e γ ( c s ( x ) ) ,
where c represents the response cutoff value of the dispersion filter. Thus, below this value, the phase congruency values are penalized. The penalty is zero if c = 0 and maximum if c = 1 . The gain factor γ controls the sharpness of the cutoff. Thus, if γ is increased, the contrast increases [5]. Therefore,
P C ( x ) = W ( x ) E ( x ) T n = 1 N A n ( x ) + ε .
The weighting function allows one to reduce false PC responses when having a reduced number of frequencies. In addition, better edge, ridge and valley location are achieved, especially for those that have been smoothed out [2].

2.6. Phase Congruency Sensitivity

Adequate edge detection using the phase congruency technique depends on its sensitivity. By analyzing the expression (4) which calculates the ideal phase congruency, P C ( x ) is obtained as follows:
P C ( x ) = E ( x ) n = 1 N A n ( x ) = cos ( δ ( x ) ) .
In straightforward terms, the phase congruency depends on the angle δ ( x ) that, when presenting linear variations, makes it so that the sensitivity is given by the response of the cosine function. However, this is undesirable when detecting edges, since the cosine crest is smoothed as illustrated in blue in Figure 6.
Finally, to have a greater sensitivity, it is possible to directly use the angle δ ( x ) instead of its cosine, which is obtained from the expression:
δ ( x ) = arccos E ( x ) n = 1 N A n ( x ) ,
To obtain the phase congruency quantification function as 1 α | δ | , where α defines the linear sensitivity to phase changes, allowing one to discriminate more adequately the edges in an image. Its graphic representation can be seen in Figure 6. In the ideal case, a phase congruency quantization function as shown in Equation (23) would be sufficient to detect edges. However, in practice, the images are contaminated with noise and, in addition, the frequency spectrum distribution of the filter bank is not flat, which leads to the detection of false edges. Therefore, it is necessary to include in the phase congruency formulation two terms to penalize the noise effect and compensate the frequency spectrum distribution. Thus, phase congruency can be expressed in the following way:
P C ( x ) = W ( x ) 1 α δ ( x ) E ( x ) T E ( x ) + ε .
In practice, the absolute value of δ ( x ) is not required in the implementation of Equation (25), since the angle is always positive. Furthermore, an additional ε is inserted in the calculation of δ ( x ) to avoid zero division if all the A n components are zero, as expressed in Equation (13).
The terms of Equation (25) can be separated into three parts that address different concepts of the phase congruency implementation:
(i)
W ( x ) is a weighting function, according to the frequency distribution, as it appears in Equation (21).
(ii)
Phase congruency quantification function ( 1 α δ ( x ) ):
This term corresponds to the simple quantization of the PC, i.e., it measures the phase congruency with values between zero and one without making any adjustment. According to this expression, only small values of average phase deviation, δ ( x ) , are taken into account, while α limits its range, serving as an adjustment parameter of the PC sensitivity.
(iii)
Noise compensation ( E ( x ) T / ( E ( x ) + ε ) ): This factor is used to attenuate the phase congruency by acting as a threshold below which the term becomes zero when E ( x ) T . This prevents false edges from being detected in high-noise regions. Thus, the threshold T is estimated according to the image noise level. To avoid division by zero in Equation (25), a tiny constant ε is added, as in Equation (13).
Thus, phase congruency can be expressed in a general way as the product of three functions:
P C ( x ) = W ( x ) P C Q ( x ) N C ( x ) ,
where W ( x ) is a weighting function according to the frequency distribution, P C Q ( x ) is the basic phase congruency quantification and N C ( x ) is a noise compensation function.

2.7. Expansion of Phase Congruency to Two Dimensions Using Monogenic Filters

Although Kovesi initially used wavelets to find the A n frequency components of a I signal, in 2000, thanks to the advances in monogenic filters, Felsberg and Sommer proposed to use this theory to obtain 2D phase congruency by simplifying the calculations and, thus, the computational cost [8]. In 2001, to replicate the effect of the Hilbert transform in two dimensions, Felsberg and Sommer proposed the generalization to two dimensions of the analytical signal using the Riezs transform [24]. In this way, a two-dimensional function f ( x ) R 2 has as its analytical function f R , given by
f R ( x ) = x 2 π | x | 3 × f ( x ) f R ( x ) = h 2 ( x ) × f ( x ) ,
where
h 2 ( x ) = x 2 π | x | 3
with x = ( x 1 , x 2 ) . Therefore, in the two-dimensional frequency space u = ( u 1 , u 2 ) , the convolution corresponds to
F R ( u ) = i u | u | F ( u ) F R ( u ) = H 2 ( u ) F ( u ) .
When working with monogenic filters, it has to be taken into account that the function f ( x ) , which in this work corresponds to an image, must not contain a zero-frequencycomponent (DC component) [24]. Hence, an image must be filtered using the technique proposed by [9] to remove the DC component, before applying the monogenic filters. By expanding each component A n ( x ) which depends on a scaling x in 1D space to 2D space, the above term becomes A n ( x ) which now depends on a two-dimensional vector x , so that
A n ( x ) = f n ( x ) 2 + | f R n ( x ) | 2 ,
where f n ( x ) is the result of filtering the image without DC component on the scale n with the logarithmic-Gabor (log-Gabor) function. f n ( x ) is the extension of e n from one to two dimensions and is therefore denoted as e n ( x ) . Similarly, the function f R n ( x ) is the extension of o n to two dimensions and is a complex signal obtained by applying the Riezs transform to f n ( x ) . Therefore, when using o n ( x ) in Equations (7) and (8), only its magnitude must be used, i.e., A n and E are redefined as:
A n ( x ) = e n ( x ) 2 + o n ( x ) 2 ,
E ( x ) = n = 1 N e n ( x ) 2 + n = 1 N o n ( x ) 2 .
As for the log-Gabor filter, its two-dimensional shape corresponds to the rotation of the 1D filter around the origin in the frequency plane. In other words, it behaves the same way in any radial direction, and a variable change is performed, ω = | u | ; therefore, it can be written as:
G ( u ) = exp ( log ( | u | / ω 0 ) ) 2 2 ( log ( σ o ) ) 2 ,
where | u | corresponds to the radius or distance of the filter from the origin in the frequency plane and σ o is the parameter that guarantees the constant shape of the filter in the different scales.
Henceforth, for the sake of simplicity, when the term x appears, it refers to the space coordinates. Depending on the context, x can represent one or two dimensions indistinctly, which is possible, because as shown in this section, the functions A n ( x ) and G ( u ) have their codomain in R , with their introduction being valid within the equations that allow for calculating the PC for a single dimension.
As can be seen in Equations (30) and (31), A n ( x ) and E ( x ) only produce real values. Thus, all equations using the one-dimensional signals A n and E remain valid when extended to two dimensions. Thus, the phase congruency calculated by the monogenic filters M P C ( x ) can be expressed again, by the product of three functions, i.e., by the equation:
M P C ( x ) = W ( x ) P C Q ( x ) N C ( x ) .

3. General Mathematical Formulation of Phase Congruency

Equation (33) allows one to decompose the phase congruency calculation into three parts. In this way, it is easier to understand the different variations that were proposed to obtain the PC. Thus, the implementation of phase congruency using monogenic filters, proposed by [14], shown in Equation (34) can be seen as the introduction of a function P C Q ( x ) , within the general Equation (33), where a Heaviside step function is used as N C ( x ) and the factor W ( x ) remains unchanged, as shown in Equation (35). It is important to mention that although the authors do not explicitly mention the purpose of a in their paper, it is evident that this term is a sensitivity adjustment parameter. It is also worth noting that the PC obtained through monogenic filters, as presented in Equation (34), does not allow one to obtain a maximum value equal to 1 when there is full congruency, because, as defined, the noise threshold is always subtracted from the PC value.
M P C ( x ) = W 1 a cos E A n + ϵ T A n + ϵ ,
M P C ( x ) = W ( x ) P C Q ( x ) u ( P C Q ( x ) ) ,
where P C Q is given by:
P C Q ( x ) = 1 a cos E A n + ϵ T A n + ϵ
Likewise, Equation (37), used to calculate the phase congruency in the HSV color space [25], can be expressed by the general formulation shown in Equation (33), thus obtaining the three factors in Equation (38), where P C Q ( x ) is given, in this case, by Equation (39) and N C ( x ) is again a Heaviside step function.
C M P C M ( x ) = W ( x ) exp Q ( x ) T A + ϵ ,
C M P C M ( x ) = W ( x ) P C Q ( x ) u ( P C Q ( x ) ) ,
P C Q ( x ) = exp Q ( x ) T A + ϵ .
Q is given by:
Q ( x ) = 1 b 2 E C M S A + ϵ 1 .

4. Practical Considerations for the Use of the PC

The phase congruency calculation requires the adjustment of several parameters. Although Kovesi suggested some default values, these parameters can be tuned to obtain the maximum benefit from this technique according to the characteristics of the images to be processed. Thus, even though there are parameters that globally affect the phase congruency result, an advantage of representing it by the product of three independent factors, as proposed in this work, is that it is possible to identify the global parameters, which affect the whole phase congruency calculation, from the particular ones related to each factor. In this way, the tuning is facilitated, adjusting first the global parameters and then the particular ones related to each factor. In this way, it is possible to define a single strategy for tuning global parameters independently of the type of factors used.
Thus, to adjust the global parameters for detecting PC in a given type of images, the first step is to choose the minimum scale length, in pixels, λ m i n , which corresponds to the pixel dimension of the smallest details to be detected. Knowing λ m i n , the center frequency ω 0 of each filter is determined, using Equation (41).
ω 0 = 1 λ m i n m N n = 1 λ m i n m η 1 ,
where N represents the total number of scales and m is the scale factor between consecutive filters, which must be adjusted by the user considering that the maximum scale size is given by the maximum length of features to be taken into account, which in turn is limited by the specific size of the images under study.
λ m a x = λ m i n m N 1 .
The steps for phase congruency tuning can be summarized as follows:
  • Define the size of the smallest features to be detected to find the value of λ m i n given in pixels.
  • Define the scale factor m.
  • Define the largest desired scale size to determine how many are necessary to achieve the maximum scale. To this end, the limitation given by the image dimensions must be considered, according to Equation (43).
    N ln ( λ m a x / λ m i n ) ln ( m ) + 1 .
    The other variables to be adjusted depend on the type of MPC used, given in Equations (34) and (37).
  • Adjust σ o depending on the closeness between the edges to be detected, making it smaller as the edges are closer.

5. Results

This section presents the results attained by varying the phase congruency parameters, as suggested in the previous one. The original Kovesi code can be used to evaluate phase congruency in images [10], as well as an open source application, written by the authors in Java, as an Imagej plug-in [26], which includes further enhancements for noise estimation [13], different PC quantization functions [27] and the use of tile mirror in conjunction with Radix-2 FFT to obtain more accurate edges at the edges of images when at least one side of the image is not a power of two [28,29].
Figure 7, Figure 8 and Figure 9 show the results obtained by applying phase congruency on the sample images, shown in Figure 7a, Figure 8a and Figure 9a changing the quantization functions to highlight that the modification of the global parameters can be tuned for the same purpose, independent of the quantization function shape. For these examples, two quantification functions were used, the absolute value, since it was the one used in the seminal work proposed by Kovesi [10] and the exponential function, since it gave better results according to two previous works [25,27]. As can be seen, the results are similar, although, the edges in the images in the top row of Figure 7 are thicker, due to the linear approximation used when employing the absolute value function. By contrast, images in the lower row are better defined, allowing for a better edge localization.
Figure 7b,e shows the results obtained using the default global parameters suggested by Kovesi. As can be seen, fewercontrasted images are obtained in this case, since Kovesi adjusted the parameters in a general way to obtain adequate results on a wide variety of images. Thus, by changing the parameter values appropriately, it is possible to obtain better results in specific cases, for example, in near edge detection, as shown in Figure 7c,f where the scale factor was set to 1.5. Conversely, if the global parameters are not well tuned, not all edges are detected, regardless of the quantization function used, as seen in Figure 7d,g.
Figure 8 shows a detail of the results obtained with the PC, using two different quantification functions. The top row shows the results obtained with the absolute value function, and the bottom one shows those obtained with the exponential function. The parameters used were the same as those employed in Figure 7, where the effect of tuning the parameters can now be seen in detail. Edge detection is acceptable in the case of Figure 8b, although it is improved in Figure 8c by setting the scaling factor to 1.5 so that contiguous edge detection is better. Otherwise, Figure 8d illustrates an inappropriate setting that results in incorrect edge detection.
Setting the global parameters noticeably affects the edge detection and changing the quantization function has a small effect on the results. Although the change of function seems irrelevant, in order to better show its effect, different profiles for edge detection along the yellow line in Figure 9a are shown in Figure 9b. The solid and dashed lines are used to indicate whether the function is exponential or absolute value, respectively, while the color indicates the parameter setting, where red represents the values recommended by Kovesi m = 2.1 and λ m i n = 3 , green takes a scale factor of m = 1.5 and blue takes λ m i n = 8 . As can be seen, for each color, the dashed lines have in all cases the highest response when an edge is present, indicating that the quantization function tuning is important and its study can lead to improved edge detection techniques. Similarly, it can be seen that using the values recommended by Kovesi, in red, allows edges to be adequately detected. The highest values of PC, in green, are obtained by fitting the scale factor, while the poorest response, in blue, is obtained by the inappropriate tuning of the parameters, in this case by increasing λ m i n .

6. Conclusions

Phase congruency is a very powerful technique but still relatively little used due to the different variants and notations employed, which makes it difficult to understand. To overcome this limitation, a unified description of phase congruency in digital images was presented in this work. For this purpose, the basic concepts of the technique and a general mathematical formulation were presented, allowing one to obtain a global vision of the technique and some of its variants. In addition, the technique requires the tuning of a set of parameters, which are rarely modified, using those suggested in the seminal article, due to the difficulty to set them and the lack of understanding about them. The mathematical formulation allows for a better comprehension of the technique and the function of its parameters, facilitating their tuning. Thus, some practical considerations were presented for the adjustment of the calculation parameters to obtain better results according to the type of images processed.

Author Contributions

All the authors (M.G.F. and C.A.J.) have participate equally in all aspects of this paper: conceptualization, methodology, investigation, formal analysis, software, validation, visualization, writing—original draft preparation, and writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by project 19-488-INT Universidad de Ibagué.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The code used for the development of this work, written by the authors in Java as a plugin of the freely available imageJ software, is available at https://www.researchgate.net/publication/350772129_Phase_Congruency (accessed on 28 November 2021).

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
PCPhase Congruency
MPCMonogenic Phase Congruency

References

  1. Canny, J. A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. 1986, 679–698. [Google Scholar] [CrossRef]
  2. Kovesi, P. Image features from phase congruency. Videre J. Comput. Vis. Res. 1999, 1, 1–26. [Google Scholar]
  3. Morrone, M.C.; Ross, J.; Burr, D.C.; Owens, R. Mach bands are phase dependent. Nature 1986, 324, 250–253. [Google Scholar] [CrossRef]
  4. Morrone, M.C.; Burr, D. Feature detection in human vision: A phase-dependent energy model. Proc. R. Soc. Lond. B 1988, 235, 221–245. [Google Scholar] [PubMed]
  5. Kovesi, P. Invariant Measures of Image Features from Phase Information. Ph.D. Thesis, University of Western Australia, Crawley, Australia, 1996. [Google Scholar]
  6. Kovesi, P. Phase congruency: A low-level image invariant. Psychol. Res. 2000, 64, 136–148. [Google Scholar] [CrossRef] [PubMed]
  7. Kovesi, P. Phase congruency detects corners and edges. In Proceedings of the Digital Image Computing: Techniques and Applications, VIIth Biennial Australian Pattern Recognition Society Conference (DICTA 2003), Sydney, Australian, 10–12 December 2003; Volume 1, pp. 309–318. [Google Scholar]
  8. Felsberg, M.; Sommer, G. A new extension of linear signal processing for estimating local properties and detecting features. In Mustererkennung 2000; Springer: Berlin/Heidelberg, Germany, 2000; pp. 195–202. [Google Scholar]
  9. Moisan, L. Periodic plus smooth image decomposition. J. Math. Imaging Vis. 2011, 39, 161–179. [Google Scholar] [CrossRef] [Green Version]
  10. Kovesi, P. MATLAB and Octave Functions for Computer Vision and Image Processing. 2013. Available online: https://www.peterkovesi.com/matlabfns/index.html#phasecong (accessed on 28 November 2021).
  11. Morrone, M.C.; Owens, R.A. Feature detection from local energy. Pattern Recognit. Lett. 1987, 6, 303–313. [Google Scholar] [CrossRef]
  12. Venkatesh, S.; Owens, R. An energy feature detection scheme. In Proceedings of the ICIP’89: IEEE International Conference on Image Processing, Singapore, 5–8 September 1989. [Google Scholar]
  13. Jacanamejoy, C.; Meneses-Casas, N.; Forero, M.G. Image Feature Detection Based on Phase Congruency by Monogenic Filters with New Noise Estimation. In Iberian Conference on Pattern Recognition and Image Analysis; Springer: Cham, Switzerland, 2019; pp. 577–588. [Google Scholar]
  14. Lijuan, W.; Changsheng, Z.; Ziyu, L.; Bin, S.; Haiyong, T. Image feature detection based on phase congruency by Monogenic filters. In Proceedings of the 26th Chinese Control and Decision Conference (2014 CCDC), Changsha, China, 31 May–2 June 2014; pp. 2033–2038. [Google Scholar]
  15. Cinar, A.; Barhli, S.; Hollis, D.; Flansbjer, M.; Tomlinson, R.; Marrow, T.; Mostafavi, M. An autonomous surface discontinuity detection and quantification method by digital image correlation and phase congruency. Opt. Lasers Eng. 2017, 96, 94–106. [Google Scholar] [CrossRef]
  16. Fan, J.; Wu, Y.; Li, M.; Liang, W.; Cao, Y. SAR and Optical Image Registration Using Nonlinear Diffusion and Phase Congruency Structural Descriptor. IEEE Trans. Geosci. Remote Sens. 2018, 56, 5368–5379. [Google Scholar] [CrossRef]
  17. Mouats, T.; Aouf, N. Multimodal stereo correspondence based on phase congruency and edge histogram descriptor. In Proceedings of the 16th International Conference on Information Fusion, Istanbul, Turkey, 9–12 July 2013; pp. 1981–1987. [Google Scholar]
  18. Tian, Y. Autofocus using image phase congruency. Opt. Express 2011, 19, 261–270. [Google Scholar] [CrossRef] [PubMed]
  19. Verikas, A.; Gelzinis, A.; Bacauskiene, M.; Olenina, I.; Olenin, S.; Vaiciukynas, E. Phase congruency-based detection of circular objects applied to analysis of phytoplankton images. Pattern Recognit. 2012, 45, 1659–1670. [Google Scholar] [CrossRef]
  20. Zhang, L.; Zhang, L.; Zhang, D.; Guo, Z. Phase congruency induced local features for finger-knuckle-print recognition. Pattern Recognit. 2012, 45, 2522–2531. [Google Scholar] [CrossRef] [Green Version]
  21. Zhu, Z.; Zheng, M.; Qi, G.; Wang, D.; Xiang, Y. A Phase Congruency and Local Laplacian Energy based Multi-modality Medical Image Fusion Method in NSCT Domain. IEEE Access 2019, 7, 20811–20824. [Google Scholar] [CrossRef]
  22. Siddiqui, M. Some problems connected with Rayleigh distributions. J. Res. Natl. Bur. Stand. 1962, 66, 167–174. [Google Scholar] [CrossRef]
  23. Jacanamejoy, C.A.; Forero, M.G. A Note on the Phase Congruence Method in Image Analysis. In Iberoamerican Congress on Pattern Recognition; Springer: Cham, Switzerland, 2018; pp. 384–391. [Google Scholar]
  24. Felsberg, M.; Sommer, G. The monogenic signal. IEEE Trans. Signal Process. 2001, 49, 3136–3144. [Google Scholar] [CrossRef] [Green Version]
  25. Shi, M.; Zhao, X.; Qiao, D.; Xu, B.; Li, C. Conformal monogenic phase congruency model-based edge detection in color images. Multimed. Tools Appl. 2019, 78, 10701–10716. [Google Scholar] [CrossRef]
  26. Jacanamejoy, C.A.; Forero, M.G. Phase Congruency. 2021. Available online: https://www.researchgate.net/publication/350772129_Phase_Congruency (accessed on 28 November 2021).
  27. Forero, M.G.; Jacanamejoy, C.A.; Rivera-Nieto, S. Study of phase congruency quantization function properties for image edge detection. In Applications of Digital Image Processing XLIV; Tescher, A.G., Ebrahimi, T., Eds.; International Society for Optics and Photonics (SPIE): Bellingham, WA, USA, 2021; Volume 11842, pp. 472–490. [Google Scholar]
  28. Jacanamejoy, C.A.; Forero, M.G. New Improvement in Obtaining Monogenic Phase Congruency. In Iberoamerican Congress on Pattern Recognition; Springer: Cham, Switzerland, 2021. [Google Scholar]
  29. Jacanamejoy, C.A.; Forero, M.G. Phase congruency implementation in ImageJ using Radix-2 FFT. In Applications of Digital Image Processing XLIV; SPIE: Bellingham, WA, USA, 2021; Volume 11842, pp. 449–455. [Google Scholar]
Figure 1. Results obtained using phase congruency and the Canny edge detector on a synthetic image. It can be seen how the phase congruency allows one to obtain precise edges in ridges and less abrupt changes of the grey level. (a) Original image. (b) Image obtained with Canny’s method. (c) Image obtained with PC. (d) Synthetic image with Gaussian noise of σ = 10 . (e) Image obtained with Canny’s method. (f) Image obtained with PC.
Figure 1. Results obtained using phase congruency and the Canny edge detector on a synthetic image. It can be seen how the phase congruency allows one to obtain precise edges in ridges and less abrupt changes of the grey level. (a) Original image. (b) Image obtained with Canny’s method. (c) Image obtained with PC. (d) Synthetic image with Gaussian noise of σ = 10 . (e) Image obtained with Canny’s method. (f) Image obtained with PC.
Mathematics 09 03080 g001
Figure 2. Fourier components A n of a square signal approximation.
Figure 2. Fourier components A n of a square signal approximation.
Mathematics 09 03080 g002
Figure 3. Graphical representation of the phase congruency of a signal, its local energy and the amplitude sum of the Fourier components. (a) Polar diagram. (b) Triangular phase congruency inequality, where n A n ( x ) is always greater than or equal to the energy E ( x ) where the concept of average phase deviation ϕ ( x ) is introduced [13].
Figure 3. Graphical representation of the phase congruency of a signal, its local energy and the amplitude sum of the Fourier components. (a) Polar diagram. (b) Triangular phase congruency inequality, where n A n ( x ) is always greater than or equal to the energy E ( x ) where the concept of average phase deviation ϕ ( x ) is introduced [13].
Mathematics 09 03080 g003
Figure 4. Frequency spectra of the filters used to obtain the components A n ( x ) [5].
Figure 4. Frequency spectra of the filters used to obtain the components A n ( x ) [5].
Mathematics 09 03080 g004
Figure 5. Graphical representation of the use of wavelet and monogenic filter banks to obtain the frequency components for the calculation of phase congruency. (a) Wavelet filters, in which six filters are used to calculate each of the four scales. The spectrum of one of the directional filters is shown in dark color. (b) Monogenic filters, where only one filter is used for each of the four scales.
Figure 5. Graphical representation of the use of wavelet and monogenic filter banks to obtain the frequency components for the calculation of phase congruency. (a) Wavelet filters, in which six filters are used to calculate each of the four scales. The spectrum of one of the directional filters is shown in dark color. (b) Monogenic filters, where only one filter is used for each of the four scales.
Mathematics 09 03080 g005
Figure 6. Phase congruency quantification functions. In blue appears the quantization function defined by Equation (23) and in black the one used in practice by Kovesi in his code [10], defined by Equation (25).
Figure 6. Phase congruency quantification functions. In blue appears the quantization function defined by Equation (23) and in black the one used in practice by Kovesi in his code [10], defined by Equation (25).
Mathematics 09 03080 g006
Figure 7. Phase congruency obtained with two quantization functions on the baboon image. (a) Baboon image. The first, shown in (bd), is the absolute value, proposed by Kovesi. The second, shown in (eg), is the exponential function. The results of the global parameters suggested by default by Kovesi are shown in (b,e). The results achieved by setting the scale factor to 1.5 in (c,f) and by making λ m i n = 8 in (d,g).
Figure 7. Phase congruency obtained with two quantization functions on the baboon image. (a) Baboon image. The first, shown in (bd), is the absolute value, proposed by Kovesi. The second, shown in (eg), is the exponential function. The results of the global parameters suggested by default by Kovesi are shown in (b,e). The results achieved by setting the scale factor to 1.5 in (c,f) and by making λ m i n = 8 in (d,g).
Mathematics 09 03080 g007
Figure 8. Detail of the edge detection in the yellow box of the ship image. (a) Ship image with yellow box. Columns (bd) show the PC results. The absolute value proposed by Kovesi is used as the quantization function in the first row and the exponential function in the second one. In Column (b), the default parameters are used. Column (c) shows the results obtained using the scaling factor m = 1.5 . Column (d) presents the results obtained by making λ m i n = 8 .
Figure 8. Detail of the edge detection in the yellow box of the ship image. (a) Ship image with yellow box. Columns (bd) show the PC results. The absolute value proposed by Kovesi is used as the quantization function in the first row and the exponential function in the second one. In Column (b), the default parameters are used. Column (c) shows the results obtained using the scaling factor m = 1.5 . Column (d) presents the results obtained by making λ m i n = 8 .
Mathematics 09 03080 g008
Figure 9. Edge detection profile in the cameraman’s image. (a) Cameraman’s image with yellow line indicating the profile plotted in (b). (b) Horizontal profile of the different results obtained with the phase congruency of the images in the second and third rows. The solid and dashed lines indicate the quantization function used, exponential or absolute value respectively. Red shows the response when the default parameters are used, shown in (c,f); green when the scale factor is set to m = 1.5 , depicted in (d,g); and blue when λ m i n = 8 , illustrated in (e,h). The second row shows the results using the absolute value function, and the third row shows the results obtained with the exponential.
Figure 9. Edge detection profile in the cameraman’s image. (a) Cameraman’s image with yellow line indicating the profile plotted in (b). (b) Horizontal profile of the different results obtained with the phase congruency of the images in the second and third rows. The solid and dashed lines indicate the quantization function used, exponential or absolute value respectively. Red shows the response when the default parameters are used, shown in (c,f); green when the scale factor is set to m = 1.5 , depicted in (d,g); and blue when λ m i n = 8 , illustrated in (e,h). The second row shows the results using the absolute value function, and the third row shows the results obtained with the exponential.
Mathematics 09 03080 g009
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Forero, M.G.; Jacanamejoy, C.A. Unified Mathematical Formulation of Monogenic Phase Congruency. Mathematics 2021, 9, 3080. https://doi.org/10.3390/math9233080

AMA Style

Forero MG, Jacanamejoy CA. Unified Mathematical Formulation of Monogenic Phase Congruency. Mathematics. 2021; 9(23):3080. https://doi.org/10.3390/math9233080

Chicago/Turabian Style

Forero, Manuel G., and Carlos A. Jacanamejoy. 2021. "Unified Mathematical Formulation of Monogenic Phase Congruency" Mathematics 9, no. 23: 3080. https://doi.org/10.3390/math9233080

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