Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在matlab中从图像中获取部分?_Matlab - Fatal编程技术网

如何在matlab中从图像中获取部分?

如何在matlab中从图像中获取部分?,matlab,Matlab,我有一张512x256的图像。 我想从这个图像i中得到一些像切片的部分。 就像我想要大小为512x50的I1一样。要获取包含前50列和所有行的切片,请执行以下操作 sliceOfImage = originalImage(:,1:50) 要获取包含列100到149的切片,请调用 sliceOfImage = originalImage(:,100:149) 等等 x = [1:50]; % define the scope of x-axis (the "columns") for the

我有一张512x256的图像。 我想从这个图像i中得到一些像切片的部分。
就像我想要大小为512x50的I1一样。

要获取包含前50列和所有行的切片,请执行以下操作

sliceOfImage = originalImage(:,1:50)

要获取包含列100到149的切片,请调用

sliceOfImage = originalImage(:,100:149)
等等

x = [1:50]; % define the scope of x-axis (the "columns") for the portion of the image
y = [1:512]; %define the scope of y-axis (the "rows") for the portion of the image

I1 = I(x,y,:); % Create I1, the desired portion of the image. Assuming the original image is of RGB and you need to access all 3 colors.