MATLAB Answers

0

Q: How to remove outline circle in this image?

Asked by Portgas Ace on 9 Oct 2014
Latest activity Commented on by Iain
on 9 Oct 2014
Can you guys suggest possible ways on how to remove the circle outline in this image? Imfindcircles doesnt work for me. Can you suggest other methods?

  0 Comments

Sign in to comment.

2 Answers

Answer by Iain
on 9 Oct 2014

A simple method is to use "bwlabel". This assigns each of the non-touching white areas a unique number. You can then pick each one in turn, and remove it like this:
labelled = bwlabel(binary_image); % binary image is the one on the right, which I'm assuming is binary
object_number = 1; % 1 is the object which is closest to the left hand side edge, and if there are two, then it choses the one nearest the top of the image.
labelled(labelled == object_number) = 0;
binary_image_corrected = labelled > 0;
I can see 2 or 3 things that that method will also remove.

  3 Comments

I tried what you gave sir and nothing happened to the image. Can you elaborate more the other methods?
BW=cbeval; %cbeval is the binarized image
labelled = bwlabel(BW);
object_number = 1;
labelled(labelled == object_number) = 0;
binary_image_corrected = labelled > 0;
subplot(1,2,1); imshow(BW);
subplot(1,2,2); imshow(binary_image_corrected);
Well now, those are different than what you first showed. The circle is not not completely closed and you have other blobs that occur in column 1 and will have label 1.
Iain
on 9 Oct 2014
If you make matlab "imagesc" the labelled image, you can use the datatip to find out the object number of any blob/section you want to eliminate.

Sign in to comment.


Answer by Image Analyst
on 9 Oct 2014

Depends on how robust you want to be. Here's one method (untested)
% Extract the red channel and threshold it to find dark pixels.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
%greenChannel = rgbImage(:, :, 2);
%blueChannel = rgbImage(:, :, 3);
mask = redChannel < 128; % Or whatever works.
% Dilate the binary image to close in the big circular central hole
mask = imdilate(mask, true(3)); % Increase 3 if it's not getting rid of circle.
% Compute the edge image by whatever you're doing now.
% Mask the edge image
edgeImage(~mask) = 0;

  0 Comments

Sign in to comment.