How to measure circularity??
Mostrar comentarios más antiguos
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
el 21 de Dic. de 2014
Respuesta aceptada
Más respuestas (6)
Matt J
el 21 de Dic. de 2014
0 votos
It might also be useful to check whether the Eccentricity and Solidity of a region are above a certain threshold.
6 comentarios
Nisreen Sulayman
el 21 de Dic. de 2014
Matt J
el 21 de Dic. de 2014
Just display stats(i) to see the properties of the i-th component.
Nisreen Sulayman
el 21 de Dic. de 2014
Editada: Nisreen Sulayman
el 21 de Dic. de 2014
Use your label matrix, e.g.,
imagesc(labelled==1)
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
el 22 de Dic. de 2014
Editada: Nisreen Sulayman
el 23 de Dic. de 2014
Nisreen Sulayman
el 19 de En. de 2015
0 votos
12 comentarios
Image Analyst
el 19 de En. de 2015
Looks okay. It will write to the command window, not a file. To write to Microsoft Word, you'll have to use ActiveX. Explain in more detail what "didn't work" means to you.
Nisreen Sulayman
el 19 de En. de 2015
Image Analyst
el 19 de En. de 2015
Make it easy for me to help you. Post the entire script and image. I'll wait for it.
Nisreen Sulayman
el 19 de En. de 2015
Editada: Nisreen Sulayman
el 19 de En. de 2015
Image Analyst
el 19 de En. de 2015
See fixed code, attached. It will find and report the widths of all blobs.

Nisreen Sulayman
el 20 de En. de 2015
Editada: Nisreen Sulayman
el 20 de En. de 2015
Image Analyst
el 20 de En. de 2015
1. Yes. 2 and 3. In fprintf() and sprintf(), you have format specifiers. When it sees a % symbol, it looks at the numbers and letter after it to decide how to display the variable. f means floating point, d means integer, and s means string. In %T.Lf, L is the number of numbers to the right of the decimal point. and T is the total width of the numbers to the left and right plus the decimal point itself, and any spaced needed to make the whole space for printing be T characters.
Nisreen Sulayman
el 20 de En. de 2015
Editada: Nisreen Sulayman
el 20 de En. de 2015
Image Analyst
el 20 de En. de 2015
You can calculate the circularities and then use ismember to extract them
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'Area', 'Perimeter');
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
circularities = appPerimeters.^2 ./ (4*pi*allAreas);
roundIndexes = find(circularities < 3)
binaryImage = ismember(labeledImage, roundIndexes)>0;
roundMeasurements = regionprops(binaryImage, 'all');
Nisreen Sulayman
el 21 de En. de 2015
Editada: Nisreen Sulayman
el 21 de En. de 2015
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
el 22 de En. de 2015
Nisreen Sulayman
el 19 de En. de 2015
0 votos
Nisreen Sulayman
el 29 de En. de 2015
Editada: Nisreen Sulayman
el 29 de En. de 2015
0 votos
7 comentarios
Image Analyst
el 29 de En. de 2015
I don't know what that means. Explain it.
Nisreen Sulayman
el 30 de En. de 2015
Editada: Nisreen Sulayman
el 30 de En. de 2015
Image Analyst
el 30 de En. de 2015
I don't use the Database Toolbox but you can look into it. Most people here I think just mean a folder of images when they talk about databases. You could analyze them and save the results of them into a mat file if you want. The database should be as big as you need it to be. Maybe 3 or 4 is big enough, but maybe you want more. I don't know what your plans are. Anyway, this sounds like it should be its own question since it's pretty different than your original question. Maybe you'll get more database programmers to answer. I am not a database programmer.
Nisreen Sulayman
el 31 de En. de 2015
Image Analyst
el 31 de En. de 2015
Yes, there is. You need to create a Receiver Operating Characteristic, or "ROC Curve". Read more about it in Wikipedia: http://en.wikipedia.org/wiki/Receiver_operating_characteristic
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
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]))
Souhardya Roy
el 6 de Jul. de 2018
0 votos
The formula is inverse of what is given.
2 comentarios
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
el 19 de Nov. de 2019
yousra, check out Image Processing Articles on Aneurysms
yousra zafar
el 21 de Nov. de 2019
0 votos
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 Display and Exploration en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





