It sounds like you’re looking for a from a book (likely Practical Image and Video Processing Using MATLAB by O. Marques) — specifically one that is both implementable in MATLAB and relevant to the new/PDF edition.
: The book is available as a Hardcover , E-Book , and is accessible through professional learning platforms like O'Reilly . practical image and video processing using matlab pdf new
vision.ForegroundDetector (or a custom GMM from scratch) that updates pixel distributions over time.