Computer vision object detection lets a computer find and label objects in an image or video, such as a person, backpack, phone, or chair. In a school project, a webcam and a pre-trained model like YOLO or MobileNet can turn a laptop into a real-time detector. This matters because the same idea is used in robotics, self-driving cars, assistive technology, factory inspection, and security systems.
The main goal is to understand how an image becomes data that a model can analyze and turn into labeled bounding boxes.
Key Facts
- Object detection answers two questions: what object is present and where is it located.
- A bounding box is often stored as x, y, width, height, where x and y locate one corner or the center of the box.
- Confidence score = the model's estimated probability that a detected object belongs to a predicted class.
- IoU = area of overlap / area of union, used to compare a predicted box with the correct box.
- Precision = true positives / (true positives + false positives), which measures how many predicted detections were correct.
- Recall = true positives / (true positives + false negatives), and mAP summarizes detection accuracy across classes and confidence thresholds.
Vocabulary
- Object Detection
- A computer vision task where a model identifies objects in an image and marks their locations with boxes.
- Bounding Box
- A rectangle drawn around a detected object to show where the model thinks the object is located.
- Inference
- The process of using a trained model to make predictions on new images or video frames.
- Confidence Score
- A number that shows how sure the model is about a predicted object label.
- Mean Average Precision
- A common object detection score that combines precision results across object classes and detection thresholds.
Common Mistakes to Avoid
- Confusing classification with detection. Classification labels the whole image, while detection labels and locates each object with a bounding box.
- Using a confidence threshold that is too low. This can create many false detections because the model is allowed to report guesses it is not very sure about.
- Ignoring lighting and camera angle. Poor lighting, blur, and blocked objects can reduce accuracy even when the code and model are correct.
- Evaluating only by looking at the screen. Visual results are useful, but students should also calculate metrics such as precision, recall, IoU, or mAP to compare performance.
Practice Questions
- 1 A model detects 18 objects in a video clip. Of these, 14 are correct and 4 are false detections. What is the precision?
- 2 A predicted bounding box overlaps the correct box by 1200 square pixels. The total union area of the two boxes is 2000 square pixels. What is the IoU?
- 3 A webcam detector works well on desks and chairs in a bright classroom but fails in a dim hallway. Explain two reasons this might happen and one way to improve the project.