Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
The algorithm
Grayscale template-matching invariant to rotation scale, translation, brightness and contrast
Three step filtering process
The algorithm
Step 3: normal template matching
● Probable scale known from circle sampling
● Probable rotation known from radius sampling
Pseudo Code - circularTest
mainI = imageG = templatescales = 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85radius = 0, 8, 16, 24, 32, 45
pass1, probScales = circularTest(I, G, scales, radius)pass2, probAngles = radialTest(I, G, scales, radius,
pass1, probScales)templateMatch(I, G, pass2, probScales, probAngles)
Pseudo Code
circularTest(I, G, scales, radius)
for scale = all scales resizedQ = resize Q to the scale for len = all radius
(xcen, ycen) = center of resizedQ qScore[scale, length] = getCircleAverage(resizedQ
xcen, ycen ,len) end end for all (x,y) in I for len = all radius iScore[x, y, length] = getCircleAverage(I, x, y, len) end end
Pseudo Code - circularTest cont.
for all (x,y) in I for scale = all scales
iRadiusAvgs = iScore(x,y, ...)qRadiusAvgs = qScores(scale, ...)cor = correlate(iRadiusAvgs, qRadiusAvgs)add cor to correlations
end pass1(x,y) = max(correlations) > threshold1 probableScale(x,y) = scales(index of max(correlations)) end end
Pseudo Code - radiusTest
radiusTest(I, G, scales, radius, pass1, probScales) r = largest radius for theta = all test angels (cenx, ceny) = the center of Q qScores[theta] = getRadiusAverage(Q, theta, cenx, ceny, r) end
for all (x,y) in I if pass1(x,y) iR = r * probScales(x,y) iScores[x,y,theta] = getRadiusAverage(Q, theta, x, y, iR) end end
Pseudo Code - radiusTest cont.
for all (x,y) in I if pass1(x,y) for theta = all angels iAngAvgs = iScores(x,y,...) for all orientations
shifted = shift qScores to the new orientationcor = correlate(iAngAvgs, shifted)add cor to correlations
end pass2(x,y) = max(correlations) > threshold2 probRadius = radius(index of max(correlations))
end end end end
Future work
● Partially visible cards
● Automated process for choosing scale and radius samples
● Variable viewing angles
● Real time analysis with a video camera