change size and format of images
22 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Salma Hassan
il 10 Mag 2020
Commentato: Walter Roberson
il 15 Mag 2020
I have a medical images dataset with various sizes and formats . I want to downsample all of them into 256*256 without loosing information and change all the formats into png
0 Commenti
Risposta accettata
Guillaume
il 10 Mag 2020
Assuming all the image formats (list required!) are supported by matlab, the process for each image would be:
originalimage = imread(someimagefile);
resizedimage = imresize(originalimage, [256 256]);
imwrite(resizedimage, newfilename);
Note that there are many image viewers that can do the conversion for you without you having to write a single line of code. For example, IrfanView has a batch conversion mode which can also resize images at the same time. All you'd have to do is select the images, turn resizing on and specify the final size and tell it to convert the images to png.
Also note:
"I want to downsample"
"without loosing information"
These two statements are incompatible. By definition, if you downsample you're voluntarily discarding information.
5 Commenti
Walter Roberson
il 15 Mag 2020
Salma comments to Image Analyst:
yes, exactly I want to accelerate the training process
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Data Workflows in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!