图像移位操作 [英] image shift operation
本文介绍了图像移位操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在MATLAB代码中,我得到了一个名为myImage
的图像.图像Output
等于什么?
图像myImage
为double
2dim矩阵.
In a MATLAB code, I have got an image called myImage
. What is the image Output
equal to?
The image myImage
as a double
2dim matrix.
Output = [ myimage(:,1) myimage(:,1:size(myimage,2)-1) ];
我只了解图像Output
"image(:,1)
"的第一列是图像myImage
的第一列.但是第二个是什么?实际上,myimage(: , 1: anumber);
是什么?
I only understand that the first column of the image Output
"image(:,1)
" is the first column of the image myImage
. But what is the second? Actually, what is the myimage(: , 1: anumber);
?
推荐答案
这是原始图像,其中删除了最后一列,重复了第一列.
It's the original image with the last column removed and the first column duplicated.
请注意
-
myimage(:, 1:anumber)
表示myimage
的1
,...,anumber
列.参见 Matlab冒号运算符. -
size(myimage,2)
是myimage
的列数.请参见size
文档.
myimage(:, 1:anumber)
means columns1
,...,anumber
ofmyimage
. See Matlab colon operator.size(myimage,2)
is the number of columns ofmyimage
. Seesize
documentation.
一个示例显示结果:
>> myimage = magic(4)
myimage =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> Output = [ myimage(:,1) myimage(:,1:size(myimage,2)-1) ]
Output =
16 16 2 3
5 5 11 10
9 9 7 6
4 4 14 15
这篇关于图像移位操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文