title: Identification of the cell membrane in IF image
body: <p>I'm struggling against a very difficult problem. </p>
  
  <p>I've some images (immunofulorescence images) which represent some proteins and I need to identify the "external" membrane of these proteins. 
  The problem is shown in the images below. 
  The external membrane is represented by the red path in the image B and I have to identify it (the external membrane is not uniform but it has different thicknesses along the path) </p>
  
  <p><img src="https://i.stack.imgur.com/KkKuH.jpg" alt="enter image description here"></p>
  
  <p>I can't use a threshold because I've to include ALL the pixels inside the membrane (the threshold creates holes instead because some pixels inside the membrane have the same values of other pixels outside the membrane).</p>
  
  <p>I've tried to use the Canny's algorithm and a lot of edge detection algorithms but the results are not acceptable; they are not able to identify the membrane even if I try on a small part.</p>
  
  <p>I've tried another way.</p>
  
  <p>I've identified the external path using marching square.
  For each two points of the marching square I've find a segment normal two the segment defined by these two points. 
  I've analyzed the profile along these "normal" segments and for each profile I have chosen two points that contains the membrane (as in figure C).
  The result is not good because I can't cover all the membrane and it's not easy to anlyze the profile to decide where the membrane starts and ends.
  This is what I obtain:
  <img src="https://i.stack.imgur.com/lHqnx.png" alt="enter image description here">
  Can anyone suggest an algorithm or some idea to deal this problem?</p>
  
  <p>Other similar images:
  <img src="https://i.stack.imgur.com/Tlj56.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/PTu2e.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/mGrl7.png" alt="enter image description here"></p>