I am getting Subscripted assignment dimension mismatch in the following code.
1 view (last 30 days)
fprintf('Extracting features... ');
n1=145;%set n1 value
s = strcat('C:\Users\om\Desktop\abhinav\a (', int2str(a), ').jpg');
%I = imresize(imread(s),[512 NaN]);
faceDetector = vision.CascadeObjectDetector();
bbox = step(faceDetector, I);
fprintf('Total %d faces found. Beginning comparison.. \n', size(bbox,1));
fprintf('Face %d -> ', b);
X = imcrop(I,bbox(b,:));
I1 = imresize(X,[dim dim]);
J = rgb2gray(I1);
T(temp,:) = hog_feature_vector(J);
The error is in "T(temp,:) = hog_feature_vector(J);" I have hog_feature_vecture(IMG) already made and its working perfect. Please help. Edit 1. Attached hog_feature_vector.m . Sorry for not attaching earlier.
J. Webster on 22 Apr 2016
Gonna be hard to troubleshoot this without seeing what hog_features_vector() returns, or what the dimensions of T are.
my guess is that you are trying to insert a row where you should be inserting a column, of vice versa.
x = rand(5,10);
y = rand(10,1);
x(1,:) = y; %No error, all is ok since the second dimension of x matches the length 0f y
x(:,1) = y; %Error, subscripted assignment mismatch... because the 1st dimension of x is ony 5