From: ImageAnalyst on
It's not intuitive to me that, in the presence of noise, the centroid
determined by thresholding is any less accurate than that determined
via Hough. If you have a simulation proving that, I'd love to see it.
From: Cris Luengo on
"Alistair Templeton" <bigalt2000(a)yahoo.com> wrote in message <hqn4vc$gra$1(a)fred.mathworks.com>...
> In a nutshell, I have one bigger, very clear circle of exactly known size. Inside that (but possibly partially occluded) is a much blurrier circle, also of known size within <.1 pixel. The attenuation of the radiation outside the field is large enough that the ball's extra attenuation is non-detectable, hence the partial occlusion.
>
> I'm trying to use the Hough transform to detect the circles, particularly this implementation:
>
> http://www.mathworks.com/matlabcentral/fileexchange/9168-detect-circles-with-various-radii-in-grayscale-image-via-hough-transform
>
> This is basically dummy-proof for finding the circle representing the radiation field. However, that gradient is so dominant that the ball within seems invisible.
>
> So, any words of guidance? Specifically:
>
> Am I barking up the right tree with the Hough Transform?

Seems reasonable, though there are other methods also...

> Do I need to somehow get rid of the outer circle once I've found it, in order to find the ball? This is impossible to do perfectly, because of sampling issues.

I haven't used the code you found for the Hough transform, but I don't see a reason why the Hough transform shouldn't find both circles. The one maximum will be much smaller than the other, because of the different contrast, but they should both be visible, IMO.
- Make sure that the gradient magnitude operation used does not blur the input image too much (you don't have much noise in your image).
- You know you have 2 circles, so look for the two largest peaks in the transform.
- You know the diameter of the two circles, so you only need to compute the Hough transform associated with those diameters (saves computation!) and find the one peak for each of those diameters.

An alternative to the Hough transform is the Radon transform -- these are identical in the continuous world. And knowing the diameter of the circle you are looking for, you don't even need to go for the whole transform... the Radon transform simplifies to a single convolution (same as "template matching"!). Draw a circle in an empty image, and convolve your image with this circle. If the diameters match, you should have a single peak in the output. Find its location, and you know where the circle is in your image. See http://dx.doi.org/10.1016/j.patcog.2005.04.018 (PDF available here also: http://www.cb.uu.se/~cris/Documents/j.patcog.2005.04.018.pdf ).

Finally, as pointed out in the other post, you could try with a simple threshold. If you can threshold the image so that you see the one circle, and threshold it so you see the other circle, then you can find the centre of gravity of the two circles. Note that this will be less accurate than the Radon method pointed out above.

Good luck!
From: ImageAnalyst on
Why can't you just use regular thresholding?
Also, I prefer http://drop.io. I didn't notice any way on yours how
to download the pictures.
From: Alistair Templeton on
No followup questions, and am still working on this but I just wanted to say thanks for the input. I'll give Mr. Hough a shot for now but will definitely be revisiting it for square fields.

Unfortunately thresholding gets tricky, because it's difficult to get the same exposure from image to image. It could potentially work with relative thresholds but the center of mass is slightly more sensitive to noise from what I've heard. Probably good enough.

Thanks again!
 | 
Pages: 1
Prev: Matlab crash!
Next: ButtonDownFcn