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
2
votes
1 answer

frame subtraction in video

I am trying to do Frame subtraction in a video.Steps I am following Get a image , convert it into grayscale. Subtract it from previous frame grayscale. All I see in diff2(and diff also) a complete black image.One observation I made is that pixel…
jokeroor
  • 63
  • 1
  • 5
2
votes
1 answer

How to use BackgroundSubtractorMOG2 for images

I am pretty new to OpenCV and I am stuck at the moment. I am dealing with images, not a video. Since I will have same background in my project, I thought it would be easier to work, if I could remove my background. But first, I have to ask one…
massakrienen
  • 266
  • 2
  • 3
  • 14
2
votes
1 answer

Best approach to detect people in a STATIC camera images ( not using video stream ) - HOG, Haar, BackgroundSubtract in OpenCV?

So I am planning on implementing human detection static camera images - the camera never moves but the lighting conditions do change. Humans can be upright or could be sitting. Question: What would be better in this case to detect people in such…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
2
votes
2 answers

Dynamic background separation and reliable circle detection with OpenCV

I am attempting to detect coloured tennis balls on a similar coloured background. I am using OpenCV and C++ This is the test image I am working with: https://i.stack.imgur.com/yXmO4.jpg I have tried using multiple edge detectors; sobel, laplace and…
Byron
  • 21
  • 3
2
votes
2 answers

Face detection after background substraction using openCv

I'm trying to improve face detection from a camera capture so I thought it would be better if before the face detection process I removed the background from the image, I'm using BackgroundSubtractorMOG and CascadeClassifier with…
Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96
2
votes
1 answer

how to use matlab vision.ForegroundDetector with webcam

How to use matlab vision.ForegroundDetector with webcam instead of input video file. hsrc = vision.VideoFileReader('viptraffic.avi','ImageColorSpace','Intensity','VideoOutputDataType','uint8'); hfg = vision.ForegroundDetector(... …
Majid
  • 638
  • 6
  • 21
2
votes
3 answers

Vehicle Counting Based on BackgroundSubtractorMOG

I'm working on a project called ATCS(Automatic Traffic Controller System), it will modify traffic light duration based on the vehicle amount in front of the traffic light. I used openCV and backgroundsubtractorMOG to detect vehicle, it runs…
2
votes
2 answers

best option for background subtraction using emgucv?

can you suggest a good option for background subtraction using emgucv? my project is real time pedestrian detection.
ranzan
  • 51
  • 2
  • 6
2
votes
1 answer

Clear BackgroundSubtractorMOG2

I have the following code. cv::VideoCapture capture; cv::Mat image; cv::Mat foregroundMask cv::BackgroundSubtractorMOG2 backgroundModel; // update background model for(int i = 0; i < 10; ++i) { capture >> image; backgroundModel(image,…
guneykayim
  • 5,210
  • 2
  • 29
  • 61
2
votes
3 answers

Background subtraction using Emgu CV

How can I implement background subtraction using Emgu CV?
ranzan
  • 51
  • 2
  • 6
2
votes
2 answers

How can I remove background from an (video)image using OpenCV and Java?

I just started learning OpneCV and started my project in Java. As Java wrapper of OpenCV is released recently, there isn't much documentation available. I am trying to separate the background and foreground from video captured through webcam. I…
Prazzy Kumar
  • 994
  • 1
  • 11
  • 16
2
votes
3 answers

Algorithm for Background subtraction

I am trying to implement a simple background subtraction method for the detection of moving objects in a particular scene. The objective is to kind of segment out a particular motion out of a video to use it in another video. The algorithm i am…
Soumyajit
  • 435
  • 1
  • 9
  • 19
2
votes
2 answers

Remove Shadow from Extracted Foreground

I'm newbie with OpenCV + C++ + Visual Studio 2012. And now I need to learn them. Here's the code for background substraction/foreground extraction, and I need to remove the shadow from the foreground, and include them into background model. …
2
votes
2 answers

Using time in OpenCV for frame processes and other tasks

I want to count the vehicles from a video. After frame differencing I got a gray scale image or kind of binary image. I have defined a Region of Interest to work on a specific area of the frames, the values of the pixels of the vehicles passing…
2
votes
1 answer

Scientific image processing (in ImageJ) - advice for removing background

I have a bunch of movies of bacteria splitting, and I'm supposed to track them down and detect the splits and so forth. Now, I'm a newbie to this area, so I'm looking for initial advices on how to proceed. I have attached several screenshots. For…