please help me with this

2 views (last 30 days)
Tanya Verma
Tanya Verma on 18 Nov 2019
Answered: Walter Roberson on 18 Nov 2019
matrix A ,B,C and D are of 1 × 22 and the directory contain 3 images so F should he 3 ×88 but it is coming 1×88.please help.
location = ('F:\New folder'); % folder in which your images exists
ds = imageDatastore(location);
offsets = [0 1; -1 1;-1 0;-1 -1];
while hasdata(ds)
i = read(ds) ; % read image from datastore
glcm1 = graycomatrix(i,'numlevels',8,'offset',[0 1]);
[out] = GLCM_Features1(glcm1);
A=[out.autoc out.contr out.corrm out.corrp out.cprom out.cshad out.dissi out.energ out.entro out.homom out.homop out.maxpr out.sosvh out.savgh out.svarh out.senth out.dvarh out.denth out.inf1h out.inf2h out.indnc out.idmnc];
glcm2 = graycomatrix(i,'numlevels',8,'offset',[-1,1]);
[out1] = GLCM_Features1(glcm2);
B=[out1.autoc out1.contr out1.corrm out1.corrp out1.cprom out1.cshad out1.dissi out1.energ out1.entro out1.homom out1.homop out1.maxpr out1.sosvh out1.savgh out1.svarh out1.senth out1.dvarh out1.denth out1.inf1h out1.inf2h out1.indnc out1.idmnc];
glcm3 = graycomatrix(i,'numlevels',8,'offset',[-1,0]);
[out2] = GLCM_Features1(glcm3);
C=[out2.autoc out2.contr out2.corrm out2.corrp out2.cprom out2.cshad out2.dissi out2.energ out2.entro out2.homom out2.homop out2.maxpr out2.sosvh out2.savgh out2.svarh out2.senth out2.dvarh out2.denth out2.inf1h out2.inf2h out2.indnc out2.idmnc];
glcm4= graycomatrix(i,'numlevels',8,'offset',[-1,0]);
[out3] = GLCM_Features1(glcm4);
D=[out3.autoc out3.contr out3.corrm out3.corrp out3.cprom out3.cshad out3.dissi out3.energ out3.entro out3.homom out3.homop out3.maxpr out3.sosvh out3.savgh out3.svarh out3.senth out3.dvarh out3.denth out3.inf1h out3.inf2h out3.indnc out3.idmnc];
E=[ A ,B,C,D];
F=[];
F=[F;E];
imshow(i)
end
  1 Comment
KSSV
KSSV on 18 Nov 2019
What you are supposed to do? What is F? What is A,..D? What are images?

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 18 Nov 2019
You have
F=[];
inside the loop, so you are throwing away all of the F contents except for the last image.

Community Treasure Hunt

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

Start Hunting!