feature extraction
조회 수: 3 (최근 30일)
이전 댓글 표시
hi,i m working on coin recognition using feature extraction.i need the basic startup steps.i hv read a good deal on it.bt still it would be great if i wud get some small programs for any of feature extraction,chaincodes,texture computation,etc. to refer to.
댓글 수: 0
채택된 답변
Brett Shoelson
2011년 2월 7일
Hi Shiwani,
I frequently present an advanced image processing course with coin recognition as the over-arching goal. Here are some ideas to get you started:
Basically, you'll want to start by measuring with a ruler or micrometer the coins you want to differentiate. Then, in the image of the coins, start with preprocessing; perhaps some noise reduction (MEDFILT2), perhaps normalization of illumination (IMTOPHAT). Then, you'll want to segment the coins using whatever segmetnation approahc makes sense. If the coins are touching, consider watershed transforms (WATERSHED; read this: http://www.mathworks.com/company/newsletters/news_notes/win02/watershed.html). Otherwise, if the coins are readily discernible from the bacground, perhaps simple thresholding will suffice (IM2BW, GRAYTHRESH). Clean up the mask of your coins; REGIONPROPS will be very useful. (Discard anything that is too large, too small, or too eccentric.) It will be very helpful to establish a length scale; perhaps you know the size of some object in the field of view? Once you have that, do some more blob analysis to calculate the sizes of the coin blobs. Scale those sizes (areas, equivalent diameters, or circumferences, or whatever measure you want to use) to actual (non-pixel) dimensions by multiplying by comparing to the object of know size. Then histogram the actual sizes of the detected coins, and calculate how many of each you have. Your histogram code might look like this:
[dollar,halfdollar,quarter,dime,nickel,penny] = ...
deal(PixPerInch * 67/64, ...
PixPerInch * 78/64, ...
PixPerInch * 60/64, ...
PixPerInch * 45/64, ...
PixPerInch * 54/64, ...
PixPerInch * 48/64); % Approx. coin sizes in 64ths of an inch
% SIZE-WISE: dimes, pennies, nickels, quarters, dollars, half-dollars
coinSizes = sort([dollar,halfdollar,quarter,dime,nickel,penny],'ascend');
L = bwlabel(objMask); %objMask is your segmented coin image
stats = regionprops(L, {'EquivDiameter', 'Centroid'});
sz = [stats.EquivDiameter];
X = sort(sz);
n = hist(X, coinSizes);
value = n(1) * 0.10 + ...
n(2) * 0.01 + ...
n(3) * 0.05 + ...
n(4) * 0.25 + ...
n(5) * 1.00 + ...
n(6) * 0.50;
HTH!
Brett
댓글 수: 2
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Language Support에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!