Struct contents reference from a non-struct array object.

11 vues (au cours des 30 derniers jours)
Shah Bano
Shah Bano le 22 Mar 2019
Commenté : Jan le 22 Mar 2019
I am writting a code and in the last line of the code it shows the error "Struct contents reference from a non-struct array object.". Here is my code:
fic='cam2_person015.png';
img=imread(fic);
ti=size(img);
figure(1)
imshow(img);
normImage = mat2gray(img);
figure; imshow(normImage);
[x,y] = find(img);
lambda = 10.^(-9);
% lambda = eig(shadow);
meu = 10.^6;
H = heaviside(-y);
e = 1;
ee = e.^-((sqrt(x)/2.*sqrt(lambda))+(sqrt(y)/2.*sqrt(meu)));
anisotrophic_filter = img.*normImage.H.x.ee;
Kinldy check this. I shall be very thankful for the kind act of consideration.
  6 commentaires
Shah Bano
Shah Bano le 22 Mar 2019
Now it gives the error
Error using .*
Matrix dimensions must agree.
Error in RSD_HOG (line 22)
anisotrophic_filter = img.*normImage.*H.*x.*ee;
Jan
Jan le 22 Mar 2019
@Shah Bano: Then use the debugger to check the sizes of the array. We cannot guess this detail.
By the way, 10.^(-9) is an expensive power operation, while 1e-9 is a cheap constant. The runtime will not matter here, but it is a good programming practice.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by