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

Which background substraction methods I should follow?

I have a college work which I have a short video to cut the background off (keeping only what moves in the scene) with three differente method, Fixed Background or Fixed Fundus Average background or average fundus Median background or median…
HelloWorldd
  • 172
  • 2
  • 14
0
votes
0 answers

How to find the pixel coordinate of difference from the output image got from background subtraction

I have two input images, i have subtracted tow images using background subtraction. How to get the exact coordinates of the difference on the output image? this is the code i m using from geekseek sub = cv2.subtract(image1, image2) For…
KPB
  • 21
  • 1
  • 2
0
votes
0 answers

Why Foreground Detection give me inconsistent detection?

I have a problem while running this foreground detection code from this website this is my code (i did slight change, to fit the latest opencv version): import numpy as np import cv2 import keras from keras.preprocessing.image import…
0
votes
2 answers

Substract rows in array without loops

How can I subtract two rows in python numpy? without using loops for example: import numpy as np x = np.array([[2.2, 3.4, 5.2], [1., 5.4, 5.]]) # expected result: y = [[-1.2, 2., -0.2]]
0
votes
1 answer

how to cache Background subtraction data for later usage?

background subtraction methods in OpenCV usually take a while to get the foreground correct. is there any way to cache data of these methods and use them later? (preferred in Python)
Anthraxff
  • 148
  • 1
  • 13
0
votes
0 answers

Opencv with rtsp source and backgroundsubtractor

I have a doubt with opencv and the backgroundsubtractor. I'm using the next code: int main(int argc, char** argv ) { VideoCapture cap(0); if(!cap.isOpened()) { cout << "aaaa" << endl; return -1; } …
sej
  • 46
  • 4
0
votes
1 answer

Remove Background from Image having a fixed background

I am trying to remove a fixed background from an image with a single free-falling object. The image has a single free falling object and it has a white background with a circular patch in the middle. Below is my code for the above task. I have used…
Neil
  • 59
  • 1
  • 7
0
votes
0 answers

OpenCV more efficent background subtraction solution

There is a scenario that I have to identify round/oval marks that are placed on the tiled floor. I tried to use the following background subtraction algorithms that are inbuild with OpenCV separately. filter1 =…
0
votes
1 answer

Background detection in a single image

I am writing a code in which I require subtraction of the background part of a single image. All the methods demonstrated online are for video files. Is there any way of subtracting the background when we have only a single image available? For…
0
votes
1 answer

Centroid tracking for background subtracking with python-opencv

I am doing object tacking using backgoundsubtraction and i applied this tutorial https://www.pyimagesearch.com/2018/07/23/simple-object-tracking-with-opencv/ for live stream video its giving output properly. but when i gave sequence of image frames…
rithvik36
  • 77
  • 2
  • 8
0
votes
0 answers

Make complete mask of foreground when using BackgroundSubtractorMOG2

I am using createBackgroundSubtractorMOG2 which makes a mask of moving object. However, I would like to have a complete segmentation. Currently, only regions around the boundary are white and parts inside are black. I tried various methods including…
0
votes
1 answer

How to circle moving objects using opencv?

I have a video file and I need to circle all moving objects in a certain frame I select. My idea of a solution to this problem is: Circle all moving objects (white areas) on a video on which was applied motion detector and circle the same areas on…
0
votes
0 answers

Background Subtraction for Static Images

I have a background image and another image with an object added. I am searching for methods to extract this object from the background by subtracting background. I am able to find only background subtraction method for videos, but not two static…
Sum-Al
  • 193
  • 1
  • 9
0
votes
1 answer

Where in my code have I broken the Mat equivalence rule?

I'm trying to achieve background subtraction in openCV 2.2 using the cv namespace (Qt4.7). I have the following code which compiles fine but when running the program breaks because one mat doesn't equal the other but I can't find out where it is and…
Dark Star1
  • 6,986
  • 16
  • 73
  • 121
0
votes
5 answers

Image processing..back ground subtraction

I have a sequence of images taken from a camera. The images consists of hand and surroundings. I need to remove everything except the hand. I am new to Image processing. Would anyone help me in regard with the above Question. I am comfortable using…