The Visionary Researcher

임시 저장 1건이 검색되었습니다.

IMAGE_DIM = 256;
mean_im = zeros(IMAGE_DIM, IMAGE_DIM, 3);
num = 0;
for nNumFolder = 0:42
    loadFolder = num2str(nNumFolder, '%05d');
    imgs = dir([loadFolder, '\*.ppm']);
    num_imgs = length(imgs);
    for i = 1 : num_imgs
        im = imread([loadFolder, '\', imgs(i).name]);
        im = im(:, :, [3, 2, 1]);  % permute channels from RGB to BGR
        im = permute(im, [2, 1, 3]);  % flip width and height
        im = single(im);  % convert from uint8 to single
        im = imresize(im, [IMAGE_DIM IMAGE_DIM], 'bilinear');  % resize im_data
        mean_im = mean_im + im;
    end
    num = num + num_imgs;
end
mean_im = mean_im / num;


'임시 저장' 카테고리의 다른 글

matcaffe 코드 임시  (0) 2016.05.11

Comment 0