How to measure circularity??

19 visualizaciones (últimos 30 días)
Nisreen Sulayman
Nisreen Sulayman el 20 de Dic. de 2014
Respondida: yousra zafar el 21 de Nov. de 2019
How to measure circularity ? What is wrong in this code?
CC=bwconncomp(BW); %BW binary image
labeled=labelmatrix(CC);
stats = regionprops(CC, 'all');
stats.circularity = ((stats.Perimeter) .^2 )./ (4*(pi*(stats.Area)))
  1 comentario
Nisreen Sulayman
Nisreen Sulayman el 21 de Dic. de 2014
what are the all possible features I can use to pick the smallest circular-like component ??

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 20 de Dic. de 2014
You didn't use brackets. Try it this way
allPerimeters = [stats.Perimeter];
allAreas = [stats.Area];
allCircularities = allPerimeters .^ 2 ./ (4 * pi* allAreas);
  12 comentarios
Image Analyst
Image Analyst el 22 de Dic. de 2014
You're welcome. My email is not necessary.
Hossain Md Shakhawat
Hossain Md Shakhawat el 20 de Nov. de 2016
How can I find the glcm features for the detected blobs.

Iniciar sesión para comentar.

Más respuestas (6)

Matt J
Matt J el 21 de Dic. de 2014
It might also be useful to check whether the Eccentricity and Solidity of a region are above a certain threshold.
  6 comentarios
Image Analyst
Image Analyst el 22 de Dic. de 2014
You can look at my code in my answer where the blobs are labeled with their number in the first figure, and then each blob is cropped out to a separate image with the blob number in the title above the blob.
Nisreen Sulayman
Nisreen Sulayman el 22 de Dic. de 2014
Editada: Nisreen Sulayman el 23 de Dic. de 2014
thank you very much ... thank you

Iniciar sesión para comentar.


Nisreen Sulayman
Nisreen Sulayman el 19 de En. de 2015
Hi Mr. Image Analyst,
I am working on the code that you have written "test.m", I want to display more properties of the blobs in the image ... 'MajorAxisLength', 'MinorAxisLength', 'Orientation' ... After that I want to copy these values to a doc file
I have modified the code but it didn't work
  12 comentarios
Image Analyst
Image Analyst el 21 de En. de 2015
First segment the image to get a binary mask of that thing. Then mask it
red = grayImage;
red(mask) = 255;
green = grayImage;
green(mask) = 0;
blue = grayImage;
blue(mask) = 0;
rgbImage = cat(3, red, green, blue);
imshow(rgbImage);
Nisreen Sulayman
Nisreen Sulayman el 22 de En. de 2015
Thank you very much Mr. Analyst,
I am grateful for your help.

Iniciar sesión para comentar.


Nisreen Sulayman
Nisreen Sulayman el 19 de En. de 2015
I have apllied the code. How can I display the round objects in the original images in different color instead of drawing a circle around them???

Nisreen Sulayman
Nisreen Sulayman el 29 de En. de 2015
Editada: Nisreen Sulayman el 29 de En. de 2015
How can I index images according to the resulted segmented image? Is there any thing related to build a database using MATLAB?
Any example or link about this?
  7 comentarios
murk hassan memon
murk hassan memon el 4 de Abr. de 2018
stats.circularity = ((stats.Perimeter) .^2 )./ (4*(pi*(stats.Area))) i am getting an error of this sign ^ as such the error is too many input argument.. is there any other method to find the circularity ? if yes? then kindly help me out
Matt J
Matt J el 4 de Abr. de 2018
@murk,
You have multiple objects in "stats" so you need to do something like,
result = ([stats.Perimeter] .^2 )./ (4*(pi*[stats.Area]))

Iniciar sesión para comentar.


Souhardya Roy
Souhardya Roy el 6 de Jul. de 2018
The formula is inverse of what is given.
  2 comentarios
yousra zafar
yousra zafar el 19 de Nov. de 2019
can you share the code for finding circular objects . i am also working on aneurysm detection. any guidance from your side will he highly appreciated
Image Analyst
Image Analyst el 19 de Nov. de 2019

Iniciar sesión para comentar.


yousra zafar
yousra zafar el 21 de Nov. de 2019
i,m unable to run the code text.m attcahed above, getting error : file not found , can you share with me the image C:\Users\Rose\Documents\Temporary\im.jpg

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by