필터 지우기
필터 지우기

How to get images of specified width and height/ resize them to specified width and height?

조회 수: 2 (최근 30일)
How to get images of specified width and height/ resize them to specified width and height?
I am processing a large data set and want to prepare an animation out of it. But the images have different frame sizes, like: 2850 x 780; 2803 x780; 2849 x 780?
Is there any function avaiable to specify the frame size?
Thanks in advance.

답변 (2개)

Simon Chan
Simon Chan 2022년 3월 25일
Use function imresize

Image Analyst
Image Analyst 2022년 3월 25일
Try imresize()
desiredRows = 512;
desiredColumns = 1000;
resizedImage = imresize(originalImage, [desiredRows, desiredColumns]);
% double check
[rows, columns, numberOfColorChannels] = size(resizedImage)
  댓글 수: 3
Image Analyst
Image Analyst 2022년 3월 25일
편집: Image Analyst 2022년 3월 25일
What does that mean? I didn't compute row and column. And even if your images are only one pixel (1 row and 1 column), imresize() should work. Or if you want desiredRows to be 1, and desiredColumns to be 1, it should still work. Explain using a lot more words this time, because I already know your images are of different sized -- you said that already.

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by