how to convert 227x227 image into 227x227x3
조회 수: 2 (최근 30일)
이전 댓글 표시
I am working on deep learning. try to use alexnet for training . but it takes 227x227x227 and i have 227x227.
댓글 수: 2
Walter Roberson
2021년 12월 3일
Your title asks about 224 x 224 to 224 x 224 x 3, but your text asks for 227 x 227 to 227 x 227 x 227 ?
The methods we would use would be different for the two.
채택된 답변
yanqi liu
2021년 12월 4일
yes,sir,may be use
% convert 227x227 image into 227x227x3
imds = imageDatastore('imagefolder','IncludeSubfolders',true,'LabelSource','foldernames');
auimds = augmentedImageDatastore(imds,'ColorPreprocessing','gray2rgb')
% or
trainingImages = imageDatastore('imagefolder',...
'IncludeSubfolders',true,...
'LabelSource','foldernames','ReadFcn',@data_preporcess);
function data = data_preporcess(file)
data = imread(file);
if ndims(data) == 2
data = cat(3, data, data, data);
end
data = double(data);
end
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!