can't read the path image

1 view (last 30 days)
reham targam
reham targam on 1 Jun 2017
Edited: Walter Roberson on 1 Jun 2017
clear;
clear all;
for jndex=1:20
if(jndex==1)
wwww = 'S1';
elseif(jndex==2)
wwww = 'S2';
elseif(jndex==3)
wwww = 'S3';
elseif(jndex==4)
wwww = 'S4';
elseif(jndex==5)
wwww = 'S5';
elseif(jndex==6)
wwww = 'S6';
elseif(jndex==7)
wwww = 'S7';
elseif(jndex==8)
wwww = 'S8';
elseif(jndex==9)
wwww = 'S9';
elseif(jndex==10)
wwww = 'S10';
elseif(jndex==11)
wwww = 'S11';
elseif(jndex==12)
wwww = 'S12';
elseif(jndex==13)
wwww = 'S13';
elseif(jndex==14)
wwww = 'S14';
elseif(jndex==15)
wwww = 'S15';
elseif(jndex==16)
wwww = 'S16';
elseif(jndex==17)
wwww = 'S17';
elseif(jndex==18)
wwww = 'S18';
elseif(jndex==19)
wwww = 'S19';
elseif(jndex==20)
wwww = 'S20';
end
face1= wwww ;
K=12; %the DCT block width
ind=0;
path=strcat('Olivetti Data\',face1,'\');
outputfile2=strcat(face1);
outputfileName2=strcat(path,outputfile2);
outputfileName3=strcat(outputfile2);
for iiii=1:10
%
fileName1=strcat(num2str(iiii,'%2d'),'.TIFF');
outputfile1=strcat(num2str(iiii,'%2d'),'.feats');
fileName=strcat(path,fileName1);
outputfileName=strcat(path,outputfile1);
%Extract features using DCT
%filename = ['user001-' num2str(iiii,'%02d') '.TIFF'];
X= imread(fileName1);
Xg=rgb2gray(X);
Xg=im2double(Xg);
Jg = dct2(Xg);
jg=im2col(Jg,[K K],'distinct'); %if K=12 this gives a vector length 144
bg = jg(:,1);
% Extract features using DWT and GLCM
x = double(X);
m = size(X,1);
n = size(X,2);
signal1 = X(:,:);
[cA1,cH1,cV1,cD1] = dwt2(signal1,'db4');
[cA2,cH2,cV2,cD2] = dwt2(cA1,'db4');
[cA3,cH3,cV3,cD3] = dwt2(cA2,'db4');
DWT_feat = [cA3,cH3,cV3,cD3];
% Apply PCA to reduce dimensionality
G = pca(DWT_feat);
% Check dimensionality reduction
whos DWT_feat
whos G
g = graycomatrix(G);
stats = graycoprops(g,'Energy');
Energy = stats.Energy;
sprintf('Energy is %g%%',Energy)
Feat=[bg; G ;Energy];
L = length(D);
ind=ind+1;
Data(ind,1:L)=D(1:L);
end
save(outputfileName3,'face1','-ASCII');
end
the error message
Error using imread (line 349)
File "Olivetti Data\1.TIFF" does not exist.
Error in Features_s1 (line 65)
X= imread(filename);
please anybody can help me i can't solve this error
  1 Comment
Image Analyst
Image Analyst on 1 Jun 2017
And make sure 1.tiff is on your computer in the Olivetti Data folder. You might use fullfile() to create the entire full/complete path name to the file.

Sign in to comment.

Answers (0)

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!