Borrar filtros
Borrar filtros

How to resize an image into size 256*256

4 visualizaciones (últimos 30 días)
Anushka
Anushka el 27 de Mayo de 2015
Respondida: Image Analyst el 27 de Mayo de 2015
I used the following code
J = J(1:256,1:256,:)
[r c]=size(J);
display(r); display(c);
But the value of c is displayed as 768.But the resized size is 256.What would be the error.And I cant use the command imresize since I need the third coordinate also.

Respuestas (2)

Image Analyst
Image Analyst el 27 de Mayo de 2015
Never use size like that for a color image. Use
[rows, columns, numberOfColorChannels] = size(J);

Thorsten
Thorsten el 27 de Mayo de 2015
Editada: Thorsten el 27 de Mayo de 2015
Use
r = size(J, 1); c = size(J, 2);

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by