<p>Very nice work on boundary detection. I used to work on similar segmentation problems.</p>
<h3>Theory:</h3>
<p>Once you obtained your edge map where <code>e(i,j)</code> indicates the &quot;edge-iness&quot; degree of pixel <code>i,j</code> you would like a segmentation of the image that would respect the edge map as possible.<br />
In order to formulate this &quot;respect the edge map&quot; in a more formal fashion I suggest you look at the <a href="http://www.wisdom.weizmann.ac.il/%7Ebagon/pub/LargeScaleCorrClust_2011.pdf" rel="noreferrer" title="Bagon and Galun, large scale correlation clustering, arXiv 2011"><strong>Correlation clustering (CC)</strong></a> functional:<br />
The CC functional asses the quality of a segmentation based on pair-wise relations between neighboring pixels whether they should be in the same cluster (no edge between them) or in different clusters (there is an edge between them).<br />
Take a look at the example at section 7.1 of the <a href="http://www.wisdom.weizmann.ac.il/%7Ebagon/pub/LargeScaleCorrClust_2011.pdf" rel="noreferrer" title="Bagon and Galun, large scale correlation clustering, arXiv 2011">aforementioned</a> paper.<br />
CC is used for similar segmentation problems in medical (neuronal) imaging as well, see e.g., <a href="http://www.andres.sc/publications/andres2012globally.pdf" rel="noreferrer" title="Andres et al, Globally Optimal Closed-Surface Segmentation for Connectomics, ECCV 2012">here</a>.</p>
<hr />
<h3>Practice</h3>
<p>Once you convince yourself that CC is indeed an appropriate formulation for your problem, there is still the question of how exactly to convert your binary edge map into an affinity matrix that CC can process. Bear in mind that CC needs as an input a (usually sparse) adjacency matrix with positive entries for pairs of pixels assuming to belong to the same segment, and negative entries for pairs of pixels assumed to belong in different segments.</p>
<p>Here's my suggestion:</p>
<ol>
<li><p>The edges in your edge map looks quite thick and not well localize. I suggest a non-max supression, or morphological thining as a pre-processing stage.</p>
</li>
<li><p>Once you have a better localized edges, you ignore the &quot;edge&quot; pixels and only work with the &quot;non-edge&quot; pixels, lets call them &quot;active&quot;.<br />
Two active pixels that are next to each other: there is no &quot;edge&quot; pixel between them - they should be together. So the adjecency matrix for immidiate nieghbors should have positive entires.<br />
Consider three pixels on a line, with the two endpoints are &quot;active&quot; pixels: if the middle one is an edge then the two active pixels should not belong to the same cluster - the corresponding entries in the adjecency matrix should be negative. If the middle pixel is also active than the corresponding entries in the adjecency matrix should be positive.</p>
</li>
<li><p>Consider all possible neighboring pairs and triplets (inducing 24-connected grid graph) allows you to construct an affinity matrix with positive and negative entries suitable for CC.</p>
</li>
<li><p>Given a matrix you should search for the segmentation with the best CC score (optimization stage). I have Matlab code for this <a href="http://www.wisdom.weizmann.ac.il/%7Ebagon/matlab.html#LSCC" rel="noreferrer" title="Bagon, large scale correlation clustering - matlab code">here</a>. You can also use the excellent <a href="http://hci.iwr.uni-heidelberg.de/opengm2" rel="noreferrer" title="OpenGM - Discrete graphical models in C++">openGM</a> package.</p>
</li>
<li><p>The optimization will result with a partition of the active pixels only, you can map it back to the input image domain, leaving the edge pixels as un-assigned to any segment.</p>
</li>
</ol>
Image segmentation based on edge pixel map
<p>I have trained a classifier in Python for classifying pixels in an image of cells as edge or non edge. I've used it successfully on a few image datasets but am running into problems with this particular dataset, which seems pretty ambiguous even to the human eye. I don't know of any existing automated technique that can segment it accurately. </p>

<p>After prediction I obtain the following image: </p>

<p><img src="https://i.stack.imgur.com/9JMva.jpg" alt="Prediction image"></p>

<p>I am relatively new to image processing and am unsure with how to proceed with actually obtaining the final segmentations of the cells. I have briefly tried a few different techniques - namely Hough circular transform, level sets, skeletonization, contour finding - but none have really done the trick. Am I just not tuning the parameters correctly or is there a better technique out there? </p>

<p>Here are the correct outlines, by the way, for reference. </p>

<p><img src="https://i.stack.imgur.com/ijjnj.png" alt="Correct outlines"></p>

<p>And the original image:</p>

<p><img src="https://i.stack.imgur.com/urhGH.png" alt="enter image description here"></p>

<p>And the continuous probability map: </p>

<p><img src="https://i.imgur.com/reoh0pb.png" alt="Continuous probability map"></p>