필터 지우기
필터 지우기

feature extraction

조회 수: 3 (최근 30일)
Shiwani Sawant
Shiwani Sawant 2011년 2월 7일
답변: Noel Mfinanga 2020년 7월 22일
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.

채택된 답변

Brett Shoelson
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
Shiwani Sawant
Shiwani Sawant 2011년 2월 14일
Thanks Brett,I hv tried a simple approach 4 coin recognition using radius computation and comparison.I hv written the code 4 radius computation.But m stuck up with a function to compare the radius.I used the 'isequal' fnction.It works well for comparison of numbers of upto 4 decimal places in the command window.But when used in my code,it gives me wrong answer...Can u help me?Or suggest any other fnction for the same?
Brett Shoelson
Brett Shoelson 2011년 2월 14일
That's where the histogramming comes in. Did you try that?
Brett

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

추가 답변 (1개)

Noel Mfinanga
Noel Mfinanga 2020년 7월 22일
How can I extract lake from a Landsat images

카테고리

Help CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by