background-subtraction

Opencv Motion detection with tracking

喜夏-厌秋 提交于 2019-12-03 13:25:20
问题 I need a robust motion detection and tracking in web cam's video frames. The background is always the same. The aim is to identify the position of the object, if possible without the shadows, but not so urgent to remove shadows. I've tried the opencv algorithm for background subtraction and thresholding, but this depends on only one image as a background, what if the background changes a little bit in brightness (or camera auto-focus), I need the algorithm to be strong for little changes as

Laplacian of Gaussian: how does it work? (OpenCV)

纵然是瞬间 提交于 2019-12-03 05:54:19
Does anybody know how does it work and how to do it using OpenCV? Laplacian can be calculated using OpenCV, but the result is not what I expected. I mean I expect the image to be approximately constant contrast at background regions, but it is black, and edges are white. There are a lot of noise also, even after gauss filter. I filter image using gaussian filter and then apply laplace. I think what I want is done by a different way. Laplacian of Gaussian is an edge-detection filter; the output is 0 in constant ('background') regions, and positive or negative where there is contrast. The reason

How to use cv::BackgroundSubtractorMOG in OpenCV?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 05:46:18
I'm using OpenCV2.2 to implement moving objects detection with the method of Background Subtraction. And I use the Gaussian Mixture Model(GMM) method to model the background reference image. I directly get the foreground pixels(or foreground mask) by using the class cv::BackgroundSubtractorMOG provided in OpenCV2.2. It's convenient but the foreground mask returned by cv::BackgroundSubtractorMOG is not as good as I expected. In addition, it seems that cv::BackgroundSubtractorMOG performs poorer than the method of GMM wrote in C language provided in OpenCV1.0. The following is my code in OpenCV2

Background subtracting in MATLAB

大城市里の小女人 提交于 2019-12-01 05:47:52
I'm looking to do background subtracting on an image. I'm new to MATLAB and new to image processing/analysis, so sorry if any of this sounds stupid. 1) Other than imsubtract() are there other ways to do background subtracting (besides comparing one image to another)? 2) In the Math Works explanation for imsubtract() why do they make their structuring element a disk? This seems rather difficult so far because every time I try something, I end up not only subtracting the noisy background but also losing the parts of the image I want to look at! What kind of image do you work with? Background

OpenCV Android Background Subtraction

[亡魂溺海] 提交于 2019-11-30 13:45:15
I am working on a robotics project using an Android phone as the main processor and the camera to detect movement. I got the Android binary package from OpenCV and got it correctly installed. I can capture images using the OpenCV native camera and display them to the screen. I'm having problems using the background subtraction class, though. I can make a new BackgroundSubtractorMOG object in the constructor, but when I attempt to run the code below, it force quits I get the error "Only 1- and 3-channel 8-bit images are supported in BackgroundSubtractorMOG" from the native code. I tried

OpenCV2 Python createBackgroundSubtractor module not found

瘦欲@ 提交于 2019-11-30 08:33:53
I am trying to use cv2.createBackgroundSubtractorMOG2 () method in Python. I have tried both on my Mac and on my Raspberry Pi, and get the same error when running the following line of code: fgbg = cv2.createBackgroundSubtractorMOG2() The code I am using is taken from https://github.com/abidrahmank/OpenCV2-Python-Tutorials/blob/master/source/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.rst I get the following error when running this code: fgbg = cv2.createBackgroundSubtractorMOG2() AttributeError: 'module' object has no attribute 'createBackgroundSubtractorMOG2' I can't seem to

OpenCV: how to use createBackgroundSubtractorMOG

断了今生、忘了曾经 提交于 2019-11-30 06:25:00
问题 I was trying to go through this tutorial på OpenCV.org: http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html#background-subtraction The MOG pointer is initialized as Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor and in main, it is used in the following manner: pMOG = createBackgroundSubtractorMOG(); However, this yields the following error: Error: Identifier "createBackgroundSubtractorMOG" is undefined Also, when the background

Median variance in background subtraction

主宰稳场 提交于 2019-11-29 11:52:13
I am facing some issues in implementation of the paper Statistical Background Subtraction for a Mobile Observer . Question 1 : In Section 4.1, it talks about "... the median variance is computed over the entire image from the first components ..." I am confused what the authors actually mean by this. According to Stauffer & Grimson 's paper Adaptive Background Mixture Models for Real-Time Tracking(1999), for every background model a variance gets initialized (say with value 36) and then it gets updated for each pixel. Should the median of the first model's variance across all the pixels for

OpenCV2 Python createBackgroundSubtractor module not found

南笙酒味 提交于 2019-11-29 11:29:51
问题 I am trying to use cv2.createBackgroundSubtractorMOG2 () method in Python. I have tried both on my Mac and on my Raspberry Pi, and get the same error when running the following line of code: fgbg = cv2.createBackgroundSubtractorMOG2() The code I am using is taken from https://github.com/abidrahmank/OpenCV2-Python-Tutorials/blob/master/source/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.rst I get the following error when running this code: fgbg = cv2.createBackgroundSubtractorMOG2

Otsu thresholding for depth image

偶尔善良 提交于 2019-11-29 01:35:33
I am trying to substract background from depth images acquired with kinect. When I learned what otsu thresholding is I thought that it could with it. Converting the depth image to grayscale i can hopefully apply otsu threshold to binarize the image. However I implemented (tried to implemented) this with OpenCV 2.3, it came in vain. The output image is binarized however, very unexpectedly. I did the thresholding continuously (i.e print the result to screen to analyze for each frame) and saw that for some frames threshold is found to be 160ish and sometimes it is found to be 0. I couldn't quite