Optics and Lasers in Engineering
Adaptive
15 (1991) 241-251
Filter for Enhancement
of Fringe Patterns
Huang Zhi & Rolf B. Johansson
Instrumentation
Laboratory, (Received
Royal Institute of Technology, Sweden
27 February
1991; accepted
23 March
S-100 44 Stockholm, 1991)
ABSTRACT This paper presents an adaptive filter used for enhancement of fringe patterns. The basic idea of the filter is to restore an ideal cosine distribution from a noisy cosine signal input fringe pattern. The direction of the fringe is first estimated, to allow filtering in one dimension, perpendicular to the ridge-valley structure. Then, spatial frequency and phase of the fringe related to the pixel are detected using local extremum points. Using this information, a new value is assigned to each processed pixel, by matching an ideal, displaced cosine function to the original gray values of the fringe image. Thus the filter not only reduces noise but also enhances the fringe signal to use the full dynamic range of the image detector. The procedure is easy to implement, convenient also in real-time applications, and operates fully automatically on general interferograms. The procedure only needs one input parameter, which is related to the minimum spatial frequency of the fringes. Tests on practical fringe patterns show successful results, even on some very noisy images.
INTRODUCTION In many areas of optical measurement and inspection, experimental results are presented as fringes; for example, traditional interferometry, and photoholographic interferometry, moire, speckle interferometry elasticity. The interferograms need to be analysed so that the results can be presented in the required numerical or graphical form. However, the accurate analysis of such patterns to obtain quantative data can be very tedious and time consuming. 241
Opticsand Lasers in Engineering 0143-8166/91/$03.50 0 1991 Elsevier Science Publishers Ltd, England.
Printed
in Northern
Ireland
Huung Zhi, Rolf B. Johansson
242
Nowadays, computer image processing and pattern recognition has been widely used for automatically analysing interferograms. Many methods and algorithms have been developed, especially for processing fringe patterns. ’ The most obvious method is to extract the skeletons of the fringes. The skeletons can be extracted by finding the local extremum points,’ or thinning the binary fringes with a threshold,3 and so on. Skeleton extraction is quite general method, requiring little or no prior knowledge of the pattern characteristics. The result of this processing, i.e. the fringe centerline, can be conveniently used for fringe interpretation. Other methods include fast-Fourier transform for detecting frequency and using prior and phase of fringes,” fan filter for noise reduction,i of particular patterns to simplify the processing information procedure .” The common problem for the methods mentioned above is how to handle noise and enhance the fringe signal in input patterns. Noise may be generated in the optical and electronic system, and it can be reduced by ordinary filters, such as low-pass filters, median-pass filters or frequency-passband filters. These filters, however, can distort fringe signals. To obtain good interpretation of a digital fringe pattern, more suitable filters are needed. These filters should satisfy the requirements of both noise reduction and fringe-signal enhancement. This paper presents an adaptive filter with such features. The basic idea of the filter is to restore an ideal cosine distribution from a noisy The direction of the fringe is first cosine signal input fringe pattern. estimated, to allow filtering in one dimension-perpendicularly to the ridge-valley structure. Then, spatial frequency and phase parameters of the fringe related to the pixel are detected using local extremum points. Using this information, a new value is assigned to each processed pixel, by matching an ideal, displaced cosine function to the original gray values of the fringe image. Thus, the filter not only reduces noise but also enhances the fringe signal to use the full dynamic range of the image detector. Tests on practical fringe patterns show successful results also on very noisy images. Section 2 describes the basic principle of the filter; details of the filter results are presented in are given in section 3; early experimental section 4; and the characteristics of the filter are briefly discussed in section 5. BASIC
PRINCIPLE
OF THE
FILTER
The filter is based on the principle that the gray value of a fringe pattern is a two-dimensional cosine function of a position vector, which
243
Adaptive jilter for enhancement of fringe patterns
may be written as (I) go(r) = WW(r) + a(r) cos’ M(r)l~ + N(r) where r is the position vector of the processed pixel (x, y); B(r) is the background gray value distribution that depends on the optical system and experimental set-up; u(r) is an amplifying factor; and N(r) is the additive noise. The fringe pattern extends over a domain D(r) defined bY inside the fringe area (2) Nr)l(:, outside the fringe area qb(r) is the
information
phase factor, including the of the fringe. It may be written
direction
and
4(r) = 2nfr
frequency (3)
where f is the spatial frequency vector of the fringe and fr is the inner product of the vectors. Knowing the direction of the fringe, eqn (3) can be rewritten as G(r) = 2~rif
i
is an integer
(4)
where i is the length coordinate of the pixel and f is a frequency scalar. Figure 1 shows the definition of the parameters of eqn (4). Assuming we have an ideal cosine distribution, i.e. let N(r) be equal to zero, and a(r) and B(r) are constant in the whole fringe area, eqn (1) can be simplified as g,(r) = W)@
+ a cos* b#WlI
(5)
The purpose of the filter is to obtain the gray value function g, based on gCl, the input fringe image. Since we know that the maximum of co? (r) is 1 and the minimum is zero, the factors B and a can be easily estimated. It is more difficult to estimate the phase factor Q(r), i.e. fringe direction parameters f and i in eqn (4). f= 1116
0
05rC
Fig. 1.
lT.
Parameters of eqn (4)
1.5n
244
Huang Zhi, Rolf B. Johansson
The filtering procedure is divided into three steps: (1) detection of fringe direction; (2) estimation of parameters f and i; (3) calculation of g, or setting a new value to the processed pixel according to eqns (5) and (4).
WORKING 1 Determination
STEPS
OF THE
FILTER
of the fringe direction
A sub-picture inside a local window around the processed pixel is considered. According to the eqn (l), the gray values of the pixels on the lines parallel to the fringe are similar or the same. The gray values of the pixels on the lines perpendicular to the fringe is a displaced cosine function. In other words, the deflection of gray values for different directions is different, and this difference is used for fringe direction calculation. We use the variance S,, to represent this deflection as n-1,2,3
,...,
K
(6)
where M is the size of the local window, II is the nth direction, K is the direction resolution, and g,,(n, m) is the gray value of the mth pixel on the nth direction line; g;,,,(n), the average of gray values on the nth direction line, is given by g,,,(n)
=;
$ g,l(nt m) ,I, I
It is obvious that S reaches its maximum value when the processed line is perpendicular to the fringe, and its minimum value when the processed line is parallel to the fringe. The value of R is dependent on the resolution required. Figure 2 shows the situation of direction lines when N = 8, and the window size is 7 x 7. A suitable window size is important for calculating direction. Accuracy of directional estimation may be reduced if the window size is too large. The noise in the window will influence the direction calculation if the window size is too small. The window size is decided according to the spatial frequency of fringes in the local area of the processed pixel. The spatial frequency is roughly estimated, based on local extremum points. The local extremum points, which are defined as those pixels with local maximum or minimum gray values in their local area, are extracted using a backlash smoothing and a one-
Adaptive jilter for enhancement of fringe patterns
n=l
n=2
n=5
n=6
Fig. 2.
Direction
n=4
n=3
n=8
n=7
lines; window
245
size is 7
X
7.
dimensional operator originally developed by Mitchell.’ The modified version of this operator described in the Appendix is used in the filter. In the algorithm, a larger window is chosen for this rough estimation of spatial frequency. This window size should be equal to or larger than the maximum width of the fringes in the whole picture. Since variance range of fringe directions is from 0 to 360”, the total extremum points along both horizontal and vertical directions are detected and accumulated. Let the total number be P; then the window size M, for calculating the fringe direction, is ME----*
P
2M; ’
MOB maximum width of the fringe in whole picture
where M,,is the window size for rough estimation frequency. 2 Determination
of fringe spatial
of the phase factors
The phase factors, i.e. f and i in eqn (4), are estimated in two stages; average calculation and factor estimation. The purpose of the average is to reduce the noise influence for f and k calculation. As shown in Fig. 3, the average is made using pixels on each line, which is perpendicular to the line with S,, in the local window (MM) separately. The pixels involved in the average are different for different lines. The nearer the line is to the processed pixel, the more pixels are involved. As shown in Fig. 3(a), line 1 includes four pixels and line 4 includes seven pixels. After averaging, we obtain a one-dimensional signal with size M, as shown in Fig. 3(b). This displaced cosine signal is a one-dimensional signal and is used for calculation off and i.
244
Huang Zhi, Rolf B. Johansson
gp1-’ 4
Fig. 3.
Average
: : : : : : ...;. : .: _..1.... :.;
m
(4
(b)
,,I
:
,,
:
calculation:
iJ :
7
(a) pixels to be averaged
and (b) signals after average.
In this calculation, the local extremum detection method described in working step 1 (the determination of fringe direction) is used. Let the total number of the extremum points be P,, then the frequency f is
and i is the distance from the processed point.
pixel to the nearest extremum
3 New value setting A new value for the processed pixel is calculated according to eqns (4) and (5). Several things should be indicated. The value of factor D(r) is assigned according to eqn (2). Since the background value is a constant for the whole filtered picture, for convenience the factor B(r) is set to zero. The amplifying factor a(r) is chosen to make the maximum of eqn (5) equal to the maximum of the new pictures and the minimum of eqn (5) equal to the minimum of the new picture. The new value is calculated according to the following equations. If the nearest extremum point is a minimum point (to the processed pixel)
g,,,(r) = D(f){ If the nearest extremum pixel)
Vmin
44 cos2P@(r>i(r>l>
+
(7)
point is a maximum point (to the processed
g,,,(r) = D(r) { I%+, - u(r) cos2 [2xf(r)i(r)]}
(8)
where a(r) =fV&, Vmaxand Vmin are the maximum picture, respectively.
- V,,,)
and minimum
values of the filtered
Adaptive filter for enhancement of fringe patterns
4 Procedure
of the filter
The detail procedure
(a) (b) (c) (d) (e) (f) (g)
241
of the filter is shown as follows.
Set value of MO. Calculate the local window size M. Detect the fringe direction II. Average the gray values (working step 2). Find the parameters f and i. Set new value to the processed pixel. Repeat from step b for the next pixel.
(4
(b)
(4
Fig. 4. Experimental results of a normal interferogram. (a) Original picture. value profile of the white line in Fig. 4(a) (c). Filtered picture of Fig. 4(a). value profile of the black line in Fig. 4(c).
(b) Gray (d) Gray
24X
Huang Zhi, Rolf B. Johansson
EXPERIMENTAL
RESULTS
The methods described above were implemented on the SYDAT image-processing system running on a VAX/VMS computer. Different interferograms were successfully tested. Fig. 4(a) is the orginal picture. Fig. 4(c) is the filtered fringe pattern. Figs 4(b) and (d) show the gray value profiles along a horizontal line indicated in Figs 4(a) and (c), respectively. Figure 5(a) shows a holographic interferogram of a human leg stimulated by a mechanical vibrator. Fig. 5(c) is the filtered version of this holo-interferogram. Figs .5(b) and (d) show gray value profiles along a line indicated in Figs 5(a) and (c), respectively. The image size is 256 x 256, with S-bit gray-level resolution. Figures 4 and 5 show that, after filtering, the noise of the original picture has been
(4 Fig. 5. Experimental results of a holo-interferogram. (a) Original picture. (b) Gray value profile of the white line in Fig. 5(a). (c) Filtered picture of Fig. S(a). (d) Gray value profile of the black line in Fig. S(c).
249
Adaptive jilter for enhancement of fringe patterns
greatly reduced and the fringe signal is considerably expected results are obtained.
enhanced.
The
DISCUSSION The basic idea of the filter is to restore an ideal cosine distribution from a noisy two-dimensional cosine signal input fringe pattern. The direction of the fringe is first estimated using statistical features of gray values in a local area around the processed pixel, to allow filtering in one dimension-perpendicularly to the ridge-valley structure. Then, spatial frequency and phase parameters of the fringe related to the pixel are detected using local extremum points. Using this information, a new value is assigned to each processed pixel, by matching an ideal, displaced cosine function to the original gray values of the fringe image. Thus the filter not only reduces noise but also enhances the fringe signal to use the full dynamic range of the image. Tests on practical fringe patterns show successful results on some very noisy images. The filter procedure is easy to implement, convenient also in real-time applications, and operates fully automatically on general interferograms. The procedure only needs one input parameter-the window size. This parameter is related to the minimum spatial frequency of the fringes. The filter can also be used for enhancement of other ridge-valley structure pictures.
REFERENCES fringe pattern analysis: a review. Optics and Lasers 1. Reid, G. T., Automatic in Engng, 7 (1986), 37-68. fringe analysis using digital image processing 2. Yatagai, T., Automatic techniques. Opt. Engng, 21 (1982), 432-5. 3. Muller, R. K. & Saackel, L. R., Complete automatic analysis of photoelastic fringe. Exp. Mech., 19 (1979), 345. based on a visual model, Opt. Engng., 26 4. Peli, E., Adaptive enhancement (1987) 65.540. analysis using a 2-D Fourier transform. Appl. 5. Donald, J. B. Fringe-pattern Optics, 25 (1986), 1653-60. D. A. & Madsen, V. P., Computer analysis of holographic 6. Tichenor, interferograms for nondestructive testing. Proc. SPIE, 155(1978), 222-7. 7. Mitchell, R. 0. et al., Image segmentation using a local extrema texture measure. Pattern Recognition, 10,1978, 205-10. recognition in an experimental reading 8. Mason, S. J. et al., Character machine for the blind. In Recognizing Patterns. MIT press, 1968, pp. 156-67.
Huang Zhi, Rolf B. Johansson
250 9.
Zhi, H., Three-dimensional Notes in Computer Science,
APPENDIX:
DETECTION
measurement by strip line pattern. Lecture Vol. 301, Springer-Verlag, 1988, pp. 478-86.
OF LOCAL
EXTREMUM
POINTS
Local extremum points include the points that have maximum and minimum gray values in their local area. Smoothing processing is needed to delete small amplitude reversal before extremum point extraction because of the noise in the input picture. In our program, the pictures were first filtered by backlash smoothing and then a onedimensional operator was applied to detect local extrema. Backlash smoothing is the digital equivalent of a familiar mechanical process that was originally described as a pre-processing method for character and was used later for extremum detection of texture recognition” image’ and line pattern analysis.” It can give good smoothing even if the picture has a nonuniform background. The smoothing is done in a specific direction. Let ji be the gray level of the ith point along the scan line and let F; be the ‘smoothed’ value. Let T be the value of a pre-assigned threshold parameter that controls the smoothing size. Let us start with fi =fi and process according to the following rule: If I;I F,,, and c > F,_, or if F < F,,, and r;l< F,_ ,.
6. Fig. Al.
Extremum
extraction
with backlash
smoothing.
Adaptive filter for enhancement of fringe patterns
Assign ith pixel as an extremum The threshold
251
point.
T is decided by following equation:
T = f (Max - Gmin) where G,,, and Gmin are the maximum and minimum one-dimensional array obtained in section 3.2.
values of the