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
1
vote
0 answers

Remove background of image using Matlab

When the webcam captured an image I will to do the background subtraction. Next I will use the image that the background is already subtracted to find the red and green mean. But there is an error. The error says 'Index exceeds matrix dimensions'…
1
vote
1 answer

OpenCV C++, Define a background model

I am busy converting and interpreting software used in previous years of my final year project. I would just like to check if it is possible to define a background model in a header file, as i am currently getting an error. class…
James Mallett
  • 827
  • 4
  • 11
  • 27
1
vote
1 answer

Background subtraction And foreground detection using Kalman Filter

I need to separate the background from the foreground in a video using Kalman filter. Can somebody give me some resources or code examples to follow. Update: i've found a good example here Traffic detection.It worked excellent for Traffic detection…
1
vote
1 answer

Ring median filter in python

I want to implement a ring median filter - what it does is basically replace the center pixel by the median values of the pixels in a circular ring around it. I can make a circular mask of some radius like this kernel = np.zeros((2*radius+1,…
1
vote
2 answers

How to disable shadow detection in MoG2

I am using C++ and Opencv 2.3.1 for background subtraction. I have tried many times to change the parameters of Mog2 in order to disable shadow detection feature also i have tried what other people suggest on the internet. however, the shadow…
Zakarya
  • 492
  • 1
  • 6
  • 14
1
vote
1 answer

Please help me....I want to know how to code for background subtraction

I'm just getting started with OpenCV. I came across this question, and I'm trying to find where that code came from. Any ideas?
linetor
  • 11
  • 1
1
vote
0 answers

Unknown exception while using background subtractor

Im trying to implement BackgroundSubtractorMOG2 in opencv java. Im getting this exception from the apply method. Code: package com.java.opencv; import org.opencv.core.Core; import org.opencv.core.Mat; import…
Avinash S
  • 31
  • 1
  • 6
1
vote
1 answer

OpenCV background substraction + skin thresh to detect hand c++

I've been working on a project to detect the hand palm using only computer webcam and no equipments(no colored gloves to ease the detection). So far I've combined Skin detection and Background substraction, By using bitwised & between both…
Loading...
  • 21
  • 1
  • 3
1
vote
0 answers

Adaptive Background Subtraction to Obtain silhouettes

The following piece of code for background subtraction in videos does not work well with a video with vivid/adaptive background.(shows good result for some videos with steady/plain background) I get patched outputs rather than a silhouette. I am…
1
vote
0 answers

How to get foreground mask given background image

Say I have a background image bg and the current frame I, how can I get the foreground mask fgmask? Note: using the stander way fgmask = abs(bg-I) > th not giving an accurate result, lot of noise found. I'm aware of MOG2 function in opencv but the…
Ehab AlBadawy
  • 3,065
  • 4
  • 19
  • 31
1
vote
2 answers

Image processing with opening and closing using emgu 3.0, MorphologyEx, c#

How can I implement image processing with opening and closing using new emgu version? i found this one: www.stackoverflow.com/questions/11567350/opening-and-closing-using-opencv/ but i cant use "StructuringElementEx" anymore and the new…
Zeve
  • 23
  • 1
  • 6
1
vote
0 answers

How does the OpenCV code for the Mixture of Gaussian Algorithm determine a pixel is foreground?

I am trying to study the source code of the Mixture of Gaussian algorithm implemented in OpenCV 3.0 (the source code is in the contrib repository). I am focusing on the following code segment (retrieved from…
1
vote
2 answers

Background subtraction + MOOSE filter

I'm trying to create a camera with a raspberry pi to detect people moving in a corridor(here I'm assuming only things moving will be people) , and identify the ones who are spending too much time in the area (with the use of a timer) , I use…
1
vote
1 answer

BackgroundSubtractorMOG2 shadow detection is not working in sunny scenarios

I'm using the BackgroundSubtractorMOG2 background detection algorithm from OpenCV. Specially I'm interested in detecting and removing the shadows from the foreground. As per my experiments it works properly in cloudy scenarios but it fails in sunny…
rkachach
  • 16,517
  • 6
  • 42
  • 66
1
vote
0 answers

after background subtraction how to track certain object in masked area?

I have implemented background subtraction code and it works fine but after that how could I make use of the generated mask (to decrease the processing needed )to follow single object that I have its image before. I tried FAST with Flann matcher but…
Karam Abo Ghalieh
  • 428
  • 1
  • 5
  • 19