Midhun R
Midhun R

Reputation: 21

Aforge Blob Detection

How to detect Non Moving Blobs from a video?

Let's consider I have a video and a initial background frame bitmap. Is that possible to detect an blob/object which is NOT MOVING ? and draw a rectangle around that Object?

Upvotes: 2

Views: 3179

Answers (2)

adelriosantiago
adelriosantiago

Reputation: 8124

This reminds me of an algorithm to detect forgotten objects on a subway. If I'm not wrong you want to detect objects that are not moving AND that were not on the initial background right? You can apply this approach:

With an initial image like this (couldn't find a truly empty subway image):

enter image description here

And an image with an added static object (the waste can), the subway moving, and a person waiting, probably moving a little:

enter image description here

After a Image>ThresholdDifference (http://www.aforgenet.com/framework/docs/html/322123cf-39df-0ae8-6434-29cceb6a54e1.htm) we will get something like:

enter image description here

Note how the waste can appears along with other objects that were not there. If you apply this similar process several times, let say every 10 seconds and then a Image>Intersect (http://www.aforgenet.com/framework/docs/html/7244211d-e882-09b1-965d-f820375af8be.htm) you will end with something like this after a few minutes:

enter image description here

You can easily get the coordinates of this object with a Image>Connected Component Labeling (http://www.aforgenet.com/framework/docs/html/240525ea-c114-8b0a-f294-508aae3e95eb.htm)

Drawbacks of this approach:

  • Needs some time (minutes if you take a snapshot every 10 seconds, seconds for more frequent snapshots) to detect the objects.
  • Will take even more time to detect an object that has a similar color than the background, you can easily notice this drawback in the upper part of the can, which is also white, like the wall.

Upvotes: 2

Aliaaa
Aliaaa

Reputation: 1668

This is a solution that is in my mind and I'm not sure to works properly:

  1. run any pre-required filters and algorithms to be ready to blob detection.
  2. run the blob detection algorithm and save all the blobs in an array.
  3. find the center, and the area size of each blob.
  4. compare current frame blob's data with previous blobs (their center and sizes)
  5. if the changes was in acceptable range they are the unmoved blobs.

Upvotes: 0

Related Questions