Method for detecting artifacts in infrared (IR) illuminated IR images
The present disclosure relates to a computer implemented method for detecting artifacts in infrared (IR) illuminated IR images. Artifacts are separated from real objects by analyzing results of regression line fits to histograms of pixel values. Artifacts will have smooth transition gradients and therefore will show smaller deviations of the regression line fit to the histogram data.
1 . Computer implemented method for detecting artifacts in infrared (IR) illuminated IR images, the method comprising:
acquiring at least a first IR frame with a first exposure time under a condition of active IR illumination;
creating an input frame for performing frame segmentation based on the first IR frame;
performing frame segmentation on the input frame for acquiring positions and boundaries of a plurality of frame segments, each frame segment comprising a plurality of pixels being attributed to a same object;
for each of the plurality of frame segments:
calculating a histogram of pixel values by binning the pixel values into K bins with K being a positive number,
fitting a regression line to the histogram,
calculating a deviation between the fitted regression line and the histogram,
in response to the deviation being smaller than a predetermined deviation threshold, classifying the frame segments as an artifact.
2 . The method of claim 1 , further comprising the steps of:
acquiring a second IR frame with the first exposure time under the condition of inactive IR illumination;
performing frame subtraction by calculating a first difference frame; and
creating the input frame for performing frame segmentation based on the first difference frame.
3 . The method of claim 2 , further comprising the steps of:
acquiring a third IR frame with a second exposure time smaller than the first exposure time under the condition of active IR illumination;
performing frame subtraction by calculating a second difference frame; and
creating the input frame for performing frame segmentation based on the second difference frame.
4 . The method of claim 1 , further comprising the steps of
acquiring a second IR frame with the first exposure time under the condition of inactive IR illumination;
performing frame subtraction by calculating a first difference frame (RS) based on the equation RS=ssub (first IR frame, second IR frame), wherein
ssub
(
X
,
Y
)
=
{
X
i
,
j
-
Y
i
,
j
,
X
i
,
j
≥
Y
i
,
j
0
,
X
i
,
j
<
Y
i
,
j
for
every
(
i
,
j
)
∈
(
[
1
,
W
]
)
*
[
1
,
H
]
)
,
with
X i,j : pixel value at position (i,j) in frame X,
Y i,j : pixel value at position (i,j) in frame Y,
W: number of pixels in width direction in frames X and Y,
H: number of pixels in height direction in frames X and Y; and
creating the input frame for performing frame segmentation based on the first difference frame RS.
5 . The method of claim 4 , further comprising the steps of:
acquiring a third IR frame with a second exposure time smaller than the first exposure time under the condition of active IR illumination;
performing frame subtraction by calculating a second difference frame; and
creating the input frame for performing frame segmentation based on the second difference frame DS.
6 . The method of any one of claim 1 , further comprising the steps of defining a histogram fitting region between a lower histogram bin and an upper histogram bin, and fitting the regression line within the histogram fitting region to the histogram.
7 . The method of claim 6 , wherein the lower histogram bin corresponds to the bin comprising the lowest pixel value above zero contributing to the histogram and the upper histogram bin corresponds to the largest pixel value below the pixel saturation value contributing to the histogram.
8 . The method of claim 1 , wherein the deviation is calculated as the root mean square error between the histogram values and the fitted regression line and frame segments with a calculated root mean square error value smaller than a root mean square threshold equal to the deviation threshold are identified and classified as artifacts.
9 . The method of claim 8 , wherein the root mean square error value (RMSE) is calculated based on the equation:
RMSE
=
(
∑
1
(
H
1
-
F
1
)
2
)
,
H I : histogram value in histogram bin I,
F I : value of fitted regression line in histogram bin I.
10 . The method of claim 1 , wherein the step of performing frame segmentation further includes removing frame segments having a size below a predetermined size threshold and/or removing frame segments having an accumulated total brightness below a predetermined brightness threshold.
11 . The method of claim 1 , wherein the number K of histogram bins is in a range between 20 and 120.
12 . The method of claim 1 , further comprising the step of accumulating the histogram.
13 . A computer system configured to carry out the computer implemented method of claim 1 .
14 . A non-transitory computer readable medium comprising instructions for carrying out the computer implemented method of claim 1 .
15 . An Autonomous Driving (AD) system or Advanced Driver Assistant System (ADAS) for vehicles comprising the computer system of claim 13 .