简体   繁体   English

如何在Matlab中将具有相同尺寸的两个图像设为相同大小

[英]How to make two images with same dimensions to be same size in matlab

I have two images with same dimensions but with different sizes. 我有两个尺寸相同但尺寸不同的图像。 I want the bigger image's size to be changed to match the smaller image's size. 我希望更改较大图像的尺寸以匹配较小图像的尺寸。 For example, I have an image A with size 300x400x3 and image B with size 600x800x3 . 例如,我有尺寸的图像A 300x400x3和图像B与尺寸600x800x3 I want to change the size of image B to 300x400x3 . 我想将图像B的大小更改为300x400x3 Thanks for any help. 谢谢你的帮助。

Just one-liner as suggested by Andrey - 正如安德烈(Andrey)建议的那样,

B = imresize( B,[size(A,1) size(A,2)]);

For accessing more options with resizing, use this resource . 要通过调整大小访问更多选项,请使用此资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM