edge merging

5 views (last 30 days)
Jürgen
Jürgen on 14 Jun 2012
Answered: Iago Lopez Grobas on 28 Apr 2020
Hello,
I am comparing different techniques for extraction grains from an image: one method that I want to test is using edge detection =>then fill the edge wit imfill and use regionprops to determine area, perimeter, centroid etc.
Now after some noise cleaning : edge(ImageFin1,'sobel') gives good results but the edge or broken at some places , so imfill does not work well.
http://imageshack.us/photo/my-images/269/testforupload.jpg/ (object labeled and plotted with centroid)
Now I was looking for some fast algorithms to connect the edge of the same grains, I could work with the fact that the centroid should be at a distance smaller than the average diameter of a grain , but that would be rather slow. I also tried some existing posts on edge linking like http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/LineSegments/drawedgelist.m but that algroithm does not make the connections, it only identifies edge, if I understood it correctly.
So two questions : does anybody knows a quick algroithm to connect the edges? e.g. by filling the in between pixels
or is there a way to join object based on their centroid, I mean how to join two seperately labeled objects to one object that can be assed bu regionprops
thanks for the help, time and effort in advance

Answers (2)

Elad
Elad on 14 Jun 2012
  1 Comment
Jürgen
Jürgen on 14 Jun 2012
Hi,
I 've looked at the function edgelink but that function puts all pixels that belong to one edge in a list, so you get a cell array of N edges that's cool but not exactly what I want, because I want to merge the edge that belong together. teh function mergeseg seemed promising but it merges only line segments and that's not my case.
Now one way to go would be to use the edgelist and calculate the distance form the extreme point to all other extreme point and connect those point.
but exactly it would be faster if I could use regionprops, centroid and calculated distances between the centroid and then merge the objects of which the centroid are close,
So exactly I would like an algorithm or a function that merges objects after labeling by bwlabel?

Sign in to comment.


Iago Lopez Grobas
Iago Lopez Grobas on 28 Apr 2020
Hello, do you have an answer to this now? it would be very helpful since I am having the same problem
thanks

Community Treasure Hunt

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

Start Hunting!