Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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);

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by