title: How to remove straight lines from a Matlab image?
body: <p>I have a matlab image from a matrix named <a href="http://s000.tinyupload.com/index.php?file_id=04371474922222971816" rel="noreferrer"><strong><code>Two_dim</code></strong></a> as shown in the figure below. </p>
  
  <p>I would like to remove all 3 of the <em>bottom straight horizontal lines</em> from the image. I looked up on Stackoverflow to use <code>regionprops</code> to eliminate horizontal lines and obtained this code. But that doesn't seem to remove the lines. </p>
  
  <pre><code>rp = regionprops(Two_dim, 'PixelIdxList', 'Eccentricity', 'Orientation');
  rp = rp([rp.Eccentricity]&gt;0.95 &amp; (abs([rp.Orientation])&lt;2 | abs([rp.Orientation])&gt;89));
  Two_dim(vertcat(rp.PixelIdxList)) = false;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Z3gsW.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Z3gsW.jpg" alt="Noisy Image"></a></p>