You are on page 1of 8

An Investigation in Dehazing Compressed Images

and Video
Kristofor Gibson Dũng Võ, and Truong Nguyen
Space and Naval Warfare Systems Center Pacific Department of Electrical and Computer Engineering
53560 Hull. St. University of California San Diego
San Diego, CA 92126 USA La Jolla, CA 92093 USA
Email: kris.gibson@navy.mil Email: dungtrungvo@gmail.com, nguyent@ece.ucsd.edu

Abstract—This paper proposes a novel method for single fog in images in Section III. We then explore the effect of
image dehazing that operates at a faster speed than current coding (e.g., JPEG compression) when applying any dehazing
methods for implementation in video enhancements. We provide a method before or after compression in Section IV. We extend
comparison of our proposed dehazing method with current state
of the art methods. We then consider the effect of compression our analysis to video by looking at motion vector estimation in
by investigating the blocking and ringing artifacts in cases of Section V. We present results in Section VI with a simulation
applying any dehazing method before or after compression. Based of images that support our analysis and then finish with a
on an investigation with the JPEG model, we conclude that conclusion in Section VII.
the best dehazing performance (with less artifacts) is achieved
if the dehazing is applied before compression. Simulations for II. BACKGROUND
both JPEG images and H.264 compressed sequences validate our
There are contrast enhancement methods that can improve
conclusion.
the quality of images based on the statistics. Examples of
I. I NTRODUCTION these statistical methods are histogram equalization [2], Grey-
Suppose there is a hypothetical situation where one needs Level-Grouping [3], and Contrast Limited Adaptive Histogram
to design a surveillance system that is capable of capturing Equalization (CLAHE) [4]. Methods like CLAHE were devel-
images or video (visible and/or infrared) for near real-time oped to be spatially adaptive (versus globally applied) in order
surveillance by way of transmitting the imagery through a to account for variable contrast degradations through a single
lossy compression method (e.g., JPEG for images or H.264 image. Additionally, there are methods that try to increase
for video). Also suppose the surveillance system is positioned local contrast in the pixel domain [5], [6]. These can help
in an ocean environment. Since fog and haze are a common achieve satisfactory contrast enhancements because of their
presence in the ocean environment due to the abundance of spatially adaptive nature. Other methods use a model of the
water vapor and temperature fluctuations, the imagery obtained human vision system (HVS) to make the recovered image
by this surveillance system will suffer from low contrast at consistent with how a human perceives the image by enforcing
all spectral bands [1]. A typical choice for improving the color constancy [7], [8]. Instead of modeling the receiving
imagery (by removing fog/haze) acquired is to apply contrast end (human or machine), we will focus on more applicable
enhancements after the images are captured and compressed. methods that use an external physics model of fog and haze
This is commonplace because most systems are not equipped to estimate and recover a dehazed image [1], [9]–[13]. This is
with on-board enhancement systems. We will call this type of an attractive model because it can further help to recover the
system a post-enhancement or Post. Another reasonable choice depth of a scene, which can facilitate other processes such as
is to apply a contrast enhancement before compression. We object detection.
call this pre-enhancement, or Pre. The question is which is To account for the presence of compression, researchers
the better choice, the Pre or Post method and why? have also implemented contrast enhancements in the transform
In Section II we will briefly explore common contrast domain [14]–[16]. What is not found in research material
enhancements that can be used to remove fog and haze. is a joint investigation between dehazing and image/video
This section then introduces a commonly used physics model compression. In addition, the implementation of the Pre or
implemented in current single image dehazing methods that Post method hasn’t been investigated. We will first look at the
account for the physics model of haze and fog. It is also rea- common model used for dehazing and then observe the effect
sonably desirable for the contrast enhancement method to be of dehazing before (Pre) and after (Post) compression.
fast enough in order to allow several images to be analyzed (by A. Fog and Haze Physical Model
humans or computer vision systems) in a reasonable amount
The dichromatic model commonly used for representing fog
of time or for near real-time video surveillance. Therefore we
and haze is
will propose a single image dehazing method that is faster
than current methods and yet effective in removing haze and x̂(m, n, λ) = x(m, n, λ)t(m, n, λ)+a(λ)(1−t(m, n, λ)) (1)

978-1-4244-4333-8/10/$25.00 ©2010 IEEE


where x̂(m, n, λ) is the hazy pixel at location (m, n) with where x̂, x, and a are all 3 × 1 RGB color vectors. We also
wavelength λ, x(m, nλ) is the original pixel with no haze, assume the transmission as
a(λ) is the airlight color and t(m, n, λ) is the exponentially
t(m, n) = e−βd(m,n) . (4)
decaying term. The decaying term is modeled by
The DCP in [11] is generated with
t(m, n, λ) = e−β(m,n,λ)d(m,n) , (2)  
x(k, l, c)
θD (m, n) = min min , (5)
where d(m, n) is the distance from the target to the sensor and k,l∈Ω(m,n) c∈{r,g,b} a(c)
β(m, n, λ) is the scattering coefficient that depends on the size where Ω is a square neighborhood (e.g., 5×5 or 11×11). The
of the scattering particles in the environment and wavelength. DCP is fast to generate however it overlaps occlusion edges
The airlight a(λ) is a color value where equilibrium is met which result in halo effects in the dehazed image. Therefore,
at infinite distance (e.g., color of a black target at the horizon similar to [12], we use a median filter instead of a minimum
when haze is present). operation to generate the Median DCP (MDCP),
With one equation and three unknowns in (1), dehazing to  
get the original x(m, n, λ) is an ill-posed problem. In order x̂(k, l, c)
θM (m, n) = med min . (6)
to convert it into a well posed problem, the first and most k,l∈Ω(m,n) c∈{r,g,b} a(c)
common assumption made is that the scattering coefficient The median operator can help preserve edges but smooth
β(m, n, λ) is homogeneous, β(m, n, λ) = β(λ). That is the the flat regions. Another advantage of this operator is its fast
amount of fog or haze is smooth within the field of view of implementation. While [12] applied two median operations to
the sensor. Narasimhan et al. make an additional assumption estimate the atmospheric veil, a(1 − t(m, n)), the proposed
in [1] that the scattering is color independent for hazy and MDCP only uses one median operation to even save more
foggy conditions, β(m, n, λ) = β, with wavelengths within time in estimating t(m, n). What is also beneficial with the
the visible spectrum. By using this assumption, the estimate median operation is that it can be applied in a multi-core
of transmission is simplified to t(m, n) = e−βd(m,n) which is fashion where multiple median filters can be applied to sub-
arbitrary to scale because we don’t know the value of β. 1 regions of an image in parallel to speed up processing times.
The airlight value can be estimated from a single image (For consistency, we only present timing results using a single
by several different methods. In [11], a small percentage core design and implementation in Matlab.)
of the brightest pixels are used to compute a(λ). For RGB Similarly as in [11], we estimate the transmission as
colorspaces, a principal component analysis is used in [9] to
tM (m, n) = 1 − wθM (m, n) (7)
compute subspaces which are then intersected to provide the
airlight color. and the DCP estimated transmission by
With the above assumptions, we now only have one
tD (m, n) = 1 − wθD (m, n), (8)
unknown left, t(m, n) = e−βd(m,n) , and one equation.
Narasimhan et al. [13], [17] used multiple images of the with w set to 0.95 for our experiments.
same scene with different scattering to obtain more equations He [11] applied a spectral matting method to smooth
than unknowns to estimate t(m, n). Recent findings from re- tD (m, n) to tDS (m, n) and to recover the original occlusion
searchers showed ways to dehaze a single image by estimating edges in the scene. This step requires a long time to process.
t(m, n) with different prior intuition. In [9], Fattal uses the Unlike the median operators where they can be implemented
statistical independence between shading and albedo to pull into a multi-core fashion, creating the matting Laplacian for
out a rough estimate of t(m, n). Both Tan in [10] and Tarel the spectral matting method can not be broken into multi-cores
in [12] estimate the veiling a(λ)(1 − t(m, n)) by assuming for faster processing. For details on smoothing to tDS , we refer
the spatial variation is smooth because depth transitions are the reader to [11]. In contrary, smoothing is rarely needed for
smooth. However Tarel adds to this assumption that there are sufficient dehazing with the MDCP method.
also strong depth discontinuities at occlusion edges. A more The dehazed image using He’s DCP method (with smooth-
unique approach by He in [11] uses a dark channel prior (DCP) ing) is
to generate the raw estimate of t(m, n). This DCP image is x̂ − a
xDS (m, n) = +a (9)
dominantly black when fog or haze is not present. We will max(tDS (m, n), )
follow this intuition in our paper. and our MDCP dehazed image is
III. P ROPOSED M ETHOD x̂ − a
xM (m, n) = + a, (10)
max(tM (m, n), )
We will use the assumptions mentioned in the previous sec-
tion to develop the dichromatic model in the RGB colorspace with  chosen to be small (e.g., 0.1) for mathematical condi-
as tioning.
An example of our method compared to the DCP method
x̂(m, n) = x(m, n)t(m, n) + a(1 − t(m, n)), (3)
and Tarel’s is in Fig. 1. The MDCP method is the fastest
1 Similarly, we could assume depth is flat d(m, n) = d and allow β(m, n) method at 1.2 seconds compared to Tarel’s method at 2.9
to be spatially varying but independent of wavelength. seconds and the DCP method at about 10 minutes.
(a) Hazy image x̂ (b) xDS (c) xM (d) xT
Fig. 1. (a) The original hazy image from [11] with size 600 × 400. (b) The dehazed image using He’s DCP method [11]. 589.1 seconds to process. (c)
Dehazed using our proposed MDCP method. 1.2 seconds to process. (d) Dehazed using Tarel’s method [12]. 2.9 seconds to process. Note: All simulations
are done using Matlab code. Processing times can be reduced considerably if implemented in C or C++.

IV. E FFECTS OF JPEG C OMPRESSION WITH D EHAZING In JPEG compression, an NxN forward Type-II DCT ap-
Let’s take a step back and assume we have a perfect plied in non-overlapping blocks. The direct form of the (i, j)th
dehazing algorithm where t(m, n) and a are exactly known. NxN block of the transformed luminance is
We want to view what happens when you dehaze before or
fi,j (u, v) =
after lossy JPEG compression (assuming haze is present in X
the image). We will use JPEG compression with uniform K(u, v) y(N i + m, N j + n)Cu (m)Cv (n) (15)
quantization for the first part of our investigation. With JPEG, 0≤m,n≤N −1
the input image is first converted into a YUV (or YCrCb) for u, v = 0, ..., N − 1 and
colorspace using a 3x3 projection matrix R. 
(2k + 1)sπ

Cs (k) = cos , (16)
(y, cr , cb )T = Rx. (11) 2N
In the Pre method x̂ is dehazed to x before converting to K(u, v) = α(u)α(v), (17)
YCrCb so we simply have y as our luminance (instead of ŷ). and
If the chosen method is Post then the resulting luminance is
( p
1/N , if s = 0 (18)
still hazy ŷ. α(s) = p
Using our dichromatic model, the hazy luminance is 2/N , if s 6= 0. (19)
We will use the framework shown above to explore how
ŷ(m, n) = r1 T x̂(m, n)
ringing and blocking artifacts are affected when using the Pre
= r1 T x(m, n)t(m, n) + r1 T a(1 − t(m, n)) and Post methods.
= y(m, n)t(m, n) + ay (1 − t(m, n)) (12) A. Ringing Artifacts from Coding and Dehazing
where y is the luminance of the non-hazy image pixel When an image is decompressed, ringing artifacts will occur
r1 T x(m, n) and the airlight projected onto the luminance when frequency components are lost at the compression side.
channel is ay = r1 T a. (rk T is the k th row of matrix R.) Be- This loss is caused by the quantization of the DCT coefficients.
fore we ignore the Cr , Cb channels in this analysis, take note Using (12) and (15), a DCT coefficient at frequency (u, v) of
that if the airlight is colorless, then the Cr and Cb channels will the hazy luminance at the (i, j)th block is
not contain any airlight information (rk T a = 0, ∀k = 2, 3). X
That is fˆi,j (u, v) = K(u, v)
0≤m,n≤N −1
cˆr (m, n) = r2 T x(m, n)t(m, n) (13)
[y(N i + m, N j + n)t(N i + m, N j + n)
and +ay (1 − t(N i + m, N j + n))Cu (m)Cv (n)] . (20)
cˆb (m, n) = r3 T x(m, n)t(m, n). (14) If we assume the depth is the same at every pixel within
Once the luminance is obtained, the values are offset to be the (i, j)th block (ti,j (m, n) = ti,j ) then (20) becomes
within the range of [-2P , 2P − 1] for (P + 1) bit data. For X
fˆi,j (u, v) = K(u, v) [ti,j y(N i + m, N j + n)
clarity purposes we will not make a notational difference and
0≤m,n≤N −1
from this point on we assume that the luminance values for ŷ
and y are subtracted by 2P . +ay (1 − ti,j )Cu (m)Cv (n)] . (21)
Next we associate the zigzag frequency ν with the hor- With (28) and (29), we can say the probability that a hazy
izontal and vertical frequencies, u, and v respectively. The AC coefficient is annihilated is greater than the probability a
operators Zu (ν), Zv (ν), and Zν (u, v) are given as non-hazy AC coefficient is annihilated,
   
u = Zu (ν), v = Zv (ν), ν = Zν (u, v). q(ν) q(ν)
P |fˆi,j
z
(ν)| < z
> P |fi,j (ν)| < . (30)
2 2
These operators allow us to parameterize (21) with ν as
Thus using (30) and assuming ti,j is constant at an (i, j)
fˆi,j
z
(ν) = fˆi,j (Zu (ν), Zv (ν)). (22) block, the probability of ringing artifacts using the Post method
Thus the DC component of fˆi,j
z
(ν) is fˆi,j
z
(0). For the AC is greater than the probability of ringing using the Pre method.
2
components, 1 ≤ ν ≤ N − 1, we have B. Blocking Artifacts from Coding and Dehazing
fˆi,j
z
(ν) = The cause of blocking artifacts in lossy compression meth-
ods is due to the artificial boundaries induced by the block
X
K(Zν (u), Zν (v)) [ti,j y(N i + m, N j + n)
0≤m,n≤N −1
based DCT between neighboring blocks [18]. To observe the
severity of blocking we will compare the signal to noise ratios
Cu (νm )Cv (νn )]
z
(SNR) on the reconstructed (or decompressed) end of the
= ti,j fi,j (ν), for 1 ≤ ν ≤ N 2 − 1. (23) system. To do this, we use the (i, j)th reconstructed block,
r q
In (23) we see that the relationship between the AC compo- yi,j which is a dequantized and inverse block DCT of fi,j ,
nents of the hazy block fˆi,j
z z
and its non-hazy counterpart fi,j is N −1 N −1
an attenuation by ti,j (assuming ti,j is constant in the (i, j)th
X X q
r
yi,j (m, n) = K(u, v)fi,j (u, v)Cm (u)Cn (v)q(u, v),
block). u=0 v=0
The quantization q(ν) applied to each DCT coefficient is (31)
where q(u, v) is the uniform quantization at frequency (u, v).
q
fˆi,j (ν) = bfˆi,j
z
(ν)/q(ν) + 1/2c, (24) r
It has been shown in [19] that the reconstruction yi,j can be
characterized as the original signal plus reconstruction noise,
where the operator bx + 1/2c is a rounding to the nearest
integer operation on x. The quantizing of coefficients in (24) r
yi,j (m, n) = yi,j (m, n) + r (32)
can annihilate (set to zero) AC components hz (ν) when
where r is the reconstructed noise with zero mean and
hz (ν)/q(ν) < 1/2. (25) variance of σr2 . Likewise, the hazy reconstructed block is
The probability a hazy AC coefficient is annihilated is r
  ŷi,j (m, n) =
q(ν)
P |fˆi,j
z
(ν)| < , (26) t(m, n)yi,j (m, n) + ay (1 − t(m, n)) + r . (33)
2
and the probability a non-hazy AC coefficient is annihilated is If we take the next step in this analysis by also adding
  camera noise n to (12), then the image used for dehazing in
z q(ν) the Pre method (no compression) is
P |fi,j (ν)| < . (27)
2
P re
ŷi,j (m, n) =
With (23) and (26) we can relate the probability using the
non-hazy AC coefficient, ti,j (m, n)yi,j (m, n) + ay (1 − ti,j (m, n)) + n (34)
   
q(ν) q(ν) and the hazy reconstructed image used for the Post method is
P |fˆi,j
z
(ν)| < z
= P |ti,j fi,j (ν)| <
2 2
P ost

q(ν)
 ŷi,j (m, n) =
z
= P |fi,j (ν)| < (28)
2ti,j ti,j (m, n)yi,j (m, n) + ay (1 − ti,j (m, n)) + n + r . (35)
(since ti,j is always positive). Let’s make another reasonable Now assume that we have a perfect dehazing function D(.)
assumption to simplify our analysis by restricting 0 ≤ ti,j < 1 defined as
because at ti,j = 1 means the distance to the camera is zero 1
which in practice never occurs. Using this additional restric- D(ĥ) = h = (ĥ − ay ) + 1 (36)
t(m, n)
tion, shifting the threshold from q(ν) 2
q(ν)
to 2t i,j
increases the
probability (27) to (28) respectively because of the monotonic where the transmission t(m, n) and airlight ay are exactly
increasing property of the cumulative distribution function known. Using (34), (35), and (36) we have the dehazing
which gives us the inequality function to be

q(ν)
 
q(ν)

P re P re n
z
P |fi,j (ν)| < z
< P |fi,j (ν)| < . (29) Di,j = D(ŷi,j (m, n)) = yi,j (m, n) + (37)
2 2ti,j ti,j (m, n)
and
P ost P ost n + r
Di,j = D(ŷi,j (m, n)) = yi,j (m, n) + . (38)
ti,j (m, n)
Note that in (37) the reconstruction error is not present because
compression has not taken place. To complete the Pre analysis,
we will add reconstruction noise similar to (32) to represent
P re
the reconstructed version of Di,j ,
P re,r P re
Di,j = Di,j + r . (39)
With E[n ] = E[r ] = 0, the expected value for both
DP re,r and DP ost methods are both equal to yi,j (m, n). But
interestingly, their variances are different and are calculated as

P re σn2
var[Di,j ] = σy2i,j + + σr2 (40)
t2i,j (m, n)
and
σn2 + σr2 (a) Synthesized Haze
P ost
var[Di,j ] = σy2i,j + . (41)
t2i,j (m, n)
with var[yi,j (m, n)] = σy2i,j . More importantly, the Pre and
Post SNR relationship at block (i, j) for the perfect dehazing
P re P ost
function D, SN Ri,j and SN Ri,j respectively, is

P re
σy2i,j σy2i,j P ost
SN Ri,j = 2
σn
≥ σn2 +σ 2 = SN Ri,j . (42)
t2i,j (m,n)
+ σr2 r
t2i,j (m,n)

In (42) we see that a neighboring block pair (e.g., blocks


at (i, j) and (i, j + 1)) with the same luminance and depth
will suffer from lower SNR with the Post method. This leads
to a higher noise variance between neighboring blocks which
causes more blocking artifacts compared to the Pre method.
It is also shown in (42) that the noise contribution is spatially
varying and dependent on the depth of the scene where again
ti,j (m, n) = e−βdi,j (m,n) with distance di,j (m, n). Therefore
the blocking artifacts will become more severe as distance
and/or scattering β is increased. Also, in order to remove noise, (b) Dehazed (no compression). Red box is region of interest used for visual
spatial dependency (where t(m, n) may be used as queue) comparison.
must be considered which is also addressed in [13].
C. JPEG Pre/Post Experiment
We used the Weather and Illumination Database (WILD)
[20] to experiment Pre and Post methods using JPEG. This
database contains the depth of a scene along with high
resolution images of the same scene in all weather conditions.
Using WILD, a synthesized hazy image was created using
(c) Uncompressed De- (d) Pre method. (e) Post method.
an arbitrarily chosen airlight value and scattering. We then hazed image.
used (36) to reconstruct a haze-free image before and after Fig. 2. Comparison of dehazed image using Pre and Post methods with
JPEG compression (Pre and Post respectively). We modified similar file sizes.
the JPEG quality parameters for the Pre and Post methods so
that the file sizes were very similar. For this particular case we
used a quality factor of 48 to generate an 83.1 KB image for Post method) the image result using the Post method suffers
the Pre method and a quality factor of 70 to generate an 84.7 more from ringing artifacts as evident around the building
KB image for the Post method. A cropped region of the results edges in Fig. 2e. We can also see more blocking artifacts in
is displayed in Fig. 2. Even though the quality was set lower the sky region above the buildings in the Post dehazed image.
for the Pre method (producing a smaller image size than the Next we compared the Pre and Post methods with JPEG
the (k, l) block in another frame as
X
SADi,j (k, l) = |y(N i + m, N j + n)
0≤m,n≤N −1
−y(N k + m, N l + n)| . (43)
Similarly, the SAD measurement with a hazy sequence is
X
ˆ i,j (k, l) =
SAD |ŷ(N i + m, N j + n)
0≤m,n≤N −1
−ŷ(N k + m, N l + n)| . (44)
We now can show that if the transmission is constant surround-
ing block (i, j) such that ti,j (m, n) = ti,j = tk,l then we have
a simple scaling relationship between both SAD measures
X
Fig. 3. A performance comparison of the Pre and Post methods using JPEG ˆ i,j (k, l) =
SAD
and WILD database.
0≤m,n≤N −1
|ti,j (m, n)y(N i + m, N j + n) + ay (1 − ti,j (m, n))
quality values set from 5 to 100 to the uncompressed dehazed −tk,l (m, n)y(N k + m, N l + n) − ay (1 − tk,l (m, n))|
image (Fig. 2b) using a PSNR measure. We stored the image = ti,j SADi,j (k, l). (45)
sizes that resulted from each method and plotted them in To view how the transmission modifies the performance of
Fig. 3. From these results we see the Pre method produces a MV estimation in a probabilistic sense, let the set Sτ be the
significant gain from 5 to 20 dB as the image size is increased. set of all SAD values measured within the block search region
This concludes the JPEG analysis by showing that it is ΩB that are less than a threshold τ ,
best to enhance before JPEG compression, Pre, in order to
minimize blocking and ringing artifacts. Sτ = {SADi,j (k, l) < τ, ∀(k, l) ∈ ΩB } , (46)
and similarly we let the set Ŝi,j be
n o
V. E FFECT OF M OTION V ECTOR E STIMATION WITH Ŝτ = SAD ˆ i,j (k, l) < τ ; ∀(k, l) ∈ ΩB
D EHAZING = {ti,j SADi,j (k, l) < τ ; ∀(k, l) ∈ ΩB } . (47)
The set (47) can further be expressed using the scaling
To extend our analysis from compressed images to com- relationship from (45) as
pressed videos, we will consider the effect of motion vector  
estimation. Temporal redundancy removal is one of the most τ
Ŝτ = SADi,j (k, l) < = γi,j ; ∀(k, l) ∈ ΩB
important techniques to achieve a high compression ratio in ti,j
video compression [21]. In this technique, motion estimation = Sγi,j , (48)
plays a key role in commonly used codecs, e.g. MPEG-II and
τ
H.264. We will explore the performance difference in motion where the new threshold, γi,j = ti,j ≥ τ , is a scale of the
estimation when the dehazing enhancements are applied before original chosen threshold τ (using 0 ≤ ti,j ≤ 1).
or after compression. Thus the number of SAD values less than τ , |Sτ |, compared
Block matching algorithms (BMA) are a popular choice for to SAD values less than γi,j , |Sγi,j |, with the number of search
reducing the temporal redundancy between frames in video blocks |ΩB | staying the same is
compression. In a BMA, one motion vector (MV) is generated |Sτ | |Sγi,j | |Ŝτ |
for each block. A MV represents the displacement between a ≤ = (49)
|ΩB | |ΩB | |ΩB |
block in one frame to its best-matched block in the referenced
frame [22]. Video codecs such as H.264 use BMAs to estimate which leads to the probability relationship
n o
the MVs [23]. Not every block actually has motion therefore P {Sτ } ≤ P Ŝτ . (50)
thresholds are used to indicate whether or not a MV is used
for inter-coding that block [24]. If we apply the reasonable restriction that ti,j is less than one
We will use the Sum of Absolute Difference (SAD) method 0 ≤ ti,j < 1 then we have a stricter relationship
n o
which is commonly used in BMAs to measure the similarity P {Sτ } < P Ŝτ . (51)
between candidate blocks for motion compensation with and
without the presence of haze. We first define the perfectly In (51), we simply state that there are more hazy MV block
dehazed SAD measure between the (i, j) reference block and candidates in the search region ΩB than in a dehazed block
search region. By dehazing a block region, the number of
motion vector candidates are reduced when using a threshold
τ for SAD minimum criteria and when the transmission is the
same (ti,j = tk,l ; ∀(k, l) ∈ ΩB ) within the search region ΩB .

(a) Original video frame. (b) Dehazed video frame. Red box
is region of interest used for com-
parisons. Fig. 5. Luminance PSNR vs. Bitrate using H.264.

plot of the results are in Fig. 5. Over all bitrates, the Pre
method has a higher PSNR than the Post method.
For more results, please visit the following website:
http://videoprocessing.ucsd.edu/∼kgibson/PrePost.

(c) 250 kbps Post (d) 250 kbps Pre


VII. C ONCLUSION
We opened with a hypothetical scenario where the Pre or
Post method are possible choices for providing a contrast
enhancement capability to a surveillance system in the ocean
environment. We reviewed current contrast enhancement meth-
ods and presented a physics model that is a popular choice
for dehazing images. We proposed a novel dehazing method
that works well without producing halo artifacts and is fast
(e) 750 kbps Post (f) 750 kbps Pre by using a single median filter operation. Our mathematical
Fig. 4. A frame from the original video sequence is in (a). A snapshot
analysis shows how the Pre method produces less blocking
from the dehazed video is in (b). The red box indicates the region used for and ringing artifacts compared to the Post method when
closer comparisons. Subfigures (c)-(e) are the comparisons of the Pre and Post JPEG compression is used. We then simulated experiments
methods with H.264 compression at 250 and 750 kbps bitrates. The stack and
stern of the ship is more defined with the Pre method.
to validate our analysis for JPEG. We extended the analysis
to motion estimation which again shows that the Post method
One can look at (51) in two different ways. Reducing the suffers from lower SNR after decoding and more erroneous
number of MV candidates to zero by dehazing can also reduce block MV estimations than the Pre method. Our experiment
the total number of MVs which can limit the lowest achievable with H.264 compression of a real scene also illustrates that
bitrate because the best compression gain is from obtaining the Pre method is a better choice than the Post method.
MVs. However one may also see that if there truly isn’t ACKNOWLEDGMENT
motion within ΩB , the number of candidates with the dehazed
The authors would like to thank SSC Pacific for funding
version, zero, is higher with the hazy version which can lead
this research.
to false MV estimation. This will cause blocking artifacts and
flickering because of spatial-temporal inconsistencies.
VI. S IMULATION AND R ESULTS
We performed an experiment by applying our proposed
MDCP dehazing method on a video sequence before and after
compressing with an H.264 compressor with varying bitrates.
A visual sample of the results are in Fig. 4. Within the video
sequence, a Coast Guard ship is in view which is indicated
with a red box in Fig. 4b. We see that the Pre method gives a
better enhanced view of the ship compared to the Post method.
We then measured the PSNR for each bitrate by comparing
the uncompressed dehazed video with compressed video with
dehazing applied before (Pre) or after (Post) compression. The
R EFERENCES [21] J. Jain and A. Jain, “Displacement Measurement and Its Application
in Interframe Image Coding,” Communications, IEEE Transactions on,
[1] S. G. Narasimhan and S. K. Nayar, “Vision and the atmosphere,” no. 3, vol. 29, no. 12, pp. 1799–1808, Dec. 1981.
pp. 1–22. [22] H. Oh, “Block-matching algorithm based on an adaptive reduction of
[2] R. C. Gonzalez and R. E. Woods, Digital Image Processing, ser. the search area for motion estimation,” Real-Time Imaging, no. 5, pp.
Computer Science and Engineering Series. Prentice Hall, 2002, 407–414, Oct.
vol. 14, no. 3. [Online]. Available: http://www.jstor.org/stable/1574313? [23] T. Wiegand, G. Sullivan, G. Bjontegaard, and a. Luthra, “Overview of
origin=crossref the H.264/AVC video coding standard,” IEEE Transactions on Circuits
[3] Z. Chen, B. R. Abidi, D. L. Page, and M. a. Abidi, “Gray-level and Systems for Video Technology, no. 7, pp. 560–576, Jul.
grouping (GLG): an automatic method for optimized image contrast [24] S. Wang, T. Lin, T. Liu, and C. Lee, “A new motion compensation
enhancement–Part I: the basic method.” IEEE transactions on image design for H. 264/AVC decoder,” in IEEE International Symposium on
processing : a publication of the IEEE Signal Processing Society, Circuits and Systems, 2005. ISCAS 2005, pp. 4558–4561.
vol. 15, no. 8, pp. 2290–302, Aug. 2006. [Online]. Available:
http://www.ncbi.nlm.nih.gov/pubmed/16900684
[4] Z. Xu, X. Liu, and X. Chen, “Fog Removal from Video Sequences
Using Contrast Limited Adaptive Histogram Equalization,” 2009
International Conference on Computational Intelligence and Software
Engineering, pp. 1–4, Dec. 2009. [Online]. Available: http://ieeexplore.
ieee.org/lpdocs/epic03/wrapper.htm?arnumber=5366207
[5] K. Subr, A. Majumder, and S. Irani, Greedy Algorithm for Local
Contrast Enhancement of Images, ser. Lecture Notes in Computer
Science. Berlin/Heidelberg: Springer-Verlag, 2005, vol. 3617, pp.
171–179. [Online]. Available: http://www.springerlink.com/content/
yhu486x7mu124r66
[6] G. Apostolopoulos and E. Dermatas, “Local adaptive contrast
enchancement in digital images,” in Proceedings of the 3rd
international conference on Mobile multimedia communications.
ICST (Institute for Computer Sciences, Social-Informatics and
Telecommunications Engineering), 2007, p. 8. [Online]. Available:
http://portal.acm.org/citation.cfm?id=1385289.1385299
[7] E. Land and J. McCann, “Lightness and retinex theory,” J. Opt. Soc.
Amer., vol. 61, no. 1, pp. 1–11, Jan. 1971.
[8] B. Funt, F. Ciurea, and J. Mccann, “Retinex in matlab,” in Journal of
Electronic Imaging, 2000, pp. 112–121.
[9] R. Fattal, “Single image dehazing,” ACM Transactions on Graphics,
no. 3, p. 1, Aug.
[10] R. T. Tan, “Visibility in bad weather from a single image,” 2008 IEEE
Conference on Computer Vision and Pattern Recognition, pp. 1–8, Jun.
[11] K. He, “Single image haze removal using dark channel prior,” 2009
IEEE Conference on Computer Vision and Pattern Recognition, pp.
1956–1963, Jun.
[12] J.-P. Tarel and N. Hautière, “Fast visibility restoration from a single color
or gray level image,” in Proceedings of IEEE International Conference
on Computer Vision (ICCV’09), Kyoto, Japan, 2009, pp. 2201–2208,
http://perso.lcpc.fr/tarel.jean-philippe/publis/iccv09.html.
[13] N. Joshi and M. Cohen, “Seeing Mt. Rainier: Lucky Imaging for Multi-
Image Denoising, Sharpening, and Haze Removal,” ICCP 2010.
[14] A. Chaudhry, K. Iqbal, A. Khan, and A. Mirza, “Enhancing contrast
of compressed images: Reducing block artifacts adaptively.” IEEE,
Dec 2006, pp. 140–145. [Online]. Available: http://ieeexplore.ieee.org/
lpdocs/epic03/wrapper.htm?arnumber=4196394
[15] K. Iqbal, A. Bangash, A. Chaudhry, and A. Khan, “Activity based
contrast enhancement of compressed digital images in dct domain,” in
Electrical Engineering, 2007. ICEE ’07. International Conference on,
11-12 2007, pp. 1 –6.
[16] S. Lee, “Compressed image reproduction based on block decomposi-
tion,” IET Image Processing, vol. 3, no. 4, p. 188, 2009.
[17] S. Narasimhan and S. Nayar, “Contrast Restoration of Weather
Degraded Images,” IEEE Transactions on Pattern Analysis and
Machine Intelligence, vol. 25, no. 6, pp. 713–724, Jun. 2003.
[Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.
htm?arnumber=1201821
[18] Y. Yang, N. Galatsanos, and A. Katsaggelos, “Projection-based spatially
adaptive reconstruction of block-transform compressed images,” IEEE
Transactions on Image Processing, no. 7, pp. 896–908.
[19] M. Leow, “Closed-form quality measures for compressed medical im-
ages: statistical preliminaries for transform coding,” Proceedings of
the 25th Annual International Conference of the IEEE Engineering in
Medicine and Biology Society (IEEE Cat. No.03CH37439), pp. 837–840.
[20] S. Narasimhan, C. Wang, and S. Nayar, “Wild: Weather and illumunation
database, http://www.cs.columbia.edu/cave/software/wild/index.php,”
Jan. 2010. [Online]. Available: http://www.cs.columbia.edu/CAVE/
software/wild/index.php

You might also like