Note that there are some explanatory texts on larger screens.

plurals
  1. POpython separate round particles by offsetting contours / shrinking polygones
    primarykey
    data
    text
    <p>I'm new to python and stuck.. </p> <p>I want to make a python script that allows me to separate adjacent particles on an image like this:</p> <p><img src="https://i.stack.imgur.com/JPh65.png" alt="BEFORE"></p> <p>into separate regions like this:</p> <p><img src="https://i.stack.imgur.com/tePPD.png" alt="AFTER"></p> <p>I was suggested to use the watershed method, which as far as I understand it would give me a something like this:</p> <p><img src="https://i.stack.imgur.com/Jw95W.png" alt="Watershed in 3D"></p> <p><strong>EDIT</strong> <em>Actually found out that this is distance transform and not watershed</em></p> <p>Where I then could use a threshold to separate them.. Followed this <a href="https://stackoverflow.com/questions/11294859/how-to-define-the-markers-for-watershed-in-opencv/11438165#11438165">openCV watershed guide</a> but it only worked to cut out the particles. Was not able to "transform" the code to do what I want.</p> <p>I then took another approach. Tried to use the <a href="http://opencvpython.blogspot.in/2012/06/hi-this-article-is-tutorial-which-try.html" rel="nofollow noreferrer">openCV contours</a> which gave me good contours of the particles. I have then been looking intensively for an easy way to perform polygon offset in order to shrink the edge like this:</p> <p><img src="https://i.stack.imgur.com/Nup0i.gif" alt="Edge offset"></p> <p>Using the center from the offset contours (polygon) should give me the number of particles.. But I just haven been able to find a simple way to do edge offset / polygon shrinking with python.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload