How can i use datastore (mat-files) in map function?
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on MapReduce 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!