I want to recognise the purple colour Indian note as 2000 note. Please help me by the respective code format.
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2018년 12월 10일
totalfeature appears to be from https://www.mathworks.com/matlabcentral/fileexchange/47143-currency-recognition
답변 (1개)
Image Analyst
2018년 12월 9일
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
Image Analyst
2018년 12월 10일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!