Created
July 21, 2013 03:59
-
-
Save vertexclique/6047425 to your computer and use it in GitHub Desktop.
Matlab toplu resim import kodu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% load if and only if jpg... | |
imagepath = '/Users/vertexclique/Desktop/SAMPLES'; | |
patternname = '*.jpg'; | |
imagelist = dir(fullfile(imagepath,patternname)); | |
imdata = cell(1,numel(imagelist)); | |
parfor k=1:numel(imagelist) | |
imdata{k} = imread(fullfile(imagepath,imagelist(k).name)); | |
end | |
%% ...if not convert to jpg | |
imagepath = '/Users/vertexclique/Desktop/SAMPLES'; | |
patternname1 = '*.png'; | |
patternname2 = '*.bmp'; | |
patternname3 = '*.tiff'; | |
imagelist1 = dir(fullfile(imagepath,patternname1)); | |
imagelist2 = dir(fullfile(imagepath,patternname2)); | |
imagelist3 = dir(fullfile(imagepath,patternname3)); | |
parfor k=1:numel(imagelist1) | |
varpng = imread(fullfile(imagepath,imagelist1(k).name)); | |
varjpg1 = imwrite(var1 , imagelist1(k)+'.jpg' , 100); | |
% dosyaya yazın veya başka değişkene kopyalayın | |
end | |
parfor k=1:numel(imagelist2) | |
varbmp = imread(fullfile(imagepath,imagelist2(k).name)); | |
varjpg2 = imwrite(var1 , imagelist2(k)+'.jpg' , 100); | |
% dosyaya yazın veya başka değişkene kopyalayın | |
end | |
parfor k=1:numel(imagelist3) | |
vartiff = imread(fullfile(imagepath,imagelist3(k).name)); | |
varjpg3 = imwrite(var1 , imagelist3(k)+'.jpg' , 100); | |
% dosyaya yazın veya başka değişkene kopyalayın | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment