필터 지우기
필터 지우기

Count the no of Black pixels in the image .

조회 수: 15 (최근 30일)
MJ Thangaraj
MJ Thangaraj 2016년 4월 23일
댓글: Walter Roberson 2016년 4월 23일
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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 23일
sum(bw(:) == 0)
  댓글 수: 2
MJ Thangaraj
MJ Thangaraj 2016년 4월 23일
What if i have to find the WHITE pixels
Walter Roberson
Walter Roberson 2016년 4월 23일
sum(bw(:))
or
nnz(bw)

댓글을 달려면 로그인하십시오.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by