currency recognition using image Processing Techniques in matlab

조회 수: 3 (최근 30일)
sneha sharavan
sneha sharavan 2022년 1월 27일
댓글: sneha sharavan 2022년 1월 27일
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
KSSV
KSSV 2022년 1월 27일
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 2022년 1월 27일
i downloaded Deep learning toolbox and its working now . Thanks.

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2022년 1월 27일
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
sneha sharavan
sneha sharavan 2022년 1월 27일
THe currency is added in Db. any idea on this?
sneha sharavan
sneha sharavan 2022년 1월 27일
It is working now. no problem . thanks

댓글을 달려면 로그인하십시오.


KSSV
KSSV 2022년 1월 27일
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