简体   繁体   中英

Matlab - background subtraction for motion detection

I am currently using vision.ForegroundDetector for motion detection. It returns the foreground image. Is there any way to also get the background image that it has learnt?

vision.ForegroundDetector does not really learn a background image. It learns a probability distribution over the intensities or colors for each pixel. You could, in theory, get the mean or the mode of each of these distributions and put them into an image, but vision.ForegroundDetector does not provide this ability.

You can use the bitwise operator, try to separate the foreground mask then remaining pixel would be your background.

You can also try cv2.absdiff() method for finding diff.

Thank You!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM