
Fake Currency detection project
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Unrecognized function or variable 'A'.
Error in fake2 (line 76)
for n=1 :size(A,1) % i GET THE ERROR IN THIS LINE A IS 'ROI-Extract Texture & Statistical Features
i am attaching my project file... could anyone help me to resolve the error in my code?
Actually I am strugling from long time to remove the error but I couldn't figureout the solution. please help.
0 commentaires
Réponse acceptée
Image Analyst
le 13 Avr 2023

Your Avg is 157, hence none of the if statements gets entered and none of your mat files get loaded.
Avg=mean2(Igray);
if(Avg>202 && Avg < 207)
load 100.mat
elseif(Avg > 175 && Avg<180)
load 200.mat
elseif(Avg>190 && Avg<195)
load '500.mat'
elseif(Avg>209 && Avg<214)
load '2000.mat'
end
I presume (the poorly-named) "A" is in one of those mat files, like we said in your duplicate post. The code and algorithm are really fragile otherwise, but at least you can alert yourself to the problem by changing it to:
Avg=mean2(Igray);
if(Avg>202 && Avg < 207)
load 100.mat
elseif(Avg > 175 && Avg<180)
load 200.mat
elseif(Avg>190 && Avg<195)
load '500.mat'
elseif(Avg>209 && Avg<214)
load '2000.mat'
else
% Avg was not in any of those ranges.
errorMessage = sprintf('Error! Avg = %f\nso none of your MAT files got loaded!', Avg);
uiwait(errordlg(errorMessage))
return;
end
3 commentaires
Image Analyst
le 17 Avr 2023
What was the Avg for the case where it popped up the error? Like 208 or 174 or 214.1 or something? What mat file do you want to use in that case?
DGM
le 17 Avr 2023
Modifié(e) : DGM
le 17 Avr 2023
I wouldn't expect the average gray value of an arbitrarily-cropped uncalibrated image to be a reliable indicator of the object properties (specifically the denomination of the bill). For the Gandhi new series rupee notes, you could probably get better results if you classify based on color information instead of gray level. That presumes that all your notes come from the same series though.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Biomedical Imaging dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!