Skip to main content
. 2026 Oct 19;26(20):6626. doi: 10.3390/s26206626
Algorithm 1: Hybrid decision-making for autonomous vehicle navigation
Data: Camera frames F, ArUco dictionary, edge threshold Tedges, YOLOv4 detector
Result: Vehicle movement command
Initialize: camera, ArUco settings, YOLOv4 detector;
while destination not reached do
  Capture frame F; convert to grayscale G;
  Apply Canny edge detection → edges E; dilate E;
  Count edge pixels: Nedges;
  Detect ArUco markers in G → IDs, dimensions;
  Detect objects in F using YOLOv4 → class labels;
  MarkerValid ← False; ObstacleDetected ← False;
  foreach marker do
    if wmarker≥17 and hmarker≥19 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 && Nedges>Tedges then
    Command ← TURN RIGHT
  else if MarkerValid && Nedges≤Tedges then
    Command ← MOVE FORWARD
  else
    Command ← STOP
  end
  Display F, E, detections, and decision;
  if user presses ‘q’ then
    break;
  end
end