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

2 visualizzazioni (ultimi 30 giorni)
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);

Risposta accettata

KSSV
KSSV il 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)

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by