shot detection

hello,

i’d like to detect edits in videos. i understand that this is called ‘shot detection’ and that there is a fair amount of literature out there on it. has anyone implemented something like this in OF?

not that i know of, but it would be pretty straightforward:

difference frame 1 against frame 0
threshold
count white pixels
if >95% white (you’d have to tweak this figure) then frame 1 is a new shot relative to frame 0.

it would give false positives when something filled the frame momentarily (eg a car driving past the camera), and might fail when the background in each shot was similar (eg an A/B cut between two interviewees in the same room). but it would work as a start.

ah, just tried the same few days ago. did it also like damian describes but it didn’t work out for me – to much false positives and also the way around. Think a more robust way would be to use a histogram comparison – i.e. using cvCompareHist ( http://opencv.willowgarage.com/documentation/histograms.html?highlight=cvcomparehist#cvCompareHist ) … just don’t have the time at the moment, but maybe you can update me on the topic if you find a stable way.

best m9d

hi, I was wondering if anybody developed further on this subject?

usually it’s done with a combination of histogram (color comparison) and optical flow comparison (this roughly detects camera movement and camera movement change often indicates a scene change)