Borrar filtros
Borrar filtros

Finding the "center" of an extended ring

36 visualizaciones (últimos 30 días)
Dominik Rhiem
Dominik Rhiem el 12 de Ag. de 2024 a las 14:38
Comentada: Matt J el 13 de Ag. de 2024 a las 13:58
I have been experimenting with the image processing toolbox's function "imfindcircles", and it works well. However, there is one issue: I have an extended big ring in the image where I want to recognise its "center" instead of the outer end of the ring (see attached figure, where the outer end is plotted with viscircles and the center and radius found by imfindcircles).
This is also mirrored in the data itself: both the inner and outer end of the big ring have a lower intensity than its center. Is there a way to force "imfindcircles" to use the ring of maximum intensity? (Note that I have applied a thresholding to my image, otherwise the gradient at the ring ends would not be as harsh, and imfindcircles would struggle to differentiate between the ring and artifacts neighbouring the ring.)
Or is there maybe an alternative that includes a second step? After all, the circle center is properly recognised, so I can maybe vary the radius slightly? Maybe I could add up all the values of pixels that would lie on the circle, and see where that reaches its maximum. Is there an easy way to do something like that?
openfig findcircle-test.fig
ans =
Figure (1) with properties: Number: 1 Name: '' Color: [1 1 1] Position: [3.2978e+03 523.4000 468 411.2000] Units: 'pixels' Use GET to show all properties
  3 comentarios
Matt J
Matt J el 13 de Ag. de 2024 a las 1:12
Editada: Matt J el 13 de Ag. de 2024 a las 1:14
both the inner and outer end of the big ring...
Perhaps you mean the inner and outer "edge" of the annulus?
...have a lower intensity than its center.
Perhaps you mean the midline of the annulus, rather than the center?
Dominik Rhiem
Dominik Rhiem el 13 de Ag. de 2024 a las 7:00
@Matt J yes, sorry about the confusing terminology, you are absolutely right. I was unsure whether or not to call it an "edge" and unaware of the term "midline", but those are what I meant.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 13 de Ag. de 2024 a las 1:23
Editada: Matt J el 13 de Ag. de 2024 a las 1:33
load Image
BW0=BW;
A=bwareafilt( imfill(BW,'holes'),1);
BW=imclose(A.*BW, strel('disk',3));
B=bwconvhull(~(~A|BW));
midline=bwskel(BW&~B); %midline of annulus
imshow(BW0+midline,[])
  2 comentarios
Dominik Rhiem
Dominik Rhiem el 13 de Ag. de 2024 a las 7:06
This looks really good and is pretty much what I meant, thank you. Do you have any suggestions to get the (average) radius of the "midline ring"?
Matt J
Matt J el 13 de Ag. de 2024 a las 13:58
Yes, you can use circularFit() from this FEX download,
[y,x]=find(midline);
cfit=circularFit([x,y]')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by