One image 2 diferent colors ,

1 view (last 30 days)
Biza Ferreira
Biza Ferreira on 5 Jun 2013
Commented: Image Analyst on 27 Apr 2014
I have one image with a circle, outside the circunference the color are black inside the circle the color before convert to grayscale, is gray, how can apply after normalize de image apply a mask who convert a the background in same color (gray). exemple image A and B

Accepted Answer

Image Analyst
Image Analyst on 5 Jun 2013
It looks like B was simply the convolution of A with a high pass filter, like the Laplacian or dog filter. Do you want to do that or you simply want the black surround to be gray?
Image Analyst
Image Analyst on 27 Apr 2014
kernel = [-1,-1,-1;-1,8,-1;-1,-1,-1];
output = conv2(double(inputImage), kernel, 'same');
imshow(output, []);

Sign in to comment.

More Answers (1)

Biza Ferreira
Biza Ferreira on 5 Jun 2013
Edited: Biza Ferreira on 5 Jun 2013
I Removing the background image was obtained by subtracting the original version of this image strongly smoothed (result of filtering with a filter medium sized relatively high). The intensities of the image resulting from the subtraction were subsequently reescaladas for the full range of image intensities (0-255).
if true
fontSize= 12;
A = imread('imagens/03_test.tif');
%B = rgb2gray(A);%original a P&B
ft_high=[0 -1/4 0; -1/4 2 -1/4; 0 -1/4 0];
h = fspecial('average', [5 5]);
filtered= imfilter(A,h,'replicate');
filtered1= imfilter(A,ft_high,'replicate');
B = rgb2gray(Subtract1);%original a P&B
J = imadjust(B);
title('Original Image Color', 'FontSize', fontSize);
title('Filter Image Median', 'FontSize', fontSize);
title('Filter Image Median with High', 'FontSize', fontSize);
  1 Comment
Image Analyst
Image Analyst on 5 Jun 2013
So does this answer your question? If so, let's finish it off by marking it as the "Accepted" answer.

Sign in to comment.


Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!