i need help to solve this error
Show older comments
want to read all images in specific folder But the error occur and I don't know why and what to do. i need help
code :
want to read all images in specific folder But the error occur and I don't know why and what to do. i need help
code :
clear all;
close all;
disp(' ')
disp('Step 1:')
filter_bank = construct_Gabor_filters_PhD(8, 5, [180 160]);
data_matrix = [];
ids = [];
conut = 0;
% construct image string, load image and extract features
for i=1:503
for j=1:5
s = sprintf('D:\ajorMinorKnuckleFingerprint\First Minor knuckle index\%i_%i.bmp',i,j);
X = imread(s);
X=rgb2gray(X);
featureg= filter_image_with_Gabor_bank_PhD(X,filter_bank,64);
data_matrix = [data_matrix,bsifhistr(:)];
bsifhistr=bsif(X,ICAtextureFilters,'nh');
data_matrix=[data_matrix,bsifhistr(:)];
ids = [ids;i];
conut = conut+1;
disp(sprintf('Finished with feature extraction from image %i/%i',conut,400));
end
end
and this is erreur :

1 Comment
Chad Greene
on 13 Mar 2021
It looks like the problem is this line:
s = sprintf('D:\ajorMinorKnuckleFingerprint\First Minor knuckle index\%i_%i.bmp',i,j);
It would help if you can
- describe in words what you were trying to accomplish with that line, and
- provide an unambiguous example filename (perhaps for i=1 and j=2) that you would like the sprintf line to create.
Answers (1)
The backslash has special meaning in MATLAB as an escape character. If you actually want a backslash, you have to use "\\".
i=1;
j=3;
s = sprintf('D:\\ajorMinorKnuckleFingerprint\\First Minor knuckle index\\%i_%i.bmp',i,j)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!