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 Kommentar

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
  1. describe in words what you were trying to accomplish with that line, and
  2. provide an unambiguous example filename (perhaps for i=1 and j=2) that you would like the sprintf line to create.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Cris LaPierre
Cris LaPierre am 13 Mär. 2021

0 Stimmen

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)
s = 'D:\ajorMinorKnuckleFingerprint\First Minor knuckle index\1_3.bmp'

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 13 Mär. 2021

Beantwortet:

am 13 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by