Count the no of Black pixels in the image .

68 visualizaciones (últimos 30 días)
MJ Thangaraj
MJ Thangaraj el 23 de Abr. de 2016
Comentada: Walter Roberson el 23 de Abr. de 2016
I get the Image after processing using the code below. Now i have to find the black pixels that are cracks
%%Load Image
i=imread('coor.jpg');
imshow(i);
%Image Adjust
adj=imadjust(i,stretchlim(i));
imshow(adj);
%%Convert RGB to Gray
gry=rgb2gray(adj);
imshow(gry,[]);
%%Image segementation by thresholding
level=0.09;
thres=im2bw(gry,level);
imshow(thres);
% Image morphological operation
bw=bwmorph(thres,'clean',20);
imshow(bw);
%%End

Respuestas (1)

Walter Roberson
Walter Roberson el 23 de Abr. de 2016
sum(bw(:) == 0)
  2 comentarios
MJ Thangaraj
MJ Thangaraj el 23 de Abr. de 2016
What if i have to find the WHITE pixels
Walter Roberson
Walter Roberson el 23 de Abr. de 2016
sum(bw(:))
or
nnz(bw)

Iniciar sesión para comentar.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by