|
Algorithm 1: Hybrid decision-making for autonomous vehicle navigation |
|
Data: Camera frames , ArUco dictionary, edge threshold , YOLOv4 detector |
|
Result: Vehicle movement command |
| Initialize: camera, ArUco settings, YOLOv4 detector; |
| while destination not reached do |
| Capture frame ; convert to grayscale ; |
| Apply Canny edge detection → edges ; dilate ; |
| Count edge pixels: ; |
| Detect ArUco markers in → IDs, dimensions; |
| Detect objects in using YOLOv4 → class labels; |
| MarkerValid ← False; ObstacleDetected ← False; |
| foreach marker do |
| if and then |
| MarkerValid ← True; |
| end |
| end |
| foreach YOLO detection do |
| if class ∈ {person, car, bicycle, motorbike} then |
| ObstacleDetected ← True; |
| end |
| end |
| if ObstacleDetected then |
| Command ← STOP |
| else if MarkerValid && then |
| Command ← TURN RIGHT |
| else if MarkerValid && then |
| Command ← MOVE FORWARD |
| else |
| Command ← STOP |
| end |
| Display , , detections, and decision; |
| if user presses ‘q’ then |
| break; |
| end |
| end |