필터 지우기
필터 지우기

Split and label the region

조회 수: 1 (최근 30일)
missC
missC 2014년 4월 24일
댓글: Image Analyst 2014년 4월 24일
Hi everyone. I wanted to split the image into half. I have used centroid function and return the value of X and Y. How to label or apply the color into the both regions as I indicated with pink line. Let say, the half (top) colored with green and the other half (bottom) with different color. Thanks
I = imread('img4.tif');
Ibw = im2bw(I);
Ibw = imfill(Ibw,'holes');
Ilabel = bwlabel(Ibw);
stat = regionprops(Ilabel,'centroid');
imshow(I); hold on;
for x = 1: numel(stat)
plot(stat(x).Centroid(1),stat(x).Centroid(2),'ro');
end
  댓글 수: 1
Image Analyst
Image Analyst 2014년 4월 24일
I don't understand. Do you want an image where the top half is one color and the bottom half another? Or you want just the skeletons in those halves to have color and the background to remain black? Either way, why?

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by