Hi
I want to know how to resize images 200 x 200 to 100 x 100 without deforming the images in this code
close all;clc; %% Initalize the data
dataDir= fullfile('Data/');exts = {'.jpg','.png','.tif','BMP'}; imds = imageDatastore(fullfile(dataDir),...'IncludeSubfolders',true,'FileExtensions','.jpg','LabelSource','foldernames');countEachLabel(imds); [TrainData, TestData] = splitEachLabel(imds, 0.5);size(TrainData);countEachLabel(TrainData);numImages = numel(TrainData.Files); for i = 1:numImages img = readimage(TrainData, i);% img2= imshow(img, 'InitialMagnification', 800);
img3= imresize(img, [100 100]); img4= imshow(img3, 'InitialMagnification', 800); drawnow; Train{i} = (img3); %#ok<SAGROW>
end
Best Answer