图像移位操作 [英] image shift operation

查看:104
本文介绍了图像移位操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MATLAB代码中,我得到了一个名为myImage的图像.图像Output等于什么? 图像myImagedouble 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) means columns 1,...,anumber of myimage. See Matlab colon operator.
  • size(myimage,2) is the number of columns of myimage. See size 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屋!

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