I have a Folder with subfolders of images. The subfolders consist of .JPG, .jpg and .jfif, I need them all to be converted to a single format and returned to their folders?
8 次查看(过去 30 天)
显示 更早的评论
imds = imageDatastore('batch_9','IncludeSubfolders',true,'LabelSource','foldernames');
segIm = pixelLabelDatastore('PixelLabelData');
Error using imageDatastore (line 139)
Input folders or files contain non-standard file extensions.
Use FileExtensions Name-Value pair to include the non-standard file extensions.
Error in Segmenattion (line 9)
imds = imageDatastore('batch_9','IncludeSubfolders',true,'LabelSource','foldernames');
I have a labelled pixel data for sematic segmenattion but the images that I have manually segmented are different formats so I cannot create an imageDataStore from the image files so that I can train a sematic segmentation network. Does anyone know how to change the file format of each image in the subfolders of batch_9 and replace them with the new common image files to their original folders?
1 个评论
Walter Roberson
2022-3-22
https://www.mathworks.com/matlabcentral/fileexchange/90840-jpeg-baseline-matlab-code might help with the jfif perhaps
回答(2 个)
DGM
2022-3-22
At least with the JFIF files I have, imread() has no problem reading them. imageDatastore() ignores them, but throws no error (maybe version differences). If I use the 'fileextensions' option as the message suggests, it picks them up and reads them just fine. Using readimage() works fine on them.
fext = {'.jpg','.jfif'}; % case-insensitive
imds = imageDatastore('./','IncludeSubfolders',false,'fileextensions',fext);
I haven't run across any files that have any issues with this, but maybe it's possible.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!