3.5 The Final Algorithm
So far, we focused on the boundary extrapolation dur-
ing filtering, but the aim is to correct illumination in-
homogeneities in texture images. In the overall algo-
rithm (see Alg. 1), extrapolation of boundary pixels is
used in steps (4) and (13).
Algorithm 1: Illumination correction algorithm.
input : Intensity image f (x, y), pyramid depth l
output: Corrected image f
0
(x, y)
1 G
0
← f ;
2 for i ← 0 to l do
3 Extend G
i
;
4 Extrapolate image G
i
; store results in G
i
;
5 Filter image, i.e. G
i
← h ∗ G
i
;
6 Crop image G
i
to original size;
7 Downsample, i.e. G
i+1
← (↓ 2)(G
i
);
8 end
9 G
0
l
← G
l
;
10 for i ← l down to 1 do
11 Upsample, i.e. G
0
i−1
← (↑ 2)G
0
i
;
12 Filter image, i.e. G
0
i−1
← h ∗ G
0
i−1
;
13 Extrapolate boundary; store results in G
0
i−1
;
14 Scale image, i.e. G
i−1
← 4 · G
i−1
;
15 end
16 Calculate mean intensity, i.e. f =
∑
x
∑
y
f (x,y)
nm
;
17 f
0
← f − G
0
0
+ f ;
In the downsampling loop, the image is first ex-
tended by two rows and columns in each direction
and then the intensity values of these pixels are deter-
mined by extrapolation. After filtering, the image is
cropped to the original size. In the upsampling loop,
the image is first filtered and then the intensity values
of the first and last two rows and columns are recalcu-
lated from the inner image by extrapolation. Finally,
the low-frequency image is subtracted from the orig-
inal image and the mean intensity of the input image
is added to obtain the final image with the proper in-
tensity level.
4 EXPERIMENTS
The performance of our method is demonstrated in a
series of experiments. We used gray-valued images
with intensity values ranging from 0 to 255. All op-
erations where done in double-precision arithmetic to
avoid discretisation artifacts.
We started with artificial images that contained no
texture but only smooth intensity gradients as they oc-
cur with natural vignetting (see Fig. 1). Perfect illumi-
nation correction would result in a completely homo-
geneous image. Obviously, the choice of the bound-
ary condition does not affect the centre of the image,
which shows a slight gradient even after correction.
At the image boundary the replicate condition is out-
performed by linear and polynomial extrapolation, the
latter yielding an image intensity range of less than 1
at the boundary. Thus, the correction is perfect at the
boundary for typical 8-bit images.
In a second experiment, we measured how bound-
ary artifacts affect the histogram of the intensity val-
ues. Therefore, we calculated the difference be-
tween the histograms of the image boundary (64 pix-
els wide) and the image centre (see Fig. 2). Here,
the replicate condition causes the corrected image to
be too dark at the boundary, i.e. the histogram of the
boundary pixels is shifted towards zero and the his-
togram difference has a maximum for small values.
With linear extrapolation, this effect is dramatically
reduced. Polynomial extrapolation gives only small
additional improvement.
In Fig. 3 some typical textures are depicted as they
occur in virtual material design. The images were ac-
quired with an industrial colour camera (1392 × 1040
pixels) and show clearly visible intensity falloffs to-
wards the image corners. We applied the above de-
scribed method for each colour channel individually
and compared it to the repetitive boundary condition.
After correction the intensity gradients are no longer
visible, however, other inhomogeneities and artifacts
are still obvious. These range from clearly visible
repetitive structure (see rows 2 and 3), to very subtle
blurring towards the image corners due to lens defi-
ciencies.
5 CONCLUSIONS
We presented a novel method for removing illumina-
tion inhomogeneities from texture images based on
the Gaussian pyramid. With standard filtering using
the replicate or circular boundary condition, the re-
sulting images will show artifacts at the image bor-
ders — mostly visible when stitching images together.
These artifacts can be avoided by different types of
boundary extrapolation. The framework is not lim-
ited to linear or polynomial extrapolation, however, it
seems unnecessary to use more complex functions.
The Gaussian pyramid provides a fast way to
model arbitrary illumination gradients. All calcula-
tions can be done in real-time — the proposed bound-
ary extrapolation techniques do not cause a significant
performance drop due to their simplicity and the low
IMAGAPP 2011 - International Conference on Imaging Theory and Applications
84