Deleting objects from a binary image.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
rupam baruah
el 21 de Mzo. de 2016
Comentada: Image Analyst
el 18 de Abr. de 2019
Hello everyone. I have a binary image with different objects. In the image I want to remove 5th, 13th, and 20th objects. How can I remove it. Thnks.
0 comentarios
Respuesta aceptada
Matthew Eicholtz
el 21 de Mzo. de 2016
L = bwlabel(bw); %where bw is your binary image
bw2 = bw; %copy of binary image
bw2(L==5) = 0; %deletes the 5th object
2 comentarios
Image Analyst
el 18 de Abr. de 2019
Try my answer below. If that doesn't work, explain more in a new question, and attach your image. And say which blob you want to delete.
Más respuestas (1)
Image Analyst
el 21 de Mzo. de 2016
You can use ismember() to extract the ones you want.
newBinaryImage = ismember(labeledImage, listOfBlobsToKeep) > 0;
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!