reducing resolution of an image

13 次查看(过去 30 天)
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.

采纳的回答

Rik
Rik 2019-3-11
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 个评论
Varsha Nataraj
Varsha Nataraj 2019-3-11
编辑:Rik 2019-3-11
thanks for suggestion
Rik
Rik 2019-3-11
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.

请先登录,再进行评论。

更多回答(1 个)

Adam
Adam 2019-3-11
I have no idea what MP means in this context, but
doc imresize
will resize an image.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by