A Fully Automatic Stitching of 2D Medical Data Sets
ýapek M, Wegenkittl R, Felkel P, {capek|wegenkittl|felkel}@vrvis.at
VRVis Research Center, Donau-City-Strasse 1, A-1220 Vienna, Austria
Abstract: Image stitching is a prerequisite for obtaining a high resolution image if scanned
parts of an image are too large to fit on a scanner – in our case on a digital radiography
system. The proposed stitching is based on combination of two approaches used in image
registration: on matching sets of external markers and on similarity evaluation of overlaps of
neighboring images.
1 Introduction
In radiography a special imaging plate (cassette) is positioned after an examined part of a
human body and illuminated from the direction of the body by X-rays. In order to capture a
human-body part larger than one cassette, e.g. the whole leg, an overlapped set of the
cassettes has to be used. This technique produces a set of overlapped images. By using this
set, image stitching generates a resulting high resolution image.
Image stitching can be considered as a task belonging to image registration, since it is
accomplished by registration of overlapped parts of the images. A number of medical image
registration approaches has been developed until now [1] and two of them were applied in this
work. The first one is based on the matching of artificial markers superimposed on images.
However, this matching requires finding proper correspondence between sets of the markers.
Therefore, the second approach that hinges on evaluation of similarity of image overlaps for
different correspondences of markers was put in use in order to find this correspondence.
2 Methods
On the cassette exterior, there is a grid of perpendicular lines with a-priori unknown
predefined spacing (equal in both directions). The intersections of these lines at the borders of
images represent the artificial external markers used for image stitching. The first, and for the
automatic stitching the vital subtask, is finding a precise position of the grid. Unfortunately, the
lines of the grid are not always exactly parallel to the borders of the images, because a small
distortion given by a mutual position of both the X-ray source and the cassette can be
introduced. Moreover, the lines are masked by noise or can be merged with the background.
Therefore, and it was also evaluated by our experiments, nor classical [2] nor modern [3]
line/cross detectors work efficiently for detection of the whole lines.
The used segmentation method is based on parallel projections through the image. One
projection is given by the average value of gray-level values of pixels along a “virtual ray”
which starts from a pixel at the border of the image. A set of projections is computed for every
border pixel of two sides (top & left) of the image for a small range of inclination angles. In
case of matching the proper position and inclination angle of both the virtual ray and a grid
line, the projection gives – in case of the white background – a negative peak. In order to
highlight and normalize the values of the peaks, the projections are recomputed by using a 1D
convolution mask, see Figure 1.
After figuring out the convolved values, statistical analysis follows in order to find the
distances among lines. The distances having been found, the algorithm computes the
positions of all possible undetected lines (in case they are merged with the background, which
happens quite often, see Figure 1B – green lines). In the end, the procedure returns a single
value which describes the quality of the grid found for a given angle.
A) B) C)
Fig 1: A) an original image with a grid, B) the image with lines found (red) and computed
(green), C) above: the corresponding vertical projections with the negative peaks, below: 1D-
convolved vertical projections.
Therefore, the segmentation procedure can be seen as a function which is suitable for an
optimization. In the first step, the function is evaluated in the predefined range of angles by
using a specified step. The found solution can be further refined by Brent’s optimization
method in one dimension [4], which provides precise segmentation of the lines allowing us to
obtain precise positions of the markers.
The markers are given by intersections of the lines detected in the previous step. It is known
that the cassettes overlap in the way that their grids match, but it is not known whether the
images overlap with one or with two lines (we consider here the lines parallel with the long side
of the overlap). Hence, we test the quality of both the one-line-overlap and the two-lines-
overlap.
The least squares evaluation of the geometrical transformation between two sets of the
markers is found by using a standard point-matching technique [5] employing SVD (singular
value decomposition) [4]. The quality of the overlap, i.e. similarity of images in the area of their
overlap, is evaluated by NCC (normalized correlation coefficient) [2], see Formula (1). The
higher the NCC, the more suitable overlap for the given pair of sets of markers. Thus NCC
helps to find the proper correspondence between two sets of markers.
∑ (u(x ) − u* )(v(T (x )) − v* )
NCC(T ) = x∈u , Formula (1)
∑ (u(x ) − u ) ∑ (v(T (x )) − v
* 2
)
* 2
x∈u x∈u
where x and T(x), respective, stands for original (i.e. from the first-image-overlap) and
geometrically transformed (i.e. from the second-image-overlap) pixel coordinates, u(x) and
v(T(x)) are gray values of the corresponding pixels and u*, v* are average values of gray levels
of pixels in the overlaps,
∑ u (x ) ,
1
u* = Formula (2)
N x∈u
∑ v (x ) .
1
v* = Formula (3)
N x∈v
NCC describes linear dependence between two signals/images and has values in the range of
− 1.0,1.0 . The closer the value to 1.0, the better similarity of the overlaps.
Using the point-matching together with the similarity measure (NCC) has another advantage
for fully automatic image stitching. By using the combination it is possible to load images in an
arbitrary order and the algorithm is capable to find the correct order of images by finding the
corresponding overlaps of images with the highest similarity. Therefore, the user interaction is
reduced only to loading a set of images in an arbitrary order.
After finding the proper overlap for each pair of images and their correct order, the resulting
image is computed by applying the fast image resampling, as proposed in [6].
3 Results
The proposed stitching method requires about 20-30 sec/image for segmentation of grid
lines (it depends on image resolution) and about 1-3 sec for analysis of image overlaps
(Pentium III 600 MHz). It works with a sub-pixel accuracy, because the grid lines are found
with sub-pixel accuracy as well.
The method was tested on ten sets of images and it gave precise and correct results in all
cases, except one, for which the automatic image ordering had to be switched off and the
images had to be loaded in the proper order.
Figure 2 and 3 shows examples of the stitching of three images.
Fig 2: Upper: a set of images before stitching, right: the resulting image after stitching (with the
grid highlighted for better visibility).
Fig 3: Upper: another set of images before stitching, right: the resulting image after stitching
(with the grid highlighted for better visibility).
4 Discussion
The most time-consuming part of the stitching procedure is the segmentation of the grid
lines. The calculation can be speeded-up by using a low resolution strategy, i.e. not all pixels
are used for calculation of the projections, but, for example, every second or third pixel, etc.,
depending on the image resolution. However, this technique introduces local minima of the
optimized function and the Brent’s method inclines to be trapped in local minima, thus, giving
less precise results.
5 Conclusions
A fully automatic method for the stitching of digital radiographic images has been developed.
The method is fast, precise and, in most cases, do not require any user interaction except
loading images.
References
[1] Maintz, JBA, Viergever, MA: A Survey of Medical Image Registration. Medical Image
Analysis, 1998; 2:1-36.
[2] Pratt, WK: Digital Image Processing. New York, John Wiley & Sons Inc., 1992; 595 pages.
[3] Smith, SM: SUSAN – A New Approach to Low Level Image Processing. Int. Journal of
Computer Vision; 1997, 23(1):45-78.
[4] Press, WH, et al.: Numerical Recipes in C, The Art of Scientific Computing. 2nd ed.,
Cambridge University Press, 1992, 994 pages.
[5] Umeyama, S: Least-Squares Estimation of Transformation Parameters Between Two Point
Patterns. IEEE Trans. PAMI, 1991; 13(4):376-380.
[6] ýDSHN00UR]/:HJHQNLWWO55REXVWDQG)DVW0HGLFDO5HJLVWUDWLRQRI'-Multi-Modality
Data Sets. VRVis Center Technical Report TR-VRVis-2001-008, VRVis Center, Vienna,
Austria, 2001; www.vrvis.at.