Clear Filters
Clear Filters

how to separate each layer of concentric circular strip of different color?

1 view (last 30 days)
i have a code for concentric circular strip and i want to separate each layer so how to do? code is given below.
X = ones(256,1)*[-128:127]; Y = [-128:127]'*ones(1,256);
Z = X.^2 + Y.^2;
% mesh(Z);
image = zeros(256,256);
image(find(Z<= 60^2)) = 0.3;
image(find(Z<= 40^2)) = 0.5;
image(find(Z<= 20^2)) = 0.8;
imshow(image);

Accepted Answer

KSSV
KSSV on 9 Mar 2017
X = ones(256,1)*[-128:127];
Y = [-128:127]'*ones(1,256);
Z = X.^2 + Y.^2;
% mesh(Z);
image = zeros(256,256);
image(find(Z<= 60^2)) = 0.3;
image(find(Z<= 40^2)) = 0.5;
image(find(Z<= 20^2)) = 0.8;
subplot(221)
imshow(image);
%%pick between 0.3 and 0.5
Zi = image ;
Zi(image~=0.3) = 255;
subplot(222)
imshow(Zi)
Zi = image ;
Zi(image~=0.5) = 255 ;
subplot(223)
imshow(Zi)
Zi = image ;
Zi(image~=0.8) = 255 ;
subplot(224)
imshow(Zi)

More Answers (0)

Categories

Find more on Image Processing Toolbox 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!