The following code proceeds quickly (200 images/sec) until around the 12,000th read at which point the read time increases by roughly 10% per 200 reads flattening out at about 20 images/sec.
There are 1.4×10^6 images in the directory.
At the initial rate of 200/sec execution would take 2 hours to complete.
At the rate read settles to it would take 20 hours.
pxds = pixelLabelDatastore('directory', classes, LabelIDs);parfor r = 1:length(pxds.Files); img_holder{r} = uint8(ones(200,200));endcounter = 1;while hasdata(pxds); img_holder{counter} = uint8(read(pxds)); counter = counter + 1;end
Best Answer