title: Get masked pixels value OpenCV MOG2 Background Subtraction?
body: <p>How can we get Masked pixels while Background subtraction using the MOG2 algorithm in no extra time?
  Actually, we can get masked pixels using iterate over all pixels in the image but it requires a very large extra time</p>
  <p>But how we can get masked pixels in a list while background subtraction in Opencv JAVA for the stream of images</p>
  <p><a href="https://i.stack.imgur.com/31WYX.jpg" rel="nofollow noreferrer">1st Image</a></p>
  <p><a href="https://i.stack.imgur.com/H67VY.jpg" rel="nofollow noreferrer">2nd Image</a></p>