Duplicating the rows and columns of image, without using imresize.
Mostrar comentarios más antiguos
I am trying to take an image and output a larger image whose height and width are twice as much as those of the input image, by duplicating the rows and columns ( without using imresize).
I have tried implementing this; however, the output is an entirely black image.
img = imread('https://people.sc.fsu.edu/~jburkardt/data/png/lena.png');
[M1,N1] = size(img);
M2 = M1*2;
N2 = N1*2;
g = zeros(M2,N2);
imshow(g);
1 comentario
Rik
el 7 de Feb. de 2019
Why do you not want to use imresize? Is this a homework assignment?
If you follow the flow of your program, the following things happen:
- you read a color image from a website to an array
- you determine the number of rows and columns (ignoring a possible color component, which is aparently missing from this version of the lena image)
- you double those numbers
- you create an entirely new array made up of only zeros
- you display that new array
From this it should be clear that you didn't change the size of the image, and it should be clear why the image you see is blank.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!