how to detect and capture scene change in a recorded video

I have a project to detect and capture scene change in a recorded video.Actually its a recorded video of a godown (of about 2 weeks) and I have to detect and capture pic whenever someone comes in.

I have tried vlc player motion detector. It detects changes very well but does not capture the detected scenes. Is there any way that can help?

thanks and regards

• – Vadzim Jun 14 '18 at 20:52

You may use Low Rank Models for Video Background Subtraction as a pre processing.
Once you leave out the background even simple methods will do to discern any motion.

Assumptions

You need a simple solution that does not need too much computation and is simple to implement in many languages.

Suggested solution

You could simply

• subtract consecutive images (i.e. temporal derivation). Alternatively, if you are worried about detecting slow motions, subtract images that are a few seconds apart.
• square the resulting image
• sum over all pixels

If no motion is present, two consecutive images are very similar. Hence, you would have a constantly low value in the sum over all pixels coming from noise.

If there is motion, you would have a peak in the sum over all pixels.

You could also do the same via the histogram: If your image changes, the histogram is likely to change.

I am assuming that you are talking about video types like surveillance and about scene cut detection. I can think of two approaches:

(A)

• Do a DCT of two frames for comparison,
• low pass filter each frame,
• subtract the frames from each other,
• look at what is left over (use a threshold, if needed).

(B)

If you are able to decode the video you can have a look in the frame structure, calculate the gradient of bytes for each pixel between two frames. Note that the size depends on the frame type.

Some CCTV cameras have the function which record only when the motion occurs.

If you want to do your project by yourself, look Surveillance recording.
This example use Matlab to detect the motion energy from video. Then the program records only interesting frames. You can set the threshold for minimum motion you want.

There is a software from safeware: SafeMotion. http://www.safeware.ca/support.php It worked pretty well for me. Perhaps it will solve your problem. Safemotion is a helpful program that enables you to export all the videoparts with movement. Moreover you can define zones in which movement should be detected and you can adapt the size of the moving object and the sensitivity. Just used for analysing mice behaviour videos, to not watch the sleeping scenes.

Another possibility is webcam zone trigger, yuo can detect motion in videos or from a connected camera. You can also define zones and a procedure to be executed like taking a picture or starting a video.

You can check the source code of ready-to-use project for this goal at https://github.com/Breakthrough/DVR-Scan and https://github.com/Breakthrough/PySceneDetect.

Some tutorial links can be found in https://stackoverflow.com/questions/3273196/python-scene-change-detection.

There are several things that can be done:

• look at the PySceneDetect https://pyscenedetect.readthedocs.io/en/latest/ a python library for detecting scene changes in videos and splitting the video.

• look at the article: "A Robust Scene-Change Detection Method for Video Segmentation"