title: segmenting an object from background using MATLAB based on feature points
body: <p>I am working on image segmentation on a gray scale image using MATLAB. At present we have detected few edge points, which when joined together approximate to the shape of the object being detected. </p>
  
  <p>I need the help in separating out only the object from the whole image. The background, i.e. the non-object area can be made fully black or white.  </p>
  
  <p>Please give me some hints on where to start. </p>
  
  <p>It is possible to join each point with a line. How to translate the information in terms of those lines in classifying each pixel as belonging to object or background? </p>
  
  <p>An example image of lungs is shown here, where the Left lung is the object and is retained as it is. The background is completely black.</p>
  
  <p><img src="https://i.stack.imgur.com/Cj0rV.png" alt="enter image description here"></p>