How to copy one image to another (blank) pixel by pixel?
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Xc = imread('IM1.jpg');
tam = size(Xc)
sizex = tam(1);
sizey = tam(2);
blank = ones(sizex,sizey,3);
for i=1:sizex
for j=1:sizey
for d=1:3
blank(i,j,d)=Xc(i,j,d);
end
end
end
imshow(blank);
why isn't it working? any ideas?
0 commentaires
Réponse acceptée
David Sanchez
le 26 Juin 2013
Xc = imread('Arinaga+29+de+mayo+de+2013-3.jpg');
[sizex sizey sizez]= size(Xc);
blank = zeros(sizex,sizey,sizez);
for i=1:sizex
for j=1:sizey
for d=1:3
blank(i,j,d)=Xc(i,j,d);
end
end
end
%%%%%the new addition
image(uint8(blank));
2 commentaires
Sean de Wolski
le 26 Juin 2013
Alternatively, a more general case:
blank = zeros(sizex,sizey,sizez,class(Xc))
Plus de réponses (1)
Jonathan Sullivan
le 26 Juin 2013
You should try this:
Xc = imread('IM1.jpg');
blank = Xc;
imshow(blank);
0 commentaires
Voir également
Catégories
En savoir plus sur Geometric Transformation and Image Registration 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!