how i extract features from my image datastore?

5 visualizaciones (últimos 30 días)
youb mr
youb mr el 13 de Abr. de 2020
Respondida: Rahul el 4 de Dic. de 2024
hello everyone
i'm trying to extract logical binary pattern from image datastore
this my code
imds = imageDatastore(rootFolder, 'IncludeSubfolders',1 ,'LabelSource', 'foldernames');
% after that i want to read the first 10 image of each subfolder i haev use this programme
for k = 1 : 10
thisFullFileName = imds.Files{k};
fprintf('Reading in %s.\n', thisFullFileName);
thisImage = readimage(imds, k);
imshow(thisImage);
drawnow;
end
how i can used extractLBPFeatures to extract feature for each image from my imagedatastore

Respuestas (1)

Rahul
Rahul el 4 de Dic. de 2024
As per the code shared by you, in order to 'extractLPBFeatures' from each image from your 'imageDatastore', the following additions can be added to your existing code:
  • Since the function 'extractLPBFeatures' expects an image, it can be used directly in your loop after reading the image from the 'imagedatastore' using 'readImage' function.
  • The extracted features can be stored in a cell array.
Hence your code can be adjusted in the following way:
imds = imageDatastore(rootFolder, 'IncludeSubfolders', true, 'LabelSource', 'foldernames');
% Initialize a cell array to store LBP features for each image
lbpFeaturesCell = cell(numel(imds.Files), 1); % Addition 1
for k = 1:numel(imds.Files)
thisFullFileName = imds.Files{k};
fprintf('Reading in %s.\n', thisFullFileName);
thisImage = readimage(imds, k);
imshow(thisImage);
drawnow;
% Extract and store LBP features- Addition 2
lbpFeatures = extractLBPFeatures(thisImage);
lbpFeaturesCell{k} = lbpFeatures;
end
The following MATLAB Answers mentions a detailed explanation of the specified additions:
The following MathWorks documentation can be referred to know more:
Thanks.

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by