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

indentifier backgroundSubtractorMOG syntax error

Hello i am learning OpenCV motion detection program and currently i have this error saying 'syntax error:identifier BackgroundSubtractorMOG' Here is the code int main() { string file_name, video_out; Mat res, frameMOG, background, framegray,…
0
votes
2 answers

Best background substraction technique

In my latest project I am required to train a deep convolutional neural network to detect football players. The problem is that all my positive exapmles are extracted from 3-4 videos and the grass is almost the same colour in each one. I am looking…
0
votes
1 answer

Object Detection with moving camera

I understand that with a moving object and a stationary camera, it is easy to detect objects by subtracting the previous and current camera frames. It is also possible to detect moving objects when the camera is moving freely around the scene. But…
0
votes
2 answers

OpenCV how to replace cut out object with background

I have two images, one image which contains a box and one without. There is a small vertical disparity between the two pictures since the camera was not at the same spot and was translated a bit. I want to cut out the box and replace the hole with…
0
votes
2 answers

Wrong background subtraction

I'm trying to subtract the background of an image with two images. Image A is the background and image B is an image with things over the background. I'm normalizing the images but I don't get the expected result. Here's the code: a =…
inavas
  • 161
  • 7
0
votes
1 answer

OpenCV: Effective way to automatically set NoiseSigma in BackgroundSubtractorMOG

I'm trying to make a program that detects people in CCTV footage and I've made a lot of progress. Unfortunately, the amount of noise in the videos varies a lot between different cameras and time of day, so with each of the sample videos. This means…
Kieran
  • 73
  • 7
0
votes
1 answer

Background subtraction with reflective material

I am using background subtraction method to detect moving objects. Because their type in my experiment is reflective material object, so it causes difficulty for detecting. How could I resolve it? Thank you! EDIT: I'm using Background subtraction…
0
votes
0 answers

OpenCV MOG2 Background Subtraction strange result

When using the MOG2 bacground subtractor in OpenCV I am getting results that display parts of the background in foreground segmented regions of the output. I am processing a live camera feed. I am initialising with default paramaters and then…
Jack H
  • 2,440
  • 4
  • 40
  • 63
0
votes
1 answer

stabilized frame differencing using OpenCV abs() except for nonoverlapped areas

I have a sequence of frames of a moving camera. The frames have been stabilized. I want to calculate the frame difference between each two subsequent frames. I do it using diff = abs(frame1 - frame2); Frames are Mat objects. However, the two…
0
votes
1 answer

Roboust Human detection and tracking in a crowded area

I am working on an application where I need to detect and track people in a crowded indoor area(like a mall). Right now I am using the OpenCV Background Subtraction class(MOG2) to detect blobs and a Kalman filter and Hungarian Algorithm for…
0
votes
1 answer

Image background subtraction

I am working on a browser based application in which I will get an image. I will have to find the background and remove it if the background is simple. Like if the background is a solid color or gradient. I am considering two options -- 1) using…
0
votes
1 answer

Robust algorithm for detecting vehicles before stop line

I need to write a program that use a camera to detect presence of a vehicle inside a determined region on the road before stop line on the intersection (just like an inductive loop). Outputs will true or false based on the visibility of a vehicle…
SAMPro
  • 1,068
  • 1
  • 15
  • 39
0
votes
1 answer

OpenCV BackgroundSubtractor Android Motion Detector Error

When I try to make a motion detector app using openCV's BackgroundSubtractoeMOG2 (App will capture camera and draw contours around the detected motion), I get the Error while giving argument : MainActivity.java package…
user7199101
0
votes
0 answers

How to remove a specific background from a video (OpenCV 3)

I am relatively new to OpenCV. My program will have a fixed camera that will track insects moving passed it. I figured that this would mean that I could remove the background from the video. I have attempted to use the method (which I found in a…
liamw9
  • 527
  • 2
  • 6
  • 19
0
votes
1 answer

How to get background from cv2.BackgroundSubtractorMOG2?

Is there any way to obtain background from cv2.BackgroundSubtractorMOG2 in python? In other words, is there any technique to compute an image based on last n frames of a video, which can be used as background?