Creating border of an image
Afficher commentaires plus anciens
I need a create black border around an image:
My code:
I=ones(256,256); //size of an image
border = 2;
I(end:end+border,end:end+border)=0;
I(1:1+border,1:1+border)=0; // I know the problem is here
imshow(I)
Please help
Réponse acceptée
Plus de réponses (1)
DGM
le 16 Juil 2022
0 votes
While it may suffice to use array indexing to insert the image into a larger image, there are other methods. Depending on what's needed (black only, color, etc), and depending on what's available (Image Processing Toolbox), there may be more convenient options.
This reference answer covers the addition of black/colored/patterned image borders using base MATLAB/IPT tools, as well as third-party tools.
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!