フィルターのクリア

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