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

Foreign object detection code is working but along with foreign objects it detects missing object also. How to detect foreign object only

[https://drive.google.com/file/d/1fUH892Q6hbfDnoXF1G3-ZPe_rFPCamPn/view?usp=sharing] [https://drive.google.com/file/d/17ZiHIFTwMApmttT1HzDMasVGDgNlUJhM/view?usp=sharing]Actually I am working on foreign object detection using open cv python. I am…
1
vote
2 answers

Separating the leaf from it's background

I have a set of images, all of which look almost like this leaf here: I want to extract the leaf from the background, for which I used the GrabCut algorithm as used here. As a different approach, I also used thresholding based on ratios of r, g and…
1
vote
2 answers

OpenCV2 createBackgroundSubtractorMOG Attribute not found

I am using cv2 version 4.0.0 and python version 3.7.2. I am trying to subtract Background using this method cv2.createBackgroundSubtractorMOG2() and its working well. But when I use cv2.createBackgroundSubtractorMOG() its not working its showing me…
patelnisheet
  • 124
  • 1
  • 3
  • 12
1
vote
0 answers

OpenCV Background Model Component Extraction

I am working with the BackgroundSubtractorMOG2 class in OpenCV (Python), and am trying to extract the individual components of the background model. As I understand it, each pixel will be modeled by the mixture of a varying number of gaussian…
Jeremy
  • 71
  • 4
1
vote
1 answer

Grouping multiple bounding boxes

I am using background subtraction to detect movement on the screen then I use cvFindContours to detect contours when I use cvBoundingRect I get a lot of small rectangle this is due to background subtraction does not return smooth connected binary…
1
vote
0 answers

What is the best way to extract human bodies from static background?

I have used various techniques to human body extraction.There is a lot of way to detect human bodies and extract these bodies on videos but Every technique has their own disadvantages.How can i do the my best for human body extraction?If there ıs a…
my-lord
  • 2,453
  • 3
  • 12
  • 26
1
vote
0 answers

Shadow Removal in Traffic Lane Lines

I am working on lane lines detection. My current working strategy is: defining a region of interest where lane lines could be Warping the image to get a bird eye view Converting the image to YUV color space Normalizing the Y channel Fitting the…
1
vote
0 answers

What's the best idea to remove defferent backgrounds from images?

I want to convert this photo: to this one: And this photo: to this: And son on. I thought I can use color threshold but what if there are some pictures or content inside the photo? because I don't like to damage them and only want to remove the…
Hasani
  • 3,543
  • 14
  • 65
  • 125
1
vote
2 answers

Please explain what is the use of kalman filter in this tutorial

A guy posted this tutorial about object tracking using Kalman filter. Many people rated high star so it is not a fault/wrong tutorial. However, a guys posted the following question:" In this code you have done detection in every frame and this…
John
  • 3,888
  • 11
  • 46
  • 84
1
vote
1 answer

Save frames of background subtraction capture

I am doing a background subtraction capture demo recently but I met with difficulties. I have already get the pixel of silhouette extraction and I intend to draw it into a buffer through createGraphics(). I set the new background is 100% transparent…
iiyeo
  • 13
  • 3
1
vote
3 answers

How do I detect and remove blurred background from image

I have an image with its background blurred out. What I need to do is remove the blurred background and only keep the sharp foreground objects. Is their any way of doing this using openCV? The Image will be something like the one below. I need to…
prithul
  • 347
  • 3
  • 10
1
vote
1 answer

Background subtraction

I try to subtract using bitwise_and and BackgroundSubtractor but I have this error: OpenCV Error: Assertion failed ((mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1)) in cv::binary_op, file…
kuppy28
  • 25
  • 4
1
vote
1 answer

Opencv MOG2 Background substracting resut of stable video has many noise

I want to use this code fgbg = cv2.createBackgroundSubtractorMOG2(detectShadows=True) cap = cv2.VideoCapture('drunker-1.mp4') while True: grabed, img = cap.read() if not grabed: break ori = img.copy() gray =…
Alex Luya
  • 9,412
  • 15
  • 59
  • 91
1
vote
2 answers

background subtractor for opencv=3.1.0

//cv::BackgroundSubtractorMOG2 bg = cv::BackgroundSubtractorMOG2(); cv::Ptr< BackgroundSubtractorMOG2 >createBackgroundSubtractorMOG2(); bg.set("history", 1000); bg.set("nmixtures", 3); bg.set("backgroundRatio", 0.7); bg.set("detectShadows",…
sophie
  • 23
  • 1
  • 7
1
vote
0 answers

How do I simply use OpenCV BackgroundSubstration?

I'm quite new to OpenCV and having trouble using BackGround substration. I want to recognize the figure of a person, having a picture of the background and the same picture with the person. I tried the grab cut algorithm, the substraction also and…