An object with the biggest amount of scope in the Binary image
Mostrar comentarios más antiguos
Hello, I have a binary image with n white objects (not connected). How can I leave only the object with the biggest amount of scope in the picture I can do it by - bwareaopen, but in this way I have to know approximate size of an object. sorry for my english. thnx
Respuesta aceptada
Más respuestas (2)
Adam Filion
el 12 de Sept. de 2013
Editada: Adam Filion
el 12 de Sept. de 2013
If you have Image Processing Toolbox you can use the function regionprops. It comes out to something like this, where tm is the binary image.
cc = bwconncomp(tm);
stats = regionprops(cc,'Area');
A = [stats.Area];
[~,biggest] = max(A);
tm(labelmatrix(cc)~=biggest) = 0;
You can watch a recorded presentation that steps through a similar example here:
2 comentarios
Felix
el 12 de Sept. de 2013
Editada: Image Analyst
el 13 de Sept. de 2013
Image Analyst
el 13 de Sept. de 2013
Editada: Image Analyst
el 13 de Sept. de 2013
Sean de Wolski
el 17 de Sept. de 2013
0 votos
Good timing, I just posted this function a few minutes ago!
Categorías
Más información sobre Image Arithmetic 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!
