MATLAB Answers

0

I want to recognise the purple colour Indian note as 2000 note. Please help me by the respective code format.

Asked by divya bhandari on 8 Dec 2018 at 16:37
Latest activity Commented on by Walter Roberson
on 10 Dec 2018 at 20:49
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

1 Answer

Answer by Image Analyst
on 9 Dec 2018 at 0:36

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

I am taking input from user in %%read image section.
but I am stuck at the codeline %%feature extraction.
getting error of not using uint8 at "fet=totalfeature(rgbim);".
What is the concept of HSV color ?
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.

Sign in to comment.