如何通过将原始图像放在matlab中间来填充不同大小的图像并使它们具有相同的大小? [英] how to pad images of different sizes and making them of same size by putting the original image in the middle in matlab?

查看:157
本文介绍了如何通过将原始图像放在matlab中间来填充不同大小的图像并使它们具有相同的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有不同尺寸的图像。我想指定宽度和高度。所有图像都应该用黑色像素填充,将实际图像放在中间。

I have images of different sizes. I want to specify the width and the height. All the images should be padded with black pixels putting the actual image in the middle.

非常感谢

推荐答案

您可以使用 padarray 指定要在图像边缘添加的黑色像素数。

You can use padarray to specify how many black pixels you want to add around the edge of the image.

这篇关于如何通过将原始图像放在matlab中间来填充不同大小的图像并使它们具有相同的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆