hi
i have a table named "image" in my database where i am storing fingerprints.
i have a matching and finding code in C# and both of them work perfectly well.
Let me give u an idea about how the matching is done...there are two images(picturebox) Query and Template....when i load both of these with fingerprint it matches perfectly.
i have created a folder in which there are many fingerprint images and when i load a query image and click match it gives me the perfect match (by scanning that folder) and returns the image name.
NOW
the problem is that i want to scan images from database i.e. i want that after loading the query image in the picturebox and when i click find , it should scan each image that i have stored in my database , find the perfect match and it should after matching retrieve all the data related to that image(Eg: ID,name,email,contact...etc)
below is the code for find button:
private void btnFind_Click(object sender, EventArgs e)
{
{
double score;
{
string path = @"D:\db";
string dir = Path.GetFileNameWithoutExtension(path);
string[] filess = Directory.GetFiles(path, "*.tif*" , System.IO.SearchOption.AllDirectories);
MessageBox.Show(dir);
for (var i = 0; i < filess.Length; i++)
{
var item = filess[i];
tImage = ImageLoader.LoadImage(filess[i]);
pbxTemplateImg.Image = tImage;
{
string shortFileName = Path.GetFileNameWithoutExtension(filess[i]);
try
{
tFeatures = provider.GetResource(shortFileName, repository);
}
catch (Exception)
{
MessageBox.Show("Unable to load features " + provider.GetSignature() + ". Try using different parameters.", "Feature Loading Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
if (qImage == null)
{
MessageBox.Show("Unable to match fingerprints: Unassigned query fingerprint!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (tImage == null)
{
MessageBox.Show("Unable to match fingerprints: Unassigned template fingerprint!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
List<MinutiaPair> matchingMtiae = null;
IMinutiaMatcher minutiaMatcher = matcher as IMinutiaMatcher;
if (minutiaMatcher != null)
{
score = minutiaMatcher.Match(qFeatures, tFeatures, out matchingMtiae);
if (qFeatures is List<Minutia> && tFeatures is List<Minutia>)
{
pbxQueryImg.Image = qImage.Clone() as Bitmap;
Graphics g1 = Graphics.FromImage(pbxQueryImg.Image);
ShowBlueMinutiae(qFeatures as List<Minutia>, g1);
Graphics g2 = Graphics.FromImage(pbxTemplateImg.Image);
ShowBlueMinutiae(tFeatures as List<Minutia>, g2);
if (score == 0 || matchingMtiae == null)
MessageBox.Show(string.Format("Similarity: {0}.", score));
else
{
List<Minutia> qMtiae = new List<Minutia>();
List<Minutia> tMtiae = new List<Minutia>();
foreach (MinutiaPair mPair in matchingMtiae)
{
qMtiae.Add(mPair.QueryMtia);
tMtiae.Add(mPair.TemplateMtia);
}
IFeatureDisplay<List<Minutia>> display = new MinutiaeDisplay();
display.Show(qMtiae, g1);
pbxQueryImg.Invalidate();
display.Show(tMtiae, g2);
pbxTemplateImg.Invalidate();
if (score > 70)
{
MessageBox.Show(string.Format("Similarity: {0}. Matching minutiae: {1}.", score,
matchingMtiae.Count));
}
}
}
else
ShowResults(score, matchingMtiae);
}
else
score = matcher.Match(qFeatures, tFeatures);
if (score < 70)
{
}
else
{
MessageBox.Show("match found");
break;
}
}
}
}
}