# Adaptive background subtraction with motionless objects

**URL:** https://discourse.processing.org/t/adaptive-background-subtraction-with-motionless-objects/14370
**Category:** Libraries
**Created:** [October 2, 2019, 3:10pm UTC](https://discourse.processing.org/t/adaptive-background-subtraction-with-motionless-objects/14370 "2019-10-02T15:10:09Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 4, 2019, 4:14am UTC](https://discourse.processing.org/t/adaptive-background-subtraction-with-motionless-objects/14370/3 "2019-10-04T04:14:49Z")

</div>

You may want to try using the opencv library to get a more robust background subtraction algorithm. It uses an “adaptive” algorithm – although depending on your goals you might want to drop the entire background subtraction thing and go with learning and object detection.

At any rate, the algorithm and its paper is described here:

[https://kyamagu.github.io/mexopencv/matlab/BackgroundSubtractorMOG.html](https://kyamagu.github.io/mexopencv/matlab/BackgroundSubtractorMOG.html)

…and it is built into the opencv processing library, an older example of a background subtraction sketch:

> **[Processing + OpenCV Background subtraction: save foreground images - CodeProject](https://www.codeproject.com/Questions/988992/Processing-plus-OpenCV-Background-subtraction-save)**
>
> Free source code and tutorials for Software developers and Architects.; Updated: 7 May 2015

I haven’t read it, but there might be a more updated discussion / example in this recent chapter:

> Chung B.W. (2017) “Understanding Motion.” In: Pro Processing for Images and Computer Vision with OpenCV. Apress, Berkeley, CA

---

_[View the full topic](https://discourse.processing.org/t/adaptive-background-subtraction-with-motionless-objects/14370)._
