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

opencv background subtraction get color objects

I've used below tutorial to do background subtraction, http://docs.opencv.org/master/d1/dc5/tutorial_background_subtraction.html#gsc.tab=0 But using pMOG2->apply( frame, fgMaskMOG2 ) method return output as a binary image. Is there any method to get…
user957713
  • 31
  • 1
  • 5
0
votes
1 answer

OpenCV - Applying BGS + Blob detection to both counting pedestrians and vehicles in a video simultaneously ( Code provided )

So I am trying to plan the approach I want to take to count vehicles and pedestrians in a video. Here are my basic steps for the approach I want to take. Use background subtraction to distinguish between moving objects. Use cv2.SimpleBlobDetector…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
0
votes
1 answer

opencv3.0.0 BackgroundSubtractor::apply leads to "R6025 pure virtual function call"

I'm running the BackgroundSubtractor demo in opencv3.0-gold-release with vs2013, while the following error occurs when exiting the program: the callstack is as follows: cv3_bg_sub.exe!cv::MatAllocator::unmap(cv::UMatData * u) 行 62 …
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
0
votes
0 answers

Get good approximated segmentation mask within the detection rectangle

I want to get a fast and good approximated segmentation of my object within its detection box. How could I do that? I tried background subtraction algorithms and grab cut but they dont look that promising.
0
votes
1 answer

Using Local Binary Patterns with a Circular Mask

In order to extract texture-based features; LBPs (Local Binary Patterns) are used in many background-foreground detection algorithms. It is easy to understand why those features are tolerant against the illumination. However; there is one of their…
0
votes
0 answers

ERROR: Background Subtraction Coding Doesn't Functioning using openCV and VS2013

I had ran a coding for background subtraction from the video for offline. I used openCV 2.4.9 and Visual Studio 2013 to run the coding. The video can display and play but the problem is the coding for background subtraction does not functioning. Can…
0
votes
2 answers

Foreground detection without an image sequence

I need to detect the foreground object on an image and cut it off from that image. There are lots of background/foreground subtraction or object recognition algorithms but these algorithms are working on the videos or image sequences. I have only an…
0
votes
1 answer

Draw contours of detected objects using python and opencv

I am using opencv2.4.10 with python and I am trying to draw some contours of moving objects. Unfortunately I cannot figure out what am I doing wrong. First of all I use Background Subtractor from opencv (cv2.BackgroundSubtractorMOG2). It works…
Leopoldo
  • 795
  • 2
  • 8
  • 23
0
votes
1 answer

Error class BackgroundSubtractorMOG2 in OpenCV

I have same the problem like this topic BackgroundSubtractorMOG2 & OpenCV Before i use opencv 2.4.9, i have deleted opencv 3.0.0. And now when i use class BackgroundSubtractorMOG2 then i have this prolem. How can i resolve it. I'm using eclipse.…
Nick Viatick
  • 265
  • 1
  • 4
  • 19
0
votes
0 answers

How can I remove motion in continuous frame-to-frame subtraction with opencv

Background: Im pulsing an infrared IR LED on/off and capturing the images with an USB camera. For example: In the odd frames the LED is on and in the even frames the LED is off (I cant control in which frames it is on/off). Now Im subtracting the…
0
votes
1 answer

Paint detected objects OpenCV?

Background subtraction. MOG and MOG2 turned out to be unhelpful because they assume the first frame is the background. So I did frame by frame subtraction. like this My problem is to now paint the only the detected object white. Btw, I did try out…
user3041058
  • 1,520
  • 2
  • 12
  • 16
0
votes
1 answer

OpenCV Background Segmentation/Subtraction From Single Image

I'm looking for a bit of guidance... I have a single image of a passport photo. What I would like to do is separate the person and the background. I will then analyse the background colour, pattern, etc. I've done some research into segmentation and…
LKB
  • 1,020
  • 5
  • 22
  • 46
0
votes
0 answers

Background substraction using OpenCV MOG from live camera feed

I am studying OpenCV and I'm having a lot of fun, but now I'm stuck with a problem where I'm trying to use a background subtraction algorithm to detect any changes. I followed this tutorial and I managed to get it working to detect changes in a…
Linus
  • 1,516
  • 17
  • 35
0
votes
2 answers

Creating bigger image out of small image Mat [opencv, background subtraction]

I have an image i1. I am supposed to create another Mat m1 of size (image.rows*3, image.cols*3). In m1, I'm supposed to fill the pixel value in the following way. (Please do see the image): Here is my code- #include #include…
0
votes
1 answer

error in apply method in Background subtraction in opencv android

I want to do background subtraction on InputFrame, and want to return foreground mask. I am facing error as bellow can any one help me to fix it Thanks in advance My Code: package org.opencv.samples.tutorial1; import…