|
|
|
@ -4,7 +4,7 @@ description: Learn how to use Ultralytics YOLOv8 for precise object counting in |
|
|
|
|
keywords: object counting, regions, YOLOv8, computer vision, Ultralytics, efficiency, accuracy, automation, real-time, applications, surveillance, monitoring |
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
# Object Counting in Different Regions using Ultralytics YOLOv8 🚀 |
|
|
|
|
# Object Counting in Different Regions using Ultralytics YOLO 🚀 |
|
|
|
|
|
|
|
|
|
## What is Object Counting in Regions? |
|
|
|
|
|
|
|
|
@ -40,6 +40,7 @@ keywords: object counting, regions, YOLOv8, computer vision, Ultralytics, effici |
|
|
|
|
|
|
|
|
|
```python |
|
|
|
|
import cv2 |
|
|
|
|
|
|
|
|
|
from ultralytics import solutions |
|
|
|
|
|
|
|
|
|
cap = cv2.VideoCapture("Path/to/video/file.mp4") |
|
|
|
@ -52,7 +53,7 @@ keywords: object counting, regions, YOLOv8, computer vision, Ultralytics, effici |
|
|
|
|
# pass region as dictionary |
|
|
|
|
region_points = { |
|
|
|
|
"region-01": [(50, 50), (250, 50), (250, 250), (50, 250)], |
|
|
|
|
"region-02": [(640, 640), (780, 640), (780, 720), (640, 720)] |
|
|
|
|
"region-02": [(640, 640), (780, 640), (780, 720), (640, 720)], |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Video writer |
|
|
|
|