Identifying and marking image regions

3 vues (au cours des 30 derniers jours)
Jeff
Jeff le 25 Avr 2013
Hello all,
I have an image (original.png) that I need to separate regions where there are and are not these white dots. The final image should look something like (final.png).
I've tried playing with some image processing functions but because the spaces between the dots is so large relative to the size of the dots I can't find an effective way of filling in the spaces.
  3 commentaires
Image Analyst
Image Analyst le 26 Avr 2013
There is no need for the Canny edge detector in that algorithm.
Cedric
Cedric le 29 Avr 2013
Looking at your image with the convex hull .. it's worth what it's worth, but in a totally different context (GIS), I would build a buffer around points that I would dissolve, remove interior polygons, and clip with the convex hull.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 26 Avr 2013
Modifié(e) : Image Analyst le 26 Avr 2013
There are at least four ways that I can think of. One is to to an imclose() with a really big kernel - big enough so that the dots connect. Then use bwboundaries to find the "envelope."
The second way is to use alpha shapes: http://cgm.cs.mcgill.ca/~godfried/teaching/projects97/belair/alpha.html. The File Exchange has submissions on alpha shapes, as well as snakes, active contours, balloons, or whatever you want to call them.
The third way is to use a "restricted" convex hull - something I've been after the Mathworks for years to add. I have a inefficient demo of that if you're interested. Basically it's kind of like the convex hull but it only looks within a certain distance to find convex points, so it has the effects of going into the little bays, nooks, and crannies more. So you'll get something like you showed in the red line, whereas a standard convex hull is just like you wrapped a rubber band around the points so that you will have no following of the points into bays.
The fourth way might be to calculate the Euclidean Distance transform with bwdist() and then threshold. I haven't tried this (just thought it up now) but it might work.
  4 commentaires
Jeff
Jeff le 2 Mai 2013
Thanks for your help Image Analyst. I have a follow-up question. How would I go about smoothing the borders that I made. So in this image, is there a way to make the borders a little smoother?
Thanks
Image Analyst
Image Analyst le 2 Mai 2013
You could try splines with extra, smoothed coordinates in between. Run my demo: http://www.mathworks.com/matlabcentral/answers/73917#answer_83836

Connectez-vous pour commenter.

Plus de réponses (1)

Sean de Wolski
Sean de Wolski le 25 Avr 2013
The concave hull is by definition ill-defined without some other knowledge.
See this thread for more information and specifically Steven Lord's reply:

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by