ORB features are used to find and match key points in images. The main metrics to check are matching accuracy and repeatability. Matching accuracy tells us how many correct matches the ORB detector finds between two images. Repeatability shows if ORB finds the same points when the image changes a bit (like rotation or lighting). These metrics matter because ORB is used in tasks like object recognition or tracking, where correct and stable matches are important.
ORB features in Computer Vision - Model Metrics & Evaluation
Start learning this pattern below
Jump into concepts and practice - no test required
For ORB feature matching, we can think of matches as either correct or incorrect. Here is a simple confusion matrix for matches:
| Predicted Match | Predicted No Match |
|-----------------|--------------------|
| True Match (TP) | False Positive (FP) |
| False Negative (FN)| True Negative (TN) |
For example, if ORB finds 80 correct matches (TP), misses 20 true matches (FN), and finds 10 wrong matches (FP), we can calculate precision and recall to understand quality.
Precision means how many of the matches ORB found are actually correct. High precision means fewer wrong matches.
Recall means how many of the true matches ORB was able to find. High recall means ORB finds most of the real matches.
Example: In a robot navigation task, high recall is important so the robot sees enough landmarks to localize itself. But too many wrong matches (low precision) can confuse it. So a balance is needed.
Adjusting ORB parameters (like number of features or matching threshold) changes this tradeoff.
Good values:
- Precision above 0.8 means most matches are correct.
- Recall above 0.7 means most true matches are found.
- Repeatability above 0.75 means ORB finds stable points under changes.
Bad values:
- Precision below 0.5 means many wrong matches, which can cause errors.
- Recall below 0.4 means ORB misses many true points, reducing usefulness.
- Low repeatability means ORB points change a lot with small image changes.
- Ignoring false matches: High number of wrong matches can look like good performance if only total matches are counted.
- Overfitting to one image pair: ORB parameters tuned for one pair may not work well on others.
- Data leakage: Using the same images for tuning and testing can give overly optimistic results.
- Ignoring image conditions: ORB performance drops with blur or lighting changes; metrics should test under varied conditions.
Your ORB feature matcher has 90% precision but only 30% recall on a set of image pairs. Is this good for a robot that needs to recognize places reliably? Why or why not?
Answer: This is not good because the low recall (30%) means ORB misses many true matches. The robot may fail to recognize places since it does not find enough correct points, even though the matches it finds are mostly correct (high precision). For reliable recognition, recall should be higher.
Practice
Solution
Step 1: Understand ORB's role
ORB is designed to detect key points (important points) in images and create descriptors that describe these points.Step 2: Compare options
The other options describe unrelated image processing tasks, not feature detection and description.Final Answer:
To find important points and describe them in images -> Option AQuick Check:
ORB = key points + descriptors [OK]
- Confusing ORB with image enhancement
- Thinking ORB compresses images
- Assuming ORB changes image colors
Solution
Step 1: Recall ORB creation syntax
The correct OpenCV function to create an ORB detector is cv2.ORB_create(), and the parameter to set number of features is nfeatures.Step 2: Check options
orb = cv2.ORB_create(nfeatures=500) uses correct function and parameter name. The other options use incorrect function names or parameter names.Final Answer:
orb = cv2.ORB_create(nfeatures=500) -> Option AQuick Check:
Use ORB_create with nfeatures [OK]
- Using wrong function name like ORB()
- Using incorrect parameter name like features
- Missing parentheses in function call
kp after running kp, des = orb.detectAndCompute(img, None)?
import cv2
img = cv2.imread('image.jpg', 0)
orb = cv2.ORB_create(nfeatures=1000)
kp, des = orb.detectAndCompute(img, None)Solution
Step 1: Understand detectAndCompute output
The detectAndCompute method returns two values: keypoints and descriptors. Keypoints are returned as a list of keypoint objects.Step 2: Match variable types
Here, kp receives the keypoints list, des receives the descriptors numpy array.Final Answer:
A list of keypoint objects -> Option BQuick Check:
kp = list of keypoints [OK]
- Thinking kp is a numpy array
- Assuming kp is a single keypoint
- Confusing descriptors with keypoints
import cv2
img = cv2.imread('image.jpg')
orb = cv2.ORB_create(nfeatures=300)
kp, des = orb.detectAndCompute(img, None)
print(len(kp))Solution
Step 1: Check image reading mode
ORB works best with grayscale images. The code reads the image without specifying grayscale, so img is color (3 channels).Step 2: Understand impact on detectAndCompute
detectAndCompute expects a single channel image; passing a color image can cause incorrect or no keypoints detected.Final Answer:
Image is not read in grayscale, causing detectAndCompute to fail -> Option CQuick Check:
Read image with cv2.imread('image.jpg', 0) [OK]
- Ignoring image color channels
- Thinking nfeatures is invalid
- Assuming mask is mandatory
Solution
Step 1: Understand nfeatures impact
nfeatures controls how many keypoints ORB tries to find. Increasing it allows more keypoints to be detected, increasing chances of matches.Step 2: Evaluate other options
Decreasing resolution reduces detail, hurting matches. Changing color space doesn't affect ORB which works on grayscale. Mask None is default and doesn't affect matches.Final Answer:
Increase the nfeatures parameter when creating the ORB detector -> Option DQuick Check:
More features = more matches [OK]
- Reducing image size to get more features
- Changing color space for ORB detection
- Misunderstanding mask parameter role
