Professional Documents
Culture Documents
I. I NTRODUCTION
The restoration of old films is a subject of primary interest
due to the great quantities of old film material present in film
archives. Unfortunately, manual digital restoration is extremely
time-consuming and labour intensive. For instance, the recent
restoration of George Meliess Voyage dans la Lune (1902)1
took one year (for fifteen minutes of film). It is clear, therefore, that automatic or semi-automatic tools designed for the
detection and restoration of defects are highly desirable.
Some of the most common defects in films include dust/dirt,
blotches, flicker and line scratches. Here, we consider the last
defect, the line scratch, usually caused by an abrasion to the
physical film. A good explanation of the physical origins of
line scratches may be found at [1]. These line scratches appear
as thin bright or dark lines which are roughly straight and
vertical. These defects also present the singular characteristic
of temporal persistence, meaning that they remain in the same
or a similar spatial position for several frames. Consequently,
line scratch detection algorithms must be specially adapted to
this defect.
However, these characteristics are very variable, making
line scratch detection and restoration a particularly difficult
Copyright (c) 2013 IEEE. Personal use of this material is permitted.
However, permission to use this material for any other purposes must be
obtained from the IEEE by sending a request to pubs-permissions@ieee.org.
1 Partly restored by Technicolor, presented at the Cannes Film Festival 2011.
challenge. For instance, in some cases, the scratch is semitransparent, so that some of the original image information
is still available, whereas in others all the information is removed. Also, scratches are not necessarily completely straight
and vertical, and their shape may in fact vary from frame to
frame. Finally, although scratches can often be static, they may
also move with any type of motion.
We propose a line scratch detection method which is composed of two algorithms: a spatial algorithm which provides
a pixel-precision detection of line scratches in single frames,
and a temporal step which rejects false alarms based on
information available in the whole image sequence.
The contributions of this paper are as follows. Firstly,
we propose a pixel-precision line scratch detection algorithm
which is robust to the presence of noise and texture. The
algorithms robustness is due to the use of the a contrario
methodology [7], previously used for gradient alignment detection in images. In particular, we propose a modification to
the methodology which makes the detection robust to texture
and clutter with characteristics that vary throughout the image.
This drastically reduces the number of false alarms. The spatial
algorithm presents good recall (most of the scratches are
detected), with very few true scratches being rejected.
Secondly, we propose a temporal filtering step to remove
false detections left over from the spatial detection. In contrast
to most previous approaches, we reject false detections, rather
than validating true scratches. This is done by using a motion
coherence criterion: we consider that detections which move in
the same manner as the underlying scene are not true scratches.
In particular, we avoid the difficult task of tracking true
scratches, whose temporal behaviour is difficult to determine.
In order to decide on the rejection of a detection, we also
estimate a robust affine scene motion, in contrast to some
previous methods [9], [19] which employ less robust motion
estimation.
The advantages of our method will be demonstrated in
Section V on a series of degraded film sequences and discussed
in comparison with previous work.
The paper is structured as follows. In Section II we briefly
recall some of the previous works on spatial and temporal
line scratch detection. In Section III we present the proposed
method for spatial scratch detection. In Section IV, we introduce the temporal, motion-based filtering whose goal is the
removal of false alarms. Finally, experimental validations are
presented in Section V. Preliminary versions of our work have
appeared in [21], [20].
Scratch profile
Grey Level
Pixel/median value
difference
Median value
n-4
n-3
Left average
n-2
n-1
Scratch width
n+5
Right average
c2 (x, y)
(1)
and does not offer a precise spatial localisation of line segments. In order to group the pixel-wise detections, we turn
to a more sophisticated set of methods known as a contrario
methods, used for alignment detection by Desolneux et al.
in [8].
In a word, the a contrario methodology is a generic way to
detect visual objects in digital images. Detection thresholds are
set in order to control the number of false detections in a white
noise image, or more generally under a background model.
This model usually relies on an independence assumption on
the basic elements to be grouped for the detection. A group
is validated as soon as it is very unlikely that this group has
been generated by the background model. That is, groups are
detected when they are very unlikely under the hypothesis that
basic elements are independent. A comprehensive presentation
of such approaches may be found in [8].
1) A contrario line segment detection
First of all, we present the a contrario approach as it is
used to detect line segments in [7]. In this case, the basic
elements to be grouped are pixels, and segments are detected
as groups of pixels whose gradients are perpendicular to a
given direction.
Given a line segment made of l pixels, a variable xi is
associated to each pixel. The variable xi is equal to 1 if the
pixel is aligned with the segment and 0 otherwise. Aligned
pixels are those whose gradient orientation is orthogonal to the
segment orientation, up to some angular precision p radians,
with p [0, 1]. Let s = x1 + + xl be the number of
aligned pixels. This is the quantity upon which the detection
of segments is based. Larger values of s are associated to more
meaningful line segments.
Now, the detection of segments require thresholds that
depend on l and p and are therefore non-trivially set. The aim
of the a contrario approach is precisely to set these thresholds.
The detection relies on the probability distribution of s under
some background model.
In the case of line segments as described in [7], the
background model specifies that all gradient orientations are
independent and follow a uniform distribution in [0, 2]. This
is the case, for example, in a Gaussian white noise image. As
above, we consider a segment made of l pixels. Let Xi be
a random variable associated to the deterministic observation
xi . Under the background model, each Xi follows a Bernoulli
distribution of parameter p, so that the random number of
(4)
l
X
k=k0
l
X Y
x1 ,...,xl
P
xi =k
pxi i (1 pi )xi ,
(5)
i=1
1r
(7)
A segment is detected if its NFA is smaller than : such a segment is said to be -meaningful. Thanks to Inequality 6, the
expected number of detected segments under the background
model is smaller than .
In all experiments, we use the parameter = 1, as in
[7]. This choice is reasonable, since is a bound on the
expected number of false detections under the background
model. However, it may be further tuned to fit the users needs,
depending on whether the importance should be put on recall
or precision. Furthermore, as explained in [7], detection results
vary slowly with respect to , making it an easy parameter
to tune, if so desired. The impact of this parameter will be
empirically tested in Section V-D.
Since scratches are roughly vertical, we test all segments
with a maximum deviation from the vertical direction of 10
degrees. We discretise these angles by 0.5 degrees. The Ntests
parameter is therefore set to M 2 N , where is the number
of angles tested. With the aforementioned parameters, we have
= 40.
3) Maximality
With the previous detection procedure, many redundant segments are detected. This is because a very meaningful segment
often contains, and is contained by other segments which are
-meaningful. In order to keep only the best detection for such
cases, we use the notion of maximality, as introduced in [7].
A segment is maximal meaningful if it neither contains, nor
is contained, by a segment which is more meaningful (that is,
Fig. 4: Different x-t binary maps, for the Afgrunden 2 sequence. The horizontal axis represents the average horizontal position
of a scratch, and the vertical axis represents the frame number t which the scratch belongs to. Each white point corresponds
to a detected scratch segment in a given frame. The original video may be viewed at: http://www.enst.fr/~gousseau/scratches.
A. Motion coherence
The major challenge when using motion information for
scratch filtering is determining the trajectories of true and/or
false detections. This is a very difficult task in the case of true
scratches due to the generic nature of the trajectories of line
scratches. Instead, we shall try to determine the trajectories of
false detections.
In all that follows, we suppose that a scratch detector
provides the initial detections. In our work, we naturally use
the detection scheme presented in Section III, but it should be
noted that it is possible to use any spatial detection scheme
in the literature, although the results may be worse if pixelprecision detections are not given.
For temporal filtering purposes, we shall represent a scratch
detection by its average column position and the index of
the frame in which it is found. Let IT be the x-t binary
detection map of the detected scratches. For an example of
this representation, see Figure 4 (a). Let S represent an initial
scratch detection. We will refer to this as a segment. Let
x
(S) and y(S) be the average column and row indices of
the segment, and t(S) denote the frame in which the segment
was detected.
The first step of the proposed temporal filtering is to
determine the trajectories of the false detections, a non-trivial
task given the irregularity of the detection map. Instead of
determining the trajectories in IT , we will create another
binary map in which the positions of the segments are realigned with respect to an estimated global scene motion. Let
us call this new detection map IT . Before explicitly defining
the new detection map, let us observe that the positions of
false detections will appear as straight vertical lines, due to
the motion coherence hypothesis. For an example of IT , see
Figure 4 (b). The problem of detecting straight, vertical lines
in an image is much more constrained than following generic
trajectories, and therefore easier to solve.
In order to realign the segments, we need to obtain an
estimation of the scenes global motion. To do this, we use
the algorithm from Odobez et al. [22] to estimate an affine
approximation of the dominant motion in a robust manner. At
a pixel position q = (xq , yq ), the motion vector (u(q), v(q))
is expressed as:
u(q) = c1 + a1 xq + a2 yq
,
(8)
v(q) = c2 + a3 xq + a4 yq
x
y
1
"
a1 + 1
a3
0
a2
a4 + 1
0
c1
c2
1
#"
x
y
1
:= At,t+1
"
x
y
1
(9)
This motion estimation is carried out between each consecutive pair of frames throughout the image sequence.
Let x and y represent the spatial coordinates of a pixel in
frame t. It is possible to find its corresponding coordinates,
(xr ,y r ), in a frame r with the following relationship:
r
x
x
y r = A1
y ,
(10)
r,t
1
1
with
(11)
1 if S | x
r (S) = x, t(S) = t
0 otherwise
(12)
where x
r (S) is the average column index of the segment
warped to the reference frame. It is important to note that
it is the original detection segments which are realigned with
respect to the global motion, and not the detection map IT
itself. This is due to the fact that several segments may correspond to the same spatio-temporal point in IT . An example
of a realigned detection map may be seen in Figure 4(b).
Once the segments have been realigned, we need to detect
vertical line segments in IT , and thereby determine the trajectories of the false detections. Interestingly, the a contrario step
of the algorithm presented in Section III may be used for this
task, since we wish to detect line segments in a new binary
image (the detection map). The detection also guarantees a
precise and unique description of the trajectories, using the
(13)
0.8
0.8
0.7
0.7
0.6
0.6
F1 value
F1 value
0.5
Knight
Sitdown
Star
California
Laurel and Hardy
Les Choses de la vie
Afgrunden 1
Afgrunden 2
Keldjian
Afgrunden gate
0.4
0.3
0.2
0.1
0
50
40
30
20
10
0.5
0.4
0.3
0.2
0.1
10
20
0
1/50
Knight
Sitdown
Star
California
Laurel and Hardy
Les Choses de la vie
Afgrunden 1
Afgrunden 2
Keldjian
Afgrunden gate
1/45
1/40
1/35
1/30
1/25
1/20
1/15
1/10
Fig. 5: Variation of the performance (f 1-score) of the spatial detection algorithm with respect to the values of and the box
size used for the background model estimation. The box size is a fraction of the image dimension for each sequence.
TABLE I: Recall, precision and F1 values comparison, in percentage. We compare our spatial and temporal results with those
of Bruni et al., Gullu et al. and Muller et al. In smaller font are the results of the pixel-wise evaluation of precision for Brunis
and Gullus algorithms.
Evaluation
Algorithm
Recall
Precision
F 1-score
Film
Bruni
Gullu
Muller
Spatial
Temporal
Knight
100.00
100.00
09.57
79.34
79.34
Sitdown
80.93
80.93
17.26
73.72
72.63
Star
95.00
95.00
41.20
82.21
79.68
California
82.07
35.56
54.07
81.10
80.82
Laurel-Hardy
41.87
38.74
38.65
59.35
59.26
Choses Vie
43.43
29.99
16.31
64.88
60.11
Afgrunden 1
75.11
68.75
50.65
86.66
86.39
Afgrunden 2
59.43
52.98
42.34
94.01
93.71
Keldjian
12.63
11.48
14.06
77.35
77.16
Gate
49.81
31.29
47.12
89.03
89.03
02.45
Bruni
29.54
56.47
56.87
10.79
08.84
25.06
09.35
07.85
07.11
Pixel-wise evaluation
23.93
28.54
13.67
06.62
07.88
05.67
03.20
01.85
01.75
00.48
Gullu
29.54
56.47
57.32
11.91
12.01
25.45
10.27
07.43
05.98
02.27
Pixel-wise evaluation
23.93
28.54
13.78
06.67
10.37
03.47
03.56
01.74
01.47
00.44
Muller
Spatial
Temporal
79.86
71.70
73.97
51.62
72.07
71.85
46.57
53.15
56.25
81.22
79.60
79.89
31.89
38.31
45.29
75.48
67.80
69.19
48.17
45.85
67.76
35.28
28.01
50.92
29.08
17.43
38.06
03.06
03.32
11.93
Bruni
Gullu
Muller
Spatial
Temporal
45.61
45.61
17.09
75.33
76.56
66.52
66.52
25.87
72.88
72.24
71.15
71.50
43.72
64.56
65.95
19.08
17.84
64.92
80.34
80.35
14.60
18.33
34.95
46.56
51.34
31.78
27.53
26.82
66.31
64.33
16.62
17.86
49.38
59.97
75.94
13.86
13.03
38.49
43.16
65.99
09.10
07.86
18.96
28.45
50.98
04.68
04.23
05.74
06.40
21.04
Bruni
Spatial
0.03
0.49
0.05
106.22
0.08
98.67
0.03
17.13
0.03
1.85
0.12
2.52
0.08
5.33
0.08
4.65
0.06
2.24
0.06
12.63
B. Precision
10
Fig. 6: Spatial scratch detections. From top to bottom: Knight, Sitdown, Star and Les Choses de la Vie. Correct
detections are shown in green, false alarms in red. Please note that we enforce a minimum scratch height of one tenth of the
height of the image for our algorithm.
11
Fig. 7: Detections from a frame of Keldjian with false alarms due to thin vertical objects removed with temporal filtering.
Correct detections are shown in green, false alarms in red.
C. F 1-score
The F 1-score is defined as the harmonic mean of the recall
and precision:
F =2
recall precision
recall + precision
(14)
12
Fig. 8: An illustration of our spatial methods robustness to texture and noise on two highly textured test images. In the first
example, our locally adaptive method produces only one false detection, whereas with a global background model estimation,
the algorithm fails. The second example illustrates this principle on an image with real scratches.
13
(15)
(16)
and
where H is defined as
H(l, k) := exp(k log
lk
k
(l k) log
),
lp
l(1 p)
(17)
lk
k
(l k) log
.
lp
l(1 p)
(18)
lk
= k [log
+(lk) log
]. (19)
l
l
l(1 p)
l
l(1 p)
We have the partial result:
lk
k
log
=
.
l
l(1 p)
l(l k)
14
Fig. 9: A high definition scratched film (1074x1920). As in all other experiments, a minimum scratch length of one tenth of
the image height was imposed. Correct detections are shown in green, false alarms in red.
Therefore,
f (k, l)
l
so that:
k
lk
k
log
(l k)
l
l(1 p)
l(l k)
l lp
= log
lk
We know that l lp > l k, because lp < k (the condition
for the Hoeffding approximation to hold true). Therefore,
the right hand term of Equation (19) is strictly positive, so
that f (k, l) increases strictly with l. This means that when
a 0 is appended to a segment, its meaningfulness decreases
(since its probability increases). This shows the first inequality
(Equation (15)) in the case of Hoeffdings approximation.
=
lk
k+t
(lk) log
,
(l + t)p
(l + t)(1 p)
k+t
k+t
(k + t) log
(l + t)p
t
(l + t)p
lk
(l k) log
.
t
(l + t)(1 p)
log
Now
k+t
lk
log
=
,
t
(l + t)p
(k + t)(l + t)
and
lk
1
log
=
,
t
(l + t)(1 p)
l+t
so that
f (k + t, l + t)
t
=
+
We have
f (k+t, l+t) = (k+t) log
f (k + t, l + t)
t
k+t
lk
(k + t)
(l + t)p
(k + t)(l + t)
1
(l k)
l+t
lp + tp
log
.
k+t
log
15
R EFERENCES
[1] Physical
Damage,
National
Film
and
Sournd
Archive,
www.nfsa.gov.au/preservation/handbook/damage-films/physicaldamage/. Accessed on 27th September 2013.
[2] T. Bretschneider, O. Kao, and P. J. Bones. Removal of vertical scratches
in digitised historical film sequences using wavelet decomposition. In
Proceedings of the Image and Vision Computing New Zealand, pages
3843, 2000.
[3] V. Bruni, P. Ferrara, and D. Vitulano. Color Scratches Removal Using
Human Perception Image Analysis and Recognition. EURASIP Journal
on Advances in Signal Processing, 2008.
[4] V. Bruni and D. Vitulano. A generalized model for scratch detection.
Image Processing, IEEE Transactions on, 13(1):4450, Jan. 2004.
[5] V. Bruni, D. Vitulano, and A. Kokaram. Line scratches detection
and restoration via light diffraction. In Image and Signal Processing
and Analysis, 2003. ISPA 2003. Proceedings of the 3rd International
Symposium on, volume 1, pages 510 Vol.1, 2003.
[6] K. Chishima and K. Arakawa. A method of scratch removal from old
movie film using variant window by Hough transform. In Communications and Information Technology, 2009. 9th International Symposium
on, pages 15591563, 2009.
[7] A. Desolneux, L. Moisan, and J. M. Morel. Meaningful Alignments.
International Journal of Computer Vision, 40(1):723, Oct. 2000.
[8] A. Desolneux, L. Moisan, and J. M. Morel. From Gestalt Theory
to Image Analysis: A Probabilistic Approach. Springer Publishing
Company, Incorporated, 1st edition, 2008.
[9] M. K. Gullu, O. Urhan, and S. Erturk. Scratch detection via temporal
coherency analysis and removal using edge priority based interpolation.
In IEEE International Symposium on Circuits and Systems, ISCAS 06.,
pages 45914594, 2006.
[10] W. Hoeffding. Probability Inequalities for Sums of Bounded Random
Variables. Journal of the American Statistical Association, 58(301):13
30, Mar. 1963.
[11] L. Joyeux, S. Boukir, and B. Besserer. Film line scratch removal using
Kalman filtering and Bayesian restoration. In Applications of Computer
Vision, 2000, Fifth IEEE Workshop on., pages 813, 2000.
[12] L. Joyeux, S. Boukir, and B. Besserer. Tracking and MAP reconstruction
of line scratches in degraded motion pictures. Machine Vision and
Applications, 13(3):119128, 2002.
[13] L. Joyeux, O. Buisson, B. Besserer, and S. Boukir. Detection and
Removal of Line Scratches in Motion Picture Films. In IEEE Int. Conf.
on Computer Vision and Pattern Recognition, pages 548553, 1999.
[14] K.-T. Kim and E. Y. Kim. Film line scratch detection using neural
network and morphological filter. In Cybernetics and Intelligent Systems,
2008 IEEE Conference on, pages 10071011, Sept. 2008.
[15] A. Kokaram. Detection and Removal of Line Scratches in Degraded
Motion Picture Sequences. Signal Processing VIII, I:58, Sept. 1996.
[16] A. Kokaram, F. Pitie, D. Corrigan, D. Vitulano, V. Bruni, and A. Crawford. Advances in Automated Restoration of Archived Material. CRC
Press, 2011.
[17] A. C. Kokaram. Motion Picture Restoration: Digital Algorithms for
Artefact Suppression in Degraded Motion Picture Film and Video.
Springer-Verlag, London, UK, UK, 1st edition, 1998.
[18] R. Lienhart. Reliable Transition Detection in Videos: A Survey and
Practitioners Guide. In International Journal of Image and Graphics,
pages 469486, 2001.
[19] S. Muller, J. Buhler, S. Weitbruch, C. Thebault, I. Doser, and O. Neisse.
Scratch detection supported by coherency analysis of motion vector
fields. In Proceedings of the 16th IEEE International Conference on
Image processing, pages 8992, 2009.
Yann Gousseau Yann Gousseau received the engineering degree from the cole Centrale de Paris,
France, in 1995, and the Ph.D. degree in applied
mathematics from the University of Paris-Dauphine
in 2000. He is currently a professor at Tlcom ParisTech. His research interests include the mathematical
modeling of natural images and textures, stochastic
geometry, image analysis, computer vision and image processing.