title: How to mask part of an image in matlab?
body: <p>I would like to know how to mask part of an image that is in BLACK &amp; WHITE ?</p>
  
  <p>I got an object that needs to be edge detected, but I have other white interfering objects in the background that are below the target objet ... I would like to mask the entire lower part of an image to black, how can I do that ?</p>
  
  <p>Thanks !!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I also want to mask some other parts (top part) ... how can I do that ?</p>
  
  <p>Please explain the code because I really wnat to learn how it works and implement it in my own understanding.</p>
  
  <p><strong>EDIT2</strong></p>
  
  <p>My image is 480x640 ... Is there a way to mask specific pixels ? for example 180x440 from the image ...</p>