How can i use datastore (mat-files) in map function?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have 2000 images, and each of them has a mat-file with the following matrices(struct) as image info:
the struct for each image is ( x is variable for each images):
desc: [x * 128 double]
locs: [x * 4 double]
color_hist: {1 * x cell}
color_hist has x vectors as [1 * 11 double]
I used the following statement for creating datastore:
ds = fileDatastore(fullfile(pwd,'property'),'ReadFcn',@load,'FileExtensions','.mat')
Now, i want to compare the first image info with another images, but i don't know how can i access images info in map function, separately, for comparing images.
for example, the following map function :
function maxMapper(data, ~, intermKVStore)
t = data.desc;
struct(t)
end
output is:
Error using maxMapper (line 7)
Reference to non-existent field 'desc'.
Error in mapreduce (line 99)
outds = execMapReduce(mrcer, ds, mapfun, reducefun, parsedStruct);
Error in MapReduce (line 151)
result = mapreduce(ds, @maxMapper, @maxReducer);
Is there a nice way to do this?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur MapReduce dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!