reducing resolution of an image

13 visualizaciones (últimos 30 días)
Varsha Nataraj
Varsha Nataraj el 11 de Mzo. de 2019
Editada: Rik el 11 de Mzo. de 2019
I have a 2MP image and i need to reduce to 1MP, but must not crop the image.
can i know how and command to be used.

Respuesta aceptada

Rik
Rik el 11 de Mzo. de 2019
You can use the imresize function to resample images:
A=uint8(randi(255,1666,1200,3));%generate random 2MP image
dims=size(A);dims=dims(1:2);%determine rows and cols
dims=round(dims/sqrt(2));%determine new dimensions for 1MP
B=imresize(A,dims);
  2 comentarios
Varsha Nataraj
Varsha Nataraj el 11 de Mzo. de 2019
Editada: Rik el 11 de Mzo. de 2019
thanks for suggestion
Rik
Rik el 11 de Mzo. de 2019
If this suggestion solved your problem, please consider marking it as accepted answer. It will make it easier for other people with the same question to find an answer. If this didn't solve your question, please comment with what problems you are still having.

Iniciar sesión para comentar.

Más respuestas (1)

Adam
Adam el 11 de Mzo. de 2019
I have no idea what MP means in this context, but
doc imresize
will resize an image.
  2 comentarios
Rik
Rik el 11 de Mzo. de 2019
I assumed it would mean megapixel
Varsha Nataraj
Varsha Nataraj el 11 de Mzo. de 2019
Editada: Rik el 11 de Mzo. de 2019
yes mega pixel

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by