Identify a subject by matching a dental query image against the database.
Use this skill to find the identity of an unknown subject ("John Doe") by comparing their post-mortem (PM) dental X-ray against the database of ante-mortem (AM) records.
DentalID.Core.Interfaces.IMatchingService (Vector Matching)DentalID.Core.Interfaces.IAiPipelineService (Feature Extraction)DentalID.Core.DTOs.DentalFingerprint (Biometric Data)Extract Features (Query):
FeatureVector.IAiPipelineService.ExtractFeaturesAsync(stream).FeatureVector is not null and has length 2048 (default embedding size).Prepare Probe:
DentalFingerprint object.Code to "PROBE".FeatureVector to the extracted float array.Optimization: Smart Filtering:
FindMatches, filter the candidates list.
AnalysisResult.EstimatedGender is "Male", exclude all "Female" subjects (allow "Unknown").EstimatedAge is 30, exclude subjects < 10 or > 80 (allow margin of error +/- 15 years).Execute Match:
IMatchingService.FindMatches(probe, filteredCandidates).Evaluate Results:
Score (0.0 to 1.0).> 0.80: High Probability Match.0.60 - 0.79: Possible Match (Requires manual review).< 0.60: Inconclusive / No Match.public async Task<List<MatchCandidate>> IdentifyUnknown(string queryImagePath, IAiPipelineService ai, IMatchingService matcher, IEnumerable<Subject> database)
{
// 1. Extract
using var stream = File.OpenRead(queryImagePath);
var (vector, error) = await ai.ExtractFeaturesAsync(stream);
if (vector == null) throw new Exception("Feature extraction failed");
// 2. Probe
var probe = new DentalFingerprint { FeatureVector = vector };
// 3. Match
var matches = matcher.FindMatches(probe, database);
// 4. Report Top Match
var best = matches.FirstOrDefault();
if (best != null && best.Score > 0.85)
{
Console.WriteLine($"POSITIVE ID: {best.Subject.FullName} ({best.Score:P1})");
}
return matches;
}