[英]Matlab 3-layered Image Matrix
I'm currently learning Matlab and having troubles understand the image section. 我目前正在学习Matlab,在理解图像部分时遇到了麻烦。 I have this powerpoint slide about matlab image: 我有这张关于matlab图片的幻灯片幻灯片:
****Image Matrices* ****图像矩阵*
3-layered image matrices -- Read 'rainbow.jpg' into im 3层图像矩阵-将'rainbow.jpg'读入im
Subset im to im2 – eg( 155:184 , 145:164, : ) 将im细分为im2 –例如(155:184,145:164,:)
*1 layer of an image – Get the red layer in im2**** * 1层图像–在im2中获得红色层****
I would like to ask what does(155:184, 145:164, :) represent? 我想问一下(155:184,145:164,:)代表什么? What does each value in parenthesis represent? 括号中的每个值代表什么? Also, what does the semi-colon represent? 另外,分号代表什么?
Thank you! 谢谢!
Say you have a 3 dimensional matrix A and you are indexing your matrix. 假设您有一个3维矩阵A,并且正在索引矩阵。 I will use the example above: 我将使用上面的示例:
A(155:184,145:164,:)
155:184
in the first entry means take rows 155 to 184 145:164
in the second entry means take columns 145 to 164 and the semi-colon in the last entry means take EVERY element along the 3rd dimension. 第一个条目中的155:184
占据第二个条目中的155至184 145:164
行,最后一个条目的分号沿第3维占据145至164列,最后一个条目的分号占据145至164行。 So if you have 200x200x3
, the semi-colon will take the 3 arrays along that 3rd dimension. 因此,如果您具有200x200x3
,则分号将沿该第3维采用3个数组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.