Back to Image Processing

Object Detection: Classical CV vs YOLOv8n

Comparative Study · Same Image Set, Two Pipelines

Abstract

Two object-detection pipelines run on the same nine public-domain test images so the strengths and failure modes of each are easy to read off. Pipeline 1 is a classical edge-and-contour pipeline (Gaussian blur, Canny, morphological close, contour bounding boxes). Pipeline 2 is YOLOv8n pretrained on COCO. The classical pipeline locates regions; the deep-learning pipeline classifies them. Each pipeline wins in different regimes, and the comparison makes those regimes explicit.

Pipeline 1 — Classical CV

Gaussian blur (5 × 5)
  → Canny edge detection (50, 150)
  → morphological close (5 × 5 rect kernel)
  → external contour finding
  → bounding box for every contour with area ≥ 500 px²

Detections are unlabelled. The pipeline cares about where the boundaries are, not what is bounded.

Pipeline 2 — YOLOv8n on COCO

Inference via the ultralytics package, confidence threshold 0.20. The COCO class set covers 80 categories: people, animals, vehicles, common indoor and outdoor objects. Detections come with class labels and confidence scores. Anything outside the 80-class vocabulary is invisible to the model.

Results Across the Nine Images

Image Classical YOLOv8n YOLO classes
airplane11airplane
cameraman11person
crowd1118person, book
houses30— (no relevant COCO class)
lenna32person, umbrella
pepper18apple, banana
sailboat91bird
tiffany101person
yacht28boat, person

Where Each Pipeline Wins

  • YOLOv8n wins when scenes contain COCO categories with strong prototypical structure. The crowd image (17 people plus a book) and the yacht image (boat plus person) recover semantically meaningful counts the classical pipeline only sees as edge clusters.
  • Classical wins when the objects are structural rather than semantic. The houses image returns three rectangular regions; YOLO has no "house" class in the COCO vocabulary and reports zero detections.
  • Both miss the same way on the sailboat image: classical over-counts ripples on the water, YOLO mistakes a sail for a bird because the COCO bird examples include white-on-blue silhouettes.
  • Pepper is an instructive failure: bell peppers are not in COCO, so YOLO recruits the closest visual prototypes (apple, banana). Classical sees one large blob.

Side-by-Side Comparisons

Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the airplane test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the cameraman test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the crowd test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the houses test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the lenna test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the pepper test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the sailboat test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the tiffany test image
Side-by-side comparison: classical CV bounding boxes (left) and YOLOv8n classified detections with confidence scores (right) on the yacht test image

Summary Across the Set

Two-panel summary: detections per image per pipeline, and the top YOLOv8n classes called across the full test set

Detections per image per pipeline (left), and top YOLOv8n classes across the test set (right).