如何在MATLAB中将图像与矩阵水平连接 [英] how to concatenate an image with a matrix horizontally in MATLAB
本文介绍了如何在MATLAB中将图像与矩阵水平连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一张图像img
.我想用零矩阵来使它变平,但是在水平方向上
i-e图像应显示为黑色.
I have an image img
. I want to conactenate it with a matrix of zeros, but horizontally
i-e image should appear with black color.
推荐答案
为入门,这会在灰度图像的底部添加一行零:
To get you started, this adds a row of zeros to the bottom of a grayscale image:
result = [img; zeros(1,size(img,2))]
这与rgb图片相同:
result = [img; zeros(1,size(img,2),3)]
这篇关于如何在MATLAB中将图像与矩阵水平连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文