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?
Ältere Kommentare anzeigen
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 Kommentar
Walter Roberson
am 22 Mär. 2022
https://www.mathworks.com/matlabcentral/fileexchange/90840-jpeg-baseline-matlab-code might help with the jfif perhaps
Antworten (2)
Image Analyst
am 22 Mär. 2022
Bearbeitet: Image Analyst
am 22 Mär. 2022
imformats
DGM
am 22 Mär. 2022
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.
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!