how to label each object in an image using 8 conncetivity

조회 수: 1 (최근 30일)
john karli
john karli 2019년 3월 3일
댓글: john karli 2019년 3월 3일
Image is atteched

채택된 답변

Image Analyst
Image Analyst 2019년 3월 3일
Use bwlabel
labeledImage = bwlabel(binaryImage);
  댓글 수: 3
Image Analyst
Image Analyst 2019년 3월 3일
Try this:
% Let's assign each blob a different color to visually show the user the distinct blobs.
coloredLabels = label2rgb (labeledImage, 'hsv', 'k', 'shuffle'); % pseudo random color labels
% coloredLabels is an RGB image. We could have applied a colormap instead (but only with R2014b and later)
imshow(coloredLabels);
axis image; % Make sure image is not artificially stretched because of screen's aspect ratio.
caption = sprintf('Pseudo colored labels, from label2rgb().\nBlobs are numbered from top to bottom, then from left to right.');
title(caption, 'FontSize', 12);
john karli
john karli 2019년 3월 3일
Thank you its work

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by