feature extraction
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Shiwani Sawant
el 7 de Feb. de 2011
Respondida: Noel Mfinanga
el 22 de Jul. de 2020
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 comentarios
Respuesta aceptada
Brett Shoelson
el 7 de Feb. de 2011
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 comentarios
Brett Shoelson
el 14 de Feb. de 2011
That's where the histogramming comes in. Did you try that?
Brett
Más respuestas (1)
Ver también
Categorías
Más información sobre Language Support en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!