extract the difference betwwen 2 images

2 views (last 30 days)
Hello, i want the difference between 2 image and get this difference this picture show what i want
Walter Roberson
Walter Roberson on 6 Dec 2015
Unless this is two examples of obtaining the difference of two images, with there being two constant-background images available that are not shown here?

Sign in to comment.

Accepted Answer

Dima Lisin
Dima Lisin on 7 Dec 2015
What you are looking for is background subtraction. It is not really as simple as taking the difference between the two images. If you have a video taken with a stationary camera, then you can detect moving objects using the vision.ForegroundDetector object from the Computer Vision System Toolbox. See the Motion-based Multiple Object Tracking Example for more information.
Walter Roberson
Walter Roberson on 7 Dec 2015
That is what that example code does. Look at the example code setupSystemObjects() and see how it uses a vision video file reader to open a video file.
The example code detects the differences between frames and uses them to track moving objects.

Sign in to comment.

More Answers (0)


Find more on Computer Vision Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by