Count Object on color

13 visualizaciones (últimos 30 días)
hanis nadhirah
hanis nadhirah el 7 de Nov. de 2019
Comentada: hanis nadhirah el 9 de Nov. de 2019
Hello , I just use threshold app to isolate object with same color. However , i try use bwlabel to count object from result but it does not count . Can you help me ? Thank you.

Respuesta aceptada

Image Analyst
Image Analyst el 7 de Nov. de 2019
Call it then call bwlabel():
[BW,maskedRGBImage] = createMask(RGB);
[labeledImage, regionCount] = bwlabel(BW);
regionCount is the count of the colored objects you masked out.
  5 comentarios
Image Analyst
Image Analyst el 8 de Nov. de 2019
Thanks for accepting the answer. You might also use bwareafilt() or bwareaopen() to remove noise while leaving the shape of the other blobs unchanged. imopen() and imclose() will change the shape of blobs, which may or may not be acceptable to you. imclose() will tend to make blobs rounder/smoother while imopen() tends to make blobs pointier.
hanis nadhirah
hanis nadhirah el 9 de Nov. de 2019
Thank you for your help , I using bwareafilt() to remove noise and it works!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by