currency recognition using image Processing Techniques in matlab

1 visualización (últimos 30 días)
sneha sharavan
sneha sharavan el 27 de En. de 2022
Comentada: sneha sharavan el 27 de En. de 2022
I am getting "Unrecognized function or variable 'dist'".
Is there an atler for dist or what should i change in this code for it to work.
clear all;
close all;
clc;
[imname,impath]=uigetfile({'*.jpg;*.png'});
im=imread([impath,'/',imname]);
%preprocessing
%resize image
im=imresize(im,[128 128]);
%remove noise;
%seperate channels
r_channel=im(:,:,1);
b_channel=im(:,:,2);
g_channel=im(:,:,3);
%denoise each channel
r_channel=medfilt2(r_channel);
g_channel=medfilt2(g_channel);
b_channel=medfilt2(b_channel);
%restore channels
rgbim(:,:,1)=r_channel;
rgbim(:,:,2)=g_channel;
rgbim(:,:,3)=b_channel;
%featureextraction
fet=totalfeature(rgbim);
load db;
k=length(currency);
%disp(k);
for j=1:k
% disp(j)
D(j)=dist(fet',currency(1,j).feature);
end
[value,index]=min(D);
if value<.001
currency_name=currency(index).name;
fprintf('recognized currency is : ');
disp(currency_name)
else
disp('no matches found');
end
  2 comentarios
KSSV
KSSV el 27 de En. de 2022
To have the function dist you need to have nnet toolbox. Do you have it? Try
which dist
/MATLAB/toolbox/nnet/nnet/nndistance/dist.m
sneha sharavan
sneha sharavan el 27 de En. de 2022
i downloaded Deep learning toolbox and its working now . Thanks.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 27 de En. de 2022
You seem to be using https://www.mathworks.com/matlabcentral/fileexchange/47143-currency-recognition which does not define a dist() function
There is a dist() function that is part of the Neural Network Toolbox, which might possibly be the one being used.
  4 comentarios
sneha sharavan
sneha sharavan el 27 de En. de 2022
THe currency is added in Db. any idea on this?
sneha sharavan
sneha sharavan el 27 de En. de 2022
It is working now. no problem . thanks

Iniciar sesión para comentar.


KSSV
KSSV el 27 de En. de 2022
dist is a simple function, this calculates Euclidean distance weight function. You can do it on your own.
The Euclidean distance d between two vectors X and Y is:
d = sum((x-y).^2).^0.5
Tha above is taken from the docmunetation. You can read it and make a function on your own.

Community Treasure Hunt

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

Start Hunting!

Translated by