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

Is there any GMM (gaussian mixture model) background subtraction implementation for pcl (pointcloud)?

I want to know if there is any implementation of GMM (Gaussian Mixture Model) for PCL library? Actually I have searched but I couldn't find any library or source code! The main idea is using this GMM technique to detect moving object's point cloud…
0
votes
0 answers

Background subtraction in opencv (Java)

I have a code in Java that detects my gloved hand (I wear a black glove) and moves the cursor according to my hand movements. But the issue is that it detects all the black objects in the background too. I want to use background subtraction…
NeonBlue
  • 1
  • 2
0
votes
0 answers

OpenCV: Background subtraction 0xC0000005: Access violation writing locatio

I am new to opencv and I am trying to use BackgroundSubtractorMOG2. But, i have a problem with access violation (I could not find a solution for this anywhere). I am not sure, if the problem is with my code? Please help!! THE PROBLEM: Unhandled…
Pratul Jn
  • 69
  • 8
0
votes
2 answers

cv2.createBackgroundSubtractorMOG2() error

Could anyone help me on this one? I'm trying for a background Subtracting method and used to perfectly run fine while using the cv2.BackgroundSubtractorMOG() method in previous opencv versions. import cv2 backsub =…
0
votes
0 answers

How to eliminate the so-called "ghost" pixels from the masks generated by mog algorithm?

when i run mog algorithm using visual studio, and processing image sequences and videos as well as streaming videos from camera some of the generated masks have ghost pixels that appear in all frames. I have tried to change the parameters of the…
Zakarya
  • 492
  • 1
  • 6
  • 14
0
votes
2 answers

Image segmentation based on optical flow

I am using c++,OpenCV library and in my software, I have estimated the optical flow in a video. Now, I want to group some moving objects, e.g. moving cars. I have used a dense optical flow algorithm (Farneback). My first thoughts so far are to use…
0
votes
0 answers

Opencv background subtraction wrong performance with many ghost pedestrians?

I am using the following piece of code to do background subtraction. import numpy as np import cv2 cap = cv2.VideoCapture('Desktop/001.avi') fgbg = cv2.BackgroundSubtractorMOG(100, 5, 0.3, 0.1) while(1): ret, frame = cap.read() fgmask =…
printemp
  • 869
  • 1
  • 10
  • 33
0
votes
1 answer

Unhandled exception at ... Access violation reading location

#include #include #include #include #include using namespace cv; using namespace std; int main(int argc, char** argv) { int…
0
votes
0 answers

Python program crashes on executing opencv code with videocapture in windows

i used the below code from http://docs.opencv.org/master/db/d5c/tutorial_py_bg_subtraction.html#gsc.tab=0 import numpy as np import cv2 cap = cv2.VideoCapture(0) fgbg = cv2.createBackgroundSubtractorMOG2() while(1): ret, frame = cap.read() …
Avinash S
  • 31
  • 1
  • 6
0
votes
0 answers

Issue with OpenCV BackgroundSubtractor

I am trying to use BackgroundSubtractor class of OpenCV in Java, which two sub-classes BackgroundSubtractorMOG2 and BackgroundSubtractorKNN and going subtract the background from a video stream frame, these frame are coming from Network IP camera in…
Bahramdun Adil
  • 5,907
  • 7
  • 35
  • 68
0
votes
0 answers

Error: Cannot allocate an object of abstract type in Qt Opencv

I am working on a simple background subtraction. Here is my code #include #include #include using namespace cv; using namespace std; //global variables int…
0
votes
1 answer

OpenCV Python: cv2.findContours Returns to many contours

I'm working with a little program which will use OpenCV + python's background subtraction to count cars. I'm fine with background subtraction, I already have a background image. But when I use cv2.findContours(fgmask.copy(), cv2.RETR_EXTERNAL,…
dccsillag
  • 919
  • 4
  • 14
  • 25
0
votes
0 answers

Subtracting background from image on iOS using OpenCV and BackgroundSubtractorMog2 Objective-C++

I would like to subtract a background of an image usine OpenCV on iOS with Objective-C++ and I am currently facing a termination due to memory issue, whenever I want to apply the BackgroundSubtractorMOG2 method to the input pictures. I was…
0
votes
1 answer

what is the best background subtraction algorithm for detecting vehicles in road traffic jam?

My problem is detecting vehicles. The camera is on traffic light stand facing downward with some degree. The problem is luminance, as the sun changes its position. So what background subtraction algorithm is robust for this situation? I only know…
0
votes
1 answer

Background Substraction with user input

I am looking for an algorithm or, even better, some library that covers background substraction from a single static image (no background model available). What whould be possible though is some kind of user input like for example…
roman
  • 11,143
  • 1
  • 31
  • 42