Create a struct that contain ABCD features for an image dataset
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hend Abouche
il 12 Mag 2022
Commentato: Hend Abouche
il 12 Mag 2022
Hello guys, I've been trying to import the ABCD features of all my image dataset but when I open the csv file I only find one row and I don't know how I can fix it
imds = imageDatastore(Source,"IncludeSubfolders",true,"FileExtensions",".jpg");
imds1 = imageDatastore(Source1,"IncludeSubfolders",true,"FileExtensions",".jpg");
% lire toutes les images avec une boucle
for i= 1 :size(imds.Files,1)
I = readimage(imds,i);
gray=rgb2gray(I);
binaryImage=imbinarize(rescale(gray));
binaryImage = bwareafilt(binaryImage, 1);
segmented=readimage(imds1,i);
asymmetry=ASYMMETRY(binaryImage,segmented);
Colors_Score=Couleur(segmented);
Borders=borders(binaryImage);
Diameter=diameter(binaryImage);
ABCD_Features.Asymmetry1=asymmetry.A1;
ABCD_Features.Asymmetry2=asymmetry.A2;
ABCD_Features.Color=Colors_Score;
ABCD_Features.Border1=Borders.B1;
ABCD_Features.Border2=Borders.B2;
ABCD_Features.Border3=Borders.B3;
ABCD_Features.Diameter1=Diameter.D1;
ABCD_Features.Diameter2=Diameter.D2;
ABCD_Features=struct2table(ABCD_Features);
writetable( ABCD_Features, 'ABCD_Features.csv');
end
ASYMMETRY, Couleur, Borders and diamter are my functions that I use, I will be very grateful if you can help me with this
0 Commenti
Risposta accettata
Image Analyst
il 12 Mag 2022
You need to tack on that table to a growing one.
imds = imageDatastore(Source,"IncludeSubfolders",true,"FileExtensions",".jpg");
imds1 = imageDatastore(Source1,"IncludeSubfolders",true,"FileExtensions",".jpg");
% lire toutes les images avec une boucle
for i= 1 :size(imds.Files,1)
I = readimage(imds,i);
gray=rgb2gray(I);
binaryImage=imbinarize(rescale(gray));
binaryImage = bwareafilt(binaryImage, 1);
segmented=readimage(imds1,i);
asymmetry=ASYMMETRY(binaryImage,segmented);
Colors_Score=Couleur(segmented);
Borders=borders(binaryImage);
Diameter=diameter(binaryImage);
ABCD_Features.Asymmetry1=asymmetry.A1;
ABCD_Features.Asymmetry2=asymmetry.A2;
ABCD_Features.Color=Colors_Score;
ABCD_Features.Border1=Borders.B1;
ABCD_Features.Border2=Borders.B2;
ABCD_Features.Border3=Borders.B3;
ABCD_Features.Diameter1=Diameter.D1;
ABCD_Features.Diameter2=Diameter.D2;
thisTable = struct2table(ABCD_Features);
% Add this table on to our growing, master table.
if i == 1
masterTable = thisTable;
else
masterTable = [masterTable; thisTable];
end
end
% Write out master table.
writetable( ABCD_Features, 'ABCD_Features.csv');
It's untested so it might need some debugging.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Import and Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!