Index exceeds matrix dimensions.

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

2 Commenti

madhan ravi
madhan ravi il 10 Nov 2018
Modificato: madhan ravi il 10 Nov 2018
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');

Accedi per commentare.

 Risposta accettata

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

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by