MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Image processing of Centroid and Radius


You can detect a circular feature in an image by correlating the image with a kernel image of a circle with the same radius.

I had a quick look at your image (http://img850.imageshack.us/img850/6925/samplerd.png), and found that the following code nicely detects your circular feature.

im = <your image>
im2 = im // ImageAdjust // ColorNegate
ker = {FaceForm[White], EdgeForm[{Black, Thickness[0.1]}], Disk[]} // 
    Graphics // Rasterize[#, ImageSize -> 140] & // ColorNegate
corr = ImageCorrelate[im2, ker] // ImageAdjust

This solution needs to be tidied up and extended, but this approach gives you a fairly direct way of extracting the centroid and radius as you requested.

Stephen Luttrell



  • Prev by Date: Re: Unexpected expectation behaviour
  • Next by Date: Re: Adding value to some elements of a list
  • Previous by thread: Image processing of Centroid and Radius
  • Next by thread: Setting the Font Family and Font Size in BoxWhiskerChart