Skip to main content

10 posts tagged with "python"

View All Tags

[Vision AI] Korean ANPR OCR Engine, Regex Normalization & Temporal Majority Voting (v01 to v11 Evolution) (#5)

· 3 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

Temporal Majority Voting and Final Confirmation

📌 Key Takeaways (TL;DR)

  • Problem: Single-frame OCR inevitably suffers from transient misreadings (e.g., 64아1511, 24가1511) due to vehicle yaw, glare, and vibration.
  • Solution: Implemented Korean plate regex validation (^\d{2,3}[가-힣]\d{4}$) coupled with a temporal sliding window majority voting engine across a 7-frame buffer (plate_confirm_threshold=3).
  • Result: Advanced through 11 system iterations (v01 to v11), transitioning from initial gibberish (ACCIIXOY-1Z01...) on June 5 to deterministic confirmation of 64가1511 on June 7 with 99.4% reliability.

[Vision AI] Overcoming Blurry Blackbox Artifacts: Deep Super-Resolution (EDSR vs FSRCNN) & Multi-Frame Image Stacking (#4)

· 2 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

EDSR Deep Super-Resolution Results

📌 Key Takeaways (TL;DR)

  • Problem: Cropped license plates from dashcam footage often measure under 40x20 pixels with heavy H.264 macroblocking; standard bicubic interpolation fails to resolve character contours.
  • Solution: Integrated EDSR_x4 deep residual networks (EDSR_x4.pb) that omit batch normalization to preserve dynamic range, combined with temporal multi-frame image stacking across 3 to 5 consecutive frames.
  • Result: Quadrupled plate pixel density and sharpened stroke edges, lifting downstream EasyOCR accuracy on Korean characters from 32% to over 91%.

[Vision AI] Hierarchical Object Detection: YOLOv3 Vehicle ROI, YOLOv5 Plate Detector & CSRT Tracking (#3)

· 2 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

YOLOv5 Plate Detection Localization

📌 Key Takeaways (TL;DR)

  • Problem: Searching for tiny plates (30x15 pixels) across the raw 640x480 frame generates massive false positives from roadside signs and drops inference speed below 10 FPS.
  • Solution: Designed a two-stage hierarchical architecture: broad vehicle detection (YOLOv3-tiny) crops the vehicle ROI, within which a fine-tuned YOLOv5 (lp_det.pt, conf=0.6) locates the license plate. Integrated OpenCV CSRT correlation filter tracking with a 15-frame redetection interval.
  • Result: Eliminated 98% of background false positives and slashed GPU overhead by 80%, sustaining real-time 50+ FPS continuous tracking.

[Vision AI] Dynamic Lane Boundary Extraction & Geometric IoU Intrusion Criterion (#2)

· 2 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

Dynamic Lane Detection Overlay

📌 Key Takeaways (TL;DR)

  • Problem: Dashcam footage contains heavy pavement specular reflection, tar cracks, and road shadows that induce false lane lines; simple coordinate checking cannot reliably catch the exact moment of lane encroachment.
  • Solution: Implemented vanishing-point trapezoidal ROI masking, slope thresholding (|slope| > 0.5), and a 7-frame temporal moving average queue. Formulated intrusion as geometric IoU between vehicle tire footprints and lane boundaries.
  • Result: Filtered out >95% of road texture noise while capturing vehicle lane crossing events with sub-frame accuracy.

[Vision AI] Blackbox Lane Intrusion & Super-Resolution ANPR: 6-Stage End-to-End Pipeline & Real-Time Constraints (#1)

· 3 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

6-Stage ANPR Pipeline Diagram

📌 Key Takeaways (TL;DR)

  • Problem: Low-resolution dashcam footage suffers from severe vehicle vibration, nighttime backlighting, and heavy motion blur, making direct license plate recognition and lane violation tracking extremely error-prone.
  • Solution: Designed a unified 6-stage vision architecture: Canny/Hough lane extraction -> YOLOv3 vehicle detection -> polygon IoU lane violation calculation -> YOLOv5 plate localization -> EDSR_x4 super-resolution -> EasyOCR temporal voting.
  • Result: Constructed an end-to-end Python pipeline achieving robust vehicle tracking and lane boundary monitoring even under degraded dashcam conditions.

[Webots Robotics] Sim-to-Real: Hardware Transfer via Arduino Uno, HC-06 Bluetooth & ArUco Vision Tracking (#5)

· 6 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

ArUco Marker Vision Tracking

📌 Key Takeaways (TL;DR)

  • Problem: Severe computational constraints on microcontrollers (Arduino Uno ATmega328P with only 2KB SRAM), non-linear wheel slip, noisy ultrasonic sensing, and the classical Reality Gap between Webots simulation physics and physical hardware.
  • Solution: Designed a distributed I/O architecture (HC-06 Bluetooth at 115,200 baud) where a host PC runs OpenCV vision processing and Q-Table inference while the Arduino handles low-level PWM motor actuation. Overhead camera lens distortion correction and ArUco marker homography (vision.py) deliver sub-centimeter real-time (x, y, θ) tracking.
  • Result: Zero-shot transfer of the simulation-trained 648-state Q-Table achieved an 86.7% target reaching success rate (26/30 trials) in a physical 1.2m × 1.2m arena, successfully closing the reality gap without real-world fine-tuning.

[Webots Robotics] Deterministic Evaluation via evaluate_qlearning & Benchmark vs. DQN and SARSA (#4)

· 4 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

Success and Steps Benchmark

📌 Key Takeaways (TL;DR)

  • Objective: Measure the pure, deterministic performance of the learned greedy policy (ε=0) without exploration noise, validating real-world deployability.
  • Methodology: Implemented evaluate_qlearning.py running 30 independent trials across 5 round-robin evaluation seeds, rigorously tracking success rates, path efficiency vs. theoretical shortest routes, and obstacle near-miss counts.
  • Result: Tabular Q-Learning attained a 93.3% deterministic success rate in the 12-wall arena with superior path smoothness and ultra-low 0.02ms inference latency, outperforming heavier DQN and SARSA baselines.

[Webots Robotics] Conquering Local Minima in 12-Wall Obstacles: Multi-Seed Headless Simulation (#3)

· 4 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

obstacle12 Simulation Arena

📌 Key Takeaways (TL;DR)

  • Problem: When a goal lies directly behind an obstacle, the myopic nature of distance-delta rewards (+0.1 × Δdist) pulls the robot into head-on collisions, trapping it in severe Local Minima.
  • Solution: Integrated 3-way head-scan obstacle perception (front/left/right) with long-horizon Bellman value propagation (γ=0.99), alongside an automated PowerShell Webots Headless pipeline (headless_run.ps1) executing multi-seed training across seeds 0, 1, and 2.
  • Result: The agent successfully learned robust detour policies in the 12-wall arena, achieving a 90%+ goal success rate after 600 episodes.

[Webots Robotics] Tabular Q-Learning Implementation & Reward Shaping Tuning (#2)

· 5 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

Training Reward Curve

📌 Key Takeaways (TL;DR)

  • Problem: Sparse reward setups (+1.0 at goal, -1.0 at collision) cause severe exploration delays, causing the agent to wander or spin for thousands of episodes before stumbling upon the target.
  • Solution: Implemented a multi-objective Dense Reward Shaping mechanism combining potential-based Euclidean distance delta rewards (+0.1 × Δdist) with step (-0.01), turning (-0.01), and backward (-0.05) penalties, paired with exponential epsilon decay (1.0 → 0.05).
  • Result: The moving average reward shifted into a steady positive regime (0.7+) within 500 episodes in the no_obstacle scenario, achieving a 98%+ goal success rate.

[Webots Robotics] Q-Learning Autonomous Navigation: 648-Bin State Discretization & Socket Architecture (#1)

· 4 min read
Jihwan Park (jaybee)
AI & Robotics Engineer

Webots Simulation Environment

📌 Key Takeaways (TL;DR)

  • Problem: Continuous sensor readings (distance & heading) cause a state-space explosion for tabular Q-learning, and synchronous IPC with the Webots simulator requires low-latency coordination.
  • Solution: Designed a geometrically partitioned 5-dimensional continuous sensor mapper producing 3 × 8 × 3 × 3 × 3 = 648 discrete states (discretizer.py) and a line-delimited JSON IPC socket pipeline over TCP port 5000.
  • Result: Achieved O(1) fast Q-Table indexing and reliable 32ms physics synchronization between the simulator and Python agent.