필터 지우기
필터 지우기

How to fullfill segmented region by using region growing?

조회 수: 2 (최근 30일)
iza
iza 2016년 6월 17일
편집: iza 2016년 6월 21일
Can anyone help me on how to make the segmented purple region fulfilled the neighborhood 'empty' area with the same purple color?
The image is actually an overlapped of two brain images: </matlabcentral/answers/uploaded_files/54479/overlapped%20images.png>
The problem is, how to make the region of purple growing and fulfill all it's neighborhood region so that the region is larger.
Actually my intention is to perform region growing before k-means clustering, but it seems like it does not make any sense because both are segmentation. Any idea guys?...

채택된 답변

iza
iza 2016년 6월 17일
The image is actuall
y an overlapped of two brain images:
  댓글 수: 2
iza
iza 2016년 6월 21일
I managed to solve the problem using this code:
% Find boundry of image
bw = im2bw(image, graythresh(image));
cc = bwconncomp(bw);
lblMatrix = labelmatrix(cc);
edgeMatrix=edge(lblMatrix,'roberts',0);
edgeMatrix1 = double(edgeMatrix);
edgeMatrix1(end, end, 3) = 0;
figure;
imshow(edgeMatrix1);
%fill inside the region of detected edge
edgeMatrix2=imfill (edgeMatrix1,'holes');
figure; imshow(edgeMatrix2); title('WM and WMH Boundary Extraction','FontSize', 12);
%overlay detected edge on segmented image
rgbImageX = imoverlay(hat, edgeMatrix1, [1 0 0]);
imshow(rgbImageX); title('Boundary overlay on segmented images','FontSize', 12);
iza
iza 2016년 6월 21일
편집: iza 2016년 6월 21일
In order to crop the image by using the boundary, here is the code. By the way addImGMWM is RGB image.
%crop the image
% Create a binary image ("mask") from the ROI object.
figure;
imshow(bw);
title('Binary mask of the region', 'FontSize', fontSize);
% Mask the image.
rgbImage=addImGMWM;
maskedRgbImage = bsxfun(@times, rgbImage, cast(bw,class(rgbImage)));
% Display it.
figure;
imshow(maskedRgbImage);
title('Mask of the desired region only', 'FontSize', fontSize);

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by