LogoVisionLog

Object Matching

Compare detected objects against the enrolled object database

The matching stage compares detected objects against the enrolled database to identify and classify them.

Overview

After detection localizes objects in a frame, matching determines which enrolled class each detection belongs to by comparing embeddings.

Matching Pipeline

StepActionOutput
1Crop detectionObject region from frame
2Extract embeddingFeature vector
3Database lookupCompare against enrolled classes
4Similarity scoringDistance/similarity values
5ClassificationBest match or unknown

Embedding Extraction

ComponentDescription
InputCropped detection region
ModelFeature extraction backbone
Output512-dimensional embedding vector

Similarity Metrics

MetricFormulaRangeBest Match
Cosine Similaritydot(a,b) / (‖a‖·‖b‖)[-1, 1]Highest
Euclidean Distance‖a - b‖[0, ∞)Lowest
Manhattan DistanceΣ|a - b|[0, ∞)Lowest

Threshold Configuration

ParameterDefaultDescription
match_threshold0.6Minimum similarity for match
unknown_threshold0.4Below this = unknown
top_k3Candidates to consider

Match Results

ScenarioConditionAction
Strong matchsimilarity ≥ thresholdReturn class label
Weak matchbelow threshold but in rangeReturn with low confidence
No matchbelow unknown thresholdMark as unknown

Database Query

Efficient similarity search:

MethodComplexityUse Case
Linear scanO(n)Small databases
KD-treeO(log n)Medium databases
FAISSO(log n)Large-scale
pgvectorO(log n)PostgreSQL integration

Match Output

FieldTypeDescription
class_idintMatched class identifier
class_namestringHuman-readable label
similarityfloatMatch confidence score
is_knownbooleanTrue if above threshold
candidatesarrayTop-k alternative matches

Multi-match Handling

When multiple enrolled classes are similar:

StrategyDescription
Top-1Return highest similarity match
Top-kReturn k best candidates
Threshold filterOnly return above threshold
Confidence deltaRequire margin between top matches

Performance Considerations

FactorImpactOptimization
Database sizeQuery timeUse indexing
Embedding dimensionMemoryDimensionality reduction
Batch matchingThroughputProcess multiple at once

Unknown Object Handling

OptionDescription
Log onlyRecord unknown for review
Collect samplesSave crops for future enrollment
AlertTrigger notification
IgnoreSkip non-matching detections

Confidence Calibration

LevelSimilarity RangeInterpretation
High≥ 0.85Very confident match
Medium0.65 - 0.85Likely correct
Low0.45 - 0.65Possible match
None< 0.45Unknown object

On this page