numImages = numel(trainingSet.Files);
trainingFeatures = zeros(numImages, hogFeatureSize, 'single');
for i = 1:numImages
img = readimage(trainingSet, i);
img = rgb2gray(img);
% Apply pre-processing steps
img = imbinarize(img);
trainingFeatures(i, :) = extractHOGFeatures(img, 'CellSize', cellSize);
end
错误是
订阅的分配维度不匹配。
Untitled3中的错误(第119行)
trainingFeatures(i,:) = extractHOGFeatures(img,'CellSize',cellSize);