Index exceeds matrix dimensions.

img=('frame1.jpg');
nayaRes=img;
R=img(:,:,1);
G=img(:,:,2);
Error Masg:Index exceeds matrix dimensions.

2 个评论

Paste full code with jpg file
Its my mistake ....
if I have to seperate Red, Green and Blue chenals of image .....then i have to write like
img=imread('frame.jpg');

请先登录,再进行评论。

 采纳的回答

After read the file type
>> size(img)
If the third dimension is not 3, it's not RGB image

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by