Remove background and noise from image
Asked Answered
N

1

6

Im trying to remove the background from a video and get a binary images( or 8-bit) where value of the object that moves is 1 and static background is 0.

something like this:

enter image description here

at first I tried it with getting the difference absDiff() from running average accumulateWeighted() and the current frame but the result was not what I expected( only the edges was 1 and inside of the moving object was 0).

so I went for createBackgroundSubtractorMOG2 and createBackgroundSubtractorMOG but this is not good either( same problem ).

is there a way to get the whole moving object?

Notogaea answered 6/11, 2016 at 6:27 Comment(2)
I am interested in knowing the result on this. A thought you could try? What if you apply object tracking techniques to capture the moving object; you crop roi (detected object) and work with just that. Apply a threshold and see what turns out? do you think this might help?Noun
@Noun I used the mask from MOG2 to crop roi and it worked! tyNotogaea
U
0

The Mixture of Gaussians method is not going to solve all your problems. Common problem is sensitivity to light conditions, e.g. attaching shadow to extracted foreground object . If the image scenario (background) is roughly the same you can refine your results with some image processing.

If the background is similar as in attached image, try to build color histogram in HSI space, create image of extracted foreground object (not mask, actual colored image) and remove pixels that color is similar to the floor (technique known from skin detection methods). In that way you could remove some shadows attached to the person/objects.

Also, if real-time processing is not crucial in your application, you could use more sophisticated background/foreground detection like SubSENSE.

Unawares answered 6/11, 2016 at 8:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.