title: Foreground Extraction
body: <p>I am doing some work regarding tracking a person, I am using this <a href="http://www.iro.umontreal.ca/%7Elabimage/Dataset/" rel="nofollow noreferrer">dataset</a>. I am trying right now to extract foreground using background subtraction method i.e. <a href="http://en.wikipedia.org/wiki/Background_subtraction" rel="nofollow noreferrer">Mean Filter</a></p>
  <p>My background is like</p>
  <p><img src="https://i.stack.imgur.com/UvS5R.jpg" alt="Background" /></p>
  <p>and if I try to subtract my current frame like this</p>
  <p><img src="https://i.stack.imgur.com/Cgn1E.jpg" alt="enter image description here" /></p>
  <p>so after subtraction I am getting image like this</p>
  <p><img src="https://i.stack.imgur.com/vXHwQ.jpg" alt="enter image description here" /></p>
  <p>and after thresholding of <em>0.15</em> or <em>38</em></p>
  <p>I get this mask</p>
  <p><img src="https://i.stack.imgur.com/9yDBT.jpg" alt="enter image description here" /></p>
  <p>So if you notice this mask, it is splitting this foreground in to two pieces because of occlusion of person and chair. I dont know how to solve this problem. Any suggestions?</p>