
Dear Group, I'm trying to do object detecting on images as shown on the end of the post. I tried to adapt the coin example in the gallery but the results are not good. My problem is that both the background (bg) and the objects have large variations in there gray value. By the way, these are tiny little ice spheres (30-100 microns) A second approach was to do a laplace filter and threshold the result but even there, the variability is to big (see below). Well, before I change the measurement technique (change bg) or start working on sorting out which group of segments form a sphere, I thought, I better ask some adepts in image processing if there is an easier way. Thanks in advance! Siggi <https://lh3.googleusercontent.com/-PeS-7pVfM6Y/T0T09jyQD5I/AAAAAAAAADs/s3N1r...> <https://lh4.googleusercontent.com/-xhi_BdlNmS0/T0T5Mc56y8I/AAAAAAAAAD4/XRALl...>

Hi Siggi On Wed, Feb 22, 2012 at 6:37 AM, Sigmund <siggin@gmail.com> wrote:
I'm trying to do object detecting on images as shown on the end of the post. I tried to adapt the coin example in the gallery but the results are not good. My problem is that both the background (bg) and the objects have large variations in there gray value. By the way, these are tiny little ice spheres (30-100 microns) A second approach was to do a laplace filter and threshold the result but even there, the variability is to big (see below).
Could you describe what kind of information you'd like to extract from the image? A simple thresholding (foreground vs background), identification of individual objects, etc.? Stéfan

Hi Siggi. As I understand your task, you are trying to get bounding boxes for each ball. Is that correct? I am not so familiar with this kind of task but it seems to me a template matching approach could be good. If a gray-scale template doesn't work, maybe on the laplacian or the gradient? Cheers, Andy

Hi, like Andy suggested, I need the bonding box for each shear. This should represent the diameter in good approximation what leads to the grain size distribution. Thanks for your help! Siggi

Hi Siggi,
like Andy suggested, I need the bonding box for each shear. This should represent the diameter in good approximation what leads to the grain size distribution.
In this case I'd also agree with Andy that a template-matching approach might be best, with a library of templates of different sizes. Then for each template-match peak, determine which size template gives the best match, and read out the size distribution from that? Alternately, you could look at a Hough-circles sort of approach, and again could read off the size distribution straight from the Hough-transformed image. Zach

On Thu, Feb 23, 2012 at 10:02 AM, Zachary Pincus <zachary.pincus@yale.edu>wrote:
Hi Siggi,
like Andy suggested, I need the bonding box for each shear. This should represent the diameter in good approximation what leads to the grain size distribution.
In this case I'd also agree with Andy that a template-matching approach might be best, with a library of templates of different sizes. Then for each template-match peak, determine which size template gives the best match, and read out the size distribution from that?
Alternately, you could look at a Hough-circles sort of approach, and again could read off the size distribution straight from the Hough-transformed image.
Zach
I have a hough-circles implementation (which I've been meaning to contribute). Unfortunately, my implementation does a pretty poor job when there's a large range of circle size and when the circles are close/overlapping. As a result, the output I get for the example image is not very good. A better implementation may be able to deal with these issues, though. -Tony

Hallo, sorry for being so slow with my answers! I have urgent other tasks right now. I will pick up your hints when I have some time. Thanks for your help. Siggi

Hallo Siggi, two quick remarks. If you are the one taking the pictures, there is probably room for improvement concerning the acquisition, and not only the processing. If your image is taken with scanning electron microscopy, as it seems to me (but I'm not sure), you might want to combine an image from secondary electrons as the one you sent, and one image from back-scattered electrons. These two images should have a different type of contrast, that you might use for example to remove the background, and the process only regions corresponding to the spheres. About the Laplace transform for extracting the edges, you can get more pixels from the edges by using the canny filter, instead of a simple sobel filter. I had to use a larger value of sigma (the width of the Gaussian blurring applied before computing the sobel filter in the algorithm) than the default value
from skimage import img_as_float from skimage.filter import canny edges = canny(img_as_float(data), sigma=3)
Cheers, Emmanuelle On Sat, Feb 25, 2012 at 05:50:05AM -0800, Sigmund wrote:
Hallo,
sorry for being so slow with my answers! I have urgent other tasks right now. I will pick up your hints when I have some time. Thanks for your help.
Siggi
participants (6)
-
Andreas
-
Emmanuelle Gouillart
-
Sigmund
-
Stéfan van der Walt
-
Tony Yu
-
Zachary Pincus