Questions tagged [background-subtraction]

Background-subtraction is a Computer-Vision technique that given a frame sequence from a fixed camera, processes pixels and separates them into foreground and background pixels.

Background Subtraction is a type of image segmentation which goal is to separate the parts of the image that are invariant over time (background) from the objects that are moving or changing (foreground).

The simplest techniques use frame differencing and more advanced techniques require using statistical methods. For example, a moving leaf of a tree would be considered foreground using simple frame differencing but with a proper statistical method it can be considered background as the leaf is always there, moving periodically.

Methods:

  • Frame differencing
  • Background as the average or the median of the previous nframes.
  • Background as the running average.
  • Pfinder (one Gaussian)
  • Mixture of K Gaussians
290 questions
4
votes
2 answers

OpenCV edge enhancement

I am performing background subtraction to obtain a moving car from a video as below ( Running average background modeling) I am applying findContours() after this to draw a polygon around the car. As you can see, the quality of the obtained output…
Madman
  • 309
  • 1
  • 5
  • 10
4
votes
1 answer

Top head detection from overhead camera

I have a camera set up on a ceiling , capturing people standing in line. I need to count the amount of people. Currently I do that with background subtraction and Hough transform. The detector works well for contrast heads, but if hair color is…
4
votes
1 answer

HOG Person Detector: False Positive detections on background subtracted images

I am working on a project which requires detection of people in a scene. Initially after running the HOG detector on the original frames a particular background object was being detected as a person on all the frames, giving me 3021 false positive…
4
votes
3 answers

OpenCv Blob/Contour labeling

Hi i have been working on this for a while and yet to have no good solution. I am reading a video frame by frame and am using background subtraction to ' identify the region where is there movement and use cvFindContours() to get the rectangle…
user43076
  • 671
  • 3
  • 10
  • 13
4
votes
1 answer

Compensate for Auto White Balance with OpenCV

I'm working on an app that takes in webcam data, applies various transformations, blurs and then does a background subtraction and threshold filter. It's a type of optical touch screen retrofitting system (the design is so different that…
antimatter15
  • 1,436
  • 1
  • 12
  • 18
4
votes
1 answer

How can I make openCV Backgroundsubtraction KNN algorithm last longer, tracking a foregound object which is not moving

I am trying to substract this building brick. . For that I am using the KNN algorithm provided by opencv 3.0. To initialize the background model I am using 40 frames without the brick. All in all it works pretty well. (Brick with Shadow) The only…
TruckerCat
  • 1,437
  • 2
  • 16
  • 39
4
votes
1 answer

Meaning of Parameters in BackgroundSubtractorGMG Algorithm in OpenCV 3.0

I am studying the GMG background subtraction algorithm as described in this paper. As OpenCV 3.0 also has an implementation of the GMG algorithm (as the additional package opencv_contrib), I try to study the two together. However, I am not quite…
4
votes
1 answer

How to save masks of videos in openCV2 python

I can capture a video from the webcam and save it fine with this code cap = cv2.VideoCapture(0) fgbg= cv2.BackgroundSubtractorMOG() fourcc = cv2.cv.CV_FOURCC(*'DIVX') out = cv2.VideoWriter('output.avi', fourcc, 20.0,…
SetSlapShot
  • 1,298
  • 1
  • 21
  • 48
4
votes
1 answer

How do I use BackgroundSubtractorMOG in OpenCV 3.0.0 with Java?

I'm trying to run BackgroundSubtractorMOG on a video file, but the javadoc (Version 3.0.0) says that I need to provide a long as an argument, while the online documentation (Version 2.4.9) says that the constructor requires either no argument, or…
4
votes
1 answer

OpenCV C++: How to slow down background adaptation of BackgroundSubtractorMOG?

I am using BackgroundSubtractorMOG in OpenCV to track objects. When they appear, it works fine but the background fastly adapts so I cannot track static objects. How can I make the background adaptation slower (I dont want it fully static, just…
user2212461
  • 3,105
  • 8
  • 49
  • 87
4
votes
3 answers

BackgroundSubtractorMOG2 & OpenCV

I'm trying to compile the simple example at http://mateuszstankiewicz.eu/?p=189 I'm running Ubuntu 12.10 64 bits.I use OpenCV 2.4.4a I compile using a makefile that does this : g++ background_subtraction.cpp -o background_subtraction…
Victor Lamoine
  • 389
  • 1
  • 2
  • 21
4
votes
3 answers

Is it possible to use ViBe algorithm, implemented in opencv, for systema without GPU?

I want to test ViBe algorithm for Background Subtraction. Currently I am using opencv libraries. I found out a sample implementation in opencv/samples/gpu/bgfg_segm.cpp and bgfg_vibe.cpp files. These files are under gpu module. Now I have a system…
sam18
  • 631
  • 1
  • 10
  • 24
4
votes
1 answer

opencv Function CvBGStatModel

I was just wondering how this function CvBGStatModel() works. I mean to say what is the algorithm used for this and how it gives better results compared to average and frame difference algorithms. Thanks in advance.
4
votes
2 answers

Easy, but not elementar background subtraction in opencv?

I have to make almost what is said in Efficient Background subtraction with OpenCV (Background subtraction with the foreground with colour except with a camera and not a video file). The problem is that in that topic there is no explanation on…
StinkyCat
  • 1,236
  • 1
  • 17
  • 31
3
votes
1 answer

OpenCV hand recognition?

After spending on a while on this, I finally managed to detect the hands through thresholding. The only problem is that VERY FEW pixels in the background remain, which will mess up the next step. Any suggestions on how to get rid of the few…
fdh
  • 5,256
  • 13
  • 58
  • 101
1 2
3
19 20