I want to recognise the purple colour Indian note as 2000 note. Please help me by the respective code format.
2 views (last 30 days)
Show older comments
code to recognise the new Indian currency notes by determining their colour or dimensions.
I tried this:
but it has some error
%% read image
[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);
for j=1:k
D(j)=dist(fet',currency(j).feature);
end
[value,index]=min(D)
if value
currency_name=currency(index).name;
fprintf('recognized currency is : ');
disp(currency_name)
else
disp('no matches found');
end
2 Comments
Walter Roberson
on 10 Dec 2018
totalfeature appears to be from https://www.mathworks.com/matlabcentral/fileexchange/47143-currency-recognition
Answers (1)
Image Analyst
on 9 Dec 2018
You forgot to attach any image. But I'd suggest using the Color Thresholder App on the Apps tab of the tool ribbon. Choose HSV color space.
2 Comments
Image Analyst
on 10 Dec 2018
I don't know what totalfeature() is - it's not a function built in to MATLAB.
HSV is a color space like my icon to the left, where dark to light (Value) is vertical, colors of the rainbow (Hue) go around the circumference, and S (Saturation) is the distance from the center Z axis. Saturation is like how pure the color is - how much white is mixed in with it. Neutral things are gray. Low saturation things are pastel (pink, mint green, sky blue, etc.). And high saturation things are your really pure, vivid colors. Saturation is 0 for neutral colors (grays), pink is a saturation of like 0.5 while pure deep red is a saturation of 1.
Just do a web search and you'll get lots of pages explaining HSV color space.
See Also
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!