Sort pixelIdxList Array as descending order based on their number of pixels.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sufian ahmed
el 12 de Jun. de 2017
Respondida: Image Analyst
el 19 de Jun. de 2017
numPixels = cellfun(@numel,CC.PixelIdxList);
numPixels =
1015 951 719 852 760 550 503
I want to sort this value and their indexes also. how can I do this?
0 comentarios
Respuesta aceptada
Image Analyst
el 19 de Jun. de 2017
Not sure who told you that convoluted complicated way of determining the number of pixels in the labeled objects. You can do this so much easier by doing this:
props = regionprops(CC, 'Area');
sortedAreas = sort([props.Area], 'descend'); % Areas = "numPixels"
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!