Robotics Computer Vision & Physical AI Studio
In-Browser Robotics Vision & Optical Calibration Lab
Interactive computer vision workstation for robotics engineers: calibrate HSV color segmentation with live centroid tracking, generate metric ArUco & AprilTag fiducial markers with 3D pose estimation, and calculate lens FOV, GSD, and optical matrices in real time.
Image Source:
● BUILT-IN TEST SCENE
Tuning Presets:
Threshold Sliders OpenCV Scale (H: 0-179, S,V: 0-255)
Hue Min (H_min):
22 (44°)
Hue Max (H_max):
38 (76°)
Saturation Min (S_min):
100
Saturation Max (S_max):
255
Value / Brightness Min (V_min):
100
Value / Brightness Max (V_max):
255
Target HUD Telemetry LOCKED
Centroid (cx, cy)
(320, 240)
Offset: ΔX: 0px, ΔY: 0px
Bounding Box
140 × 140
Aspect Ratio: 1.00
Segmented Area
15,394 px²
5.0% of camera frame
Steering Heading Error
0.0°
CENTERED (ON TARGET)
1. Original Feed
640 × 480
2. Binary Threshold Mask
0 px
3. Contour & Tracking HUD
HUD Active
1-Click Robotics Code Exporter
Fiducial Marker & Metric Scale
4×4 • ID 7
0 mm
25 mm
50 mm Scale Ruler
Measure with calipers after printing to verify 1:1 scale
Family: DICT_4X4_50 | ID: 7 | Physical Size: 100 mm × 100 mm
💡 Printing Advice: Set printer scaling to "100% / Actual Size" (do not select "Fit to Page") for millimeter-accurate computer vision ground truth.
Interactive 3D Pose Estimation Simulator solvePnP Raytracer
Drag mouse on 3D viewport to orbit camera • Red = X, Green = Y, Blue = Normal Z
Distance: 1.00 m
Distance Z (m):
1.00 m
Lateral X (m):
0.00 m
Vertical Y (m):
0.00 m
Pitch (θ):
15°
Yaw (ψ):
-20°
Roll (φ):
0°
Rodrigues Vector rvec [rx, ry, rz]
-0.245, 0.321, 0.042 rad
Rotation Matrix Det(R) = +1.000
Translation Vector tvec [tx, ty, tz]
[0.000, 0.000, 1.000] m
Projected Corners: (220,160) … (420,320) px
OpenCV solvePnP & Camera Geometry Derivation
Perspective-n-Point (PnP) Formulation: Given 3D object points in the tag's local coordinate frame $P_i = [X_i, Y_i, 0]^T$ and their observed 2D image projections $p_i = [u_i, v_i]^T$, OpenCV solves for rotation $R$ and translation $ec{t}$ minimizing reprojection error:
s · [u, v, 1]ᵀ = K · [R | t] · [X, Y, Z, 1]ᵀ
import cv2
import numpy as np
# 1. Physical 3D Object Points in Marker Frame (Corners at Z=0)
marker_size = 0.10 # 100mm = 0.10m
obj_points = np.array([
[-marker_size/2, marker_size/2, 0],
[ marker_size/2, marker_size/2, 0],
[ marker_size/2, -marker_size/2, 0],
[-marker_size/2, -marker_size/2, 0]
], dtype=np.float32)
# 2. Camera Intrinsic Matrix K and Distortion Vector D
camera_matrix = np.array([
[967.0, 0.0, 320.0],
[ 0.0, 967.0, 240.0],
[ 0.0, 0.0, 1.0]
], dtype=np.float64)
dist_coeffs = np.zeros((5, 1), dtype=np.float64) # [k1, k2, p1, p2, k3]
# 3. Estimate 3D Pose via Levenberg-Marquardt
success, rvec, tvec = cv2.solvePnP(obj_points, img_corners, camera_matrix, dist_coeffs, flags=cv2.SOLVEPNP_IPPE_SQUARE)
# 4. Convert Rodrigues rvec to 3x3 Rotation Matrix
R, _ = cv2.Rodrigues(rvec)
# 5. Draw 3D Coordinate Axes on Image (X=Red, Y=Green, Z=Blue)
cv2.drawFrameAxes(frame, camera_matrix, dist_coeffs, rvec, tvec, 0.05) # 50mm axis
Optical & Sensor Parameters
Lens Focal Length (f):
2.80 mm
Working Distance / Altitude (Z):
1.50 m
Intrinsic Matrix K & ROS 2 Info
Horizontal FOV (HFOV)
89.7°
Wide-Angle Lens
Vertical FOV (VFOV)
58.4°
Diagonal: 99.8°
Ground Sampling (GSD)
1.55 mm/px
0.16 cm per pixel
Focal Length (Pixels)
fx: 967 px
fy: 967 px
Interactive Optical Frustum & Coverage Visualizer
Viewing Cone from Camera Focal Point • Scale indicates ground coverage footprint at Z
Coverage: 2.98 m × 1.68 m
Optical Resolution & Detectability Criteria
| Optical Property | Computed Value | Robotics & Physical AI Significance |
|---|---|---|
| Physical Pixel Pitch | 2.90 μm × 2.90 μm | Microscopic pixel cell size on silicon die |
| Field Coverage at Distance | 2.98 m (W) × 1.68 m (H) | Total rectangular optical footprint visible to robot |
| Min Object Detection (2 px) | 3.1 mm | Nyquist spatial sampling threshold for target detection |
| Min Object Recognition (6 px) | 9.3 mm | Feature classification & contour centroid tracking |
| ArUco Tag Decode (60 px) | 93.0 mm (min tag size) | Reliable fiducial barcode decoding & 3D solvePnP |