Info

This question is closed. Reopen it to edit or answer.

error : Index exceeds matrix dimensions in Computer Vision for training set Face Recognition

1 view (last 30 days)
I want to make face recognition code. I want to train my dataset. My dataset is image. In order to understand you about my hierarchical directory, i'll explain you about my hierarchical directory. here it is: > ...\SEMESTER 7\VISI KOMPUTER\TUGAS\FP\TRAINING\Training\1(it is until 23)\filename.bmp
I have made a looping for each folder in my code, unfortunatelly i get this error: 'Index exceeds matrix dimensions'. It is my code:
function FP_FaceRecognition
directory = uigetdir;
imageVolum = [];
for i = 1:23
imageVolume = [];
directoryFinal = cell(23,1);
garing = '\';
extension = '.txt';
strI = num2str(i);
directoryFinal{i} = strcat(directory,garing,strI,garing);
fileList = dir(directoryFinal{i});
for idx = 3:numel(fileList)
tempImage = imread(fullfile(directoryFinal{i}, fileList(idx).name));
imageVolum(:,:,:,idx) = tempImage;
end
for j = 3:33
strJ = num2str(j);
garis = '_';
fileNameFinal = cell(30,1);
fileNameFinal{j} = strcat(strI,garis,strJ,extension);
imgManipulation3 = SLGS(imageVolum(:,:,:,j));
histSLGS = hist(imgManipulation3);
[rowhist, columnhist] = size(histSLGS);
for i = 1:rowhist
for j = 1:columnhist
fid = fopen(fileNameFinal{i}, 'w');
fprintf(fid, '%f, ', histSLGS(i,j));
end
fprintf('\n');
end
fclose(fid);
end
end
Your help is meaningful.. :) Thanks..
  1 Comment
Geoff Hayes
Geoff Hayes on 4 Dec 2014
Petrus - which line of code is generating the error? The message is telling you that the code is trying to access an element in the matrix using an index that exceeds the matrix dimension. For example, if we create a 4x4 matrix as
A = magic(4);
then trying to access an element in the fifth row will generate an identical error message
A(5,1)
Index exceeds matrix dimensions.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!