MathGroup Archive 2013

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

Search the Archive

Re: Image processing of Centroid and Radius

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131046] Re: Image processing of Centroid and Radius
  • From: stephen.p.luttrell at gmail.com
  • Date: Thu, 6 Jun 2013 07:28:28 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <komol9$1v5$1@smc.vnet.net>

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