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일

0 개 추천

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일

0 개 추천

I have no idea what MP means in this context, but
doc imresize
will resize an image.

댓글 수: 2

Rik
Rik 2019년 3월 11일
I assumed it would mean megapixel
Varsha Nataraj
Varsha Nataraj 2019년 3월 11일
편집: Rik 2019년 3월 11일
yes mega pixel

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2019년 3월 11일

편집:

Rik
2019년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by