0% found this document useful (0 votes)
104 views

Shot Detection Using Histogram Comparison and Image Substraction

This document describes a method for shot detection in videos using image subtraction and histogram comparison. The method works as follows: 1. It subtracts the pixel values of two frames to generate a difference image and calculates the percentage of pixels with differences above a threshold. If low, the frames likely belong to the same shot. 2. It compares the color histograms of two frames. If the difference is below a threshold, the frames have similar distributions and likely belong to the same shot. 3. It was tested on a video and able to accurately detect most abrupt shot boundaries and reduce the total number of frames, though it may miss some gradual shot transitions. The method is simple and fast but could be improved to better handle
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Shot Detection Using Histogram Comparison and Image Substraction

This document describes a method for shot detection in videos using image subtraction and histogram comparison. The method works as follows: 1. It subtracts the pixel values of two frames to generate a difference image and calculates the percentage of pixels with differences above a threshold. If low, the frames likely belong to the same shot. 2. It compares the color histograms of two frames. If the difference is below a threshold, the frames have similar distributions and likely belong to the same shot. 3. It was tested on a video and able to accurately detect most abrupt shot boundaries and reduce the total number of frames, though it may miss some gradual shot transitions. The method is simple and fast but could be improved to better handle
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Shot Detection Using Histogram

Comparison and Image Substraction


Tran Quang Anh, Pham The Bao, Tran Thuong Khanh, Ngo Da Thao
University of Science, Vietnam National University in Hochiminh city
227 Nguyen Van Cu, District 5, Ho Chi Minh City, Vietnam

Abstract: detection based on color histogram differences in


In multimedia and video processing, the shot which the color histogram differences and smooth
detection is an important problem, especially in shot boundaries are analyzed by temporal color
video retrieval. Until now, there are several variation to enable the differentiation of abrupt shot
techniques to solve this problem, such as the method boundaries [3]. The others, Liu and Chen have
entropy based metrics [1], using gist [2], color proposed an algorithm for modeling temporal
histoggram [3], without threshold parameters [4] statistics using a novel eigenspace updating method.
etc… In this paper, we present a method based on The feature extracted fromthe current frame is
image subtraction and comparison of the image compared with a model trained from the features
histogram. The algorithm is simple and fast obtained in the previous frames. A shot boundary
convergent and can be acceptable with cut detection. isdetected if the new feature does not fit well to the
1. Introduction existingmodel. The model is based on principal
Video shot boundary detection is an important componentanalysis (PCA), or the eigenspace
problem in video processing. In fact, the number of method, in which theeigenspace can be updated to
frames of a video is huge. One video can have capture the non-stationarystatistics of the features
several hundred thousands of frames. The sequence [5].
of a video may have similarity continuous images In this paper, we proposed a novel method
during a short time interval t. If considering a frame combining between image subtraction and
as an image, we can not process all frames of a histogram comparing. With a low complexity, this
video because it costs a long processing time. A shot method detects cut shot boundary efficiently.
in a video is a sequence of frames taken 2. Image Subtraction
continuously by one camera [2]. Shot boundary is The idea of this method is based on
the transition frame between two continuous shots. characteristics of the video: two frames in the same
Thus we can process these shots in lieu of all the shot have huge similarity. So, without much change
frames.
in the texture image, each pixel ( x i , y i ) of a frame
The basis of any shot boundary detection
method consists in the detection of the visual A, is equivalent to the pixel ( x i , y i ) of a frame B.
discontinuities in the time domain. During this We measure gray different of two images by using
process, it is required to measure the degree of α =¿ A ( i , j )−B (i, j)| (1)
similarity between frames in a given shot. There Consider the images given in Fig. 1, from the
exist different methods proposed to solve this gray level difference of the two images, we can
problem. The most common methods are based on construct imageC using of the subtraction
color histogram. Mas and Fernandez [3] have operation given in (2) .
presented a method for video shot boundary
α , if α > б 1
C ( i , j )= {
255 , o therwise
(2)

(c) (d)

(a) (b)

(e)
Figure 1: A result of image subtraction of video
“Kungfu”: (a) frame 40;
(b) frame 50; (c) gray image from (a); (d) gray image
from (b); (e) result image of subtraction.

Then, we have a result image. Based on gray


scale of this image, we can say A and B may be of a

same scene. If ∂<б 2 , with ∂ is rate of gray scale in


result image, б 2 is the threshold.

N
∂= (3)
M
With N is the number of pixel having value
between 1 and 254. M is total number pixels of
image.
The advantage of this method is that the cut
shot can be identified quickly and accurately.
However, the change or movement of objects
creates differences in the texture image so much.
Thus, the disadvantages of this method arethe
surplus detection and we can not dissolve the shot
transform in video. So, the next additional
processing method will assist us in better detecting (a)
the dissolve shot and the error in detection by
change in texture.
3. Histogram comparison
Histogram of gray image is a chart that
describes the distribution of gray level of an image.
The horizontal axis describes the values of gray
level, while the vertical axis describes the number of
pixels at a particular gray level.
Histogram comparison is an operation that
measures the similarity level between two
histograms. If a value of similarity is lower than an (b)
assumed threshold, then we can conclude that the Figure 2: (a) histogram of figure 1.c, (b)
histogram of Figure 1.d
two corresponding histograms are similar.
Defining the rate of gray level in image A as In Fig. 2, we can compare two histograms

ni obtained for the images of figure 1.c and figure 1.d,


p A ( i )= (4) they have high degree of similarity. Thus frame 40
n
With i is the ith gray level of histogram and ni is and frame 50 can be classified as in the same scene.
4. Experiment
the number of pixels at the i th gray level. n is the
To evaluate the validity and efficiency of our
number of pixels in the image.
proposed method, the video “Year One” is
We can compare the two histograms of two
employed. This video consists of 143188 frames.
images by using
Matlab programming language (Version 2009 a) is
α =∑| p A (i )− p B ( i )|(5) used to implement our algorithm. The format of
With i[ 1, 256]. If α >б 3 ,б 3 is threshold, video file is AVI.
frames A and B have high degree of similarity. We After taking the statistics of several processing
can thus conclude that A and B are in the same times, we can set the thresholds б 1 =10 ,б 2=0.6
scene. Otherwise, A and B belong to two separate
,б 3 =0.125. We can thus reduce the video tp
two scenes.
about 816 shots. The total detection time to detect
is longer than three hours. We can thus observe and
recognize that this method can detect accurately the International Conference on Image Processing, vol
abrupt shots, and it reduces the number of surplus 3, Issue 24-28, June 2002.
detection. [2] HueihanJhuang, SharatChikkerur, Video Shot
5. Conclusion Boundary Detection Using Gist, Proceeding of
The subtraction and comparison of the frames TRECVIDWorkshop, 2002.
of the images method proposed in this paper is fast [3] Jordi Mas, GarielFrenadez,Video shot boundary
and simple with accurate detection of cut shot and detection based on color histogram, Proceedings of
some dissolved shot. However with the change of the TRECVid Workshop, Gaithersburg, Maryland
the intensity of the image background, this may USA, 2003.
alter the distribution of the image histogram. Thus [4] Koumaras, Gardikis, Pallis, Kourtis, Shot
the histograms of the two frames in a shot may be boundary detection without threshold parameters,
different from the color histogram. For that reason, Journal of Electronic Imaging (JEI), SPIE, IS&T,
the method may face some difficulty and may Vol.15, No.2, April 2006.
produce some errors in the detection. To overcome [5] Xiaoming Liu, Tsuhan Chen, Shot boundary
this problem, one must find some alternative detection using temporal statistics modeling, Proc.
technique to overcome the problems of different IEEE International Conference on Acoustics,
level of the brightness background of the video, Speech, and Signal Processing, Orlando, FL, USA,
for example defining the lowest level of May, pp.3389-3392, 2002.
background of the image, then a subtraction of this [6] Yusoff Y, Christmas W, Kittler J. Video shot
base level to obtain the histograms. cut detection using adaptive thresholding,
Proceedings of the 11th British machine vision
REFERENCE conference, University of Bristol, September 11-
[1] Cernekova, Nikou, I Pitas, Shot detection in 14, 2000.
video sequences using entropy based metrics,

You might also like