Effacer les filtres
Effacer les filtres

Creation of a black and white image

36 vues (au cours des 30 derniers jours)
Damien Dubois
Damien Dubois le 17 Juin 2021
Commenté : Damien Dubois le 17 Juin 2021
Hello, I tried to create an image of 512 X 512 pixels filled with black and in its center a square of white pixels of width 100 pixels for the moment I use this code to display an image in black but I can not do it at all is it you have a solution ?
image=zeros(512,512,3); %initialize
image(:,1)=0.5; %(dark )
figure, imshow(image)

Réponse acceptée

Stephan
Stephan le 17 Juin 2021
image=zeros(512,512);
image(206:305,206:305)=255;
imshow(image)
  1 commentaire
Damien Dubois
Damien Dubois le 17 Juin 2021
Thank you very much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by