Aforge Blob Detection

2019-05-28 10:27发布

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?

标签: c# blob Aforge
2条回答
兄弟一词,经得起流年.
2楼-- · 2019-05-28 10:55

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.
查看更多
Animai°情兽
3楼-- · 2019-05-28 11:00

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.
查看更多
登录 后发表回答