211 lines
4.6 KiB
YAML
211 lines
4.6 KiB
YAML
# ============================================================
|
|
# RK3588 delivery config — OBB model, baseline 482mm
|
|
# Only used by sb_create(); sb_create_ex() ignores this file.
|
|
# ============================================================
|
|
|
|
# ---------- working distance ----------
|
|
working_distance:
|
|
z_min_mm: 900
|
|
z_max_mm: 4000
|
|
|
|
# ---------- image ----------
|
|
image:
|
|
width: 4096
|
|
height: 3000
|
|
channels: 1
|
|
expected_dtype: "uint8"
|
|
allowed_extensions: [".tiff", ".tif", ".bmp", ".png"]
|
|
|
|
# ---------- image validation ----------
|
|
image_validation:
|
|
min_max_value: 10
|
|
max_saturation_ratio: 0.20
|
|
|
|
# ---------- ChArUco ----------
|
|
charuco:
|
|
rows: 9
|
|
cols: 9
|
|
square_length_mm: 50.0
|
|
marker_length_mm: 37.0
|
|
dict_id: 11
|
|
min_corners_per_image: 30
|
|
|
|
# ---------- calibration ----------
|
|
calibration:
|
|
source: "xml"
|
|
xml_path: "calib/stereo_calib.xml"
|
|
min_image_pairs: 15
|
|
max_skip_ratio: 0.30
|
|
max_single_rms: 0.40
|
|
max_stereo_rms: 0.80
|
|
expected_baseline_range: [80, 600]
|
|
use_fix_intrinsic: true
|
|
|
|
# ---------- rectification ----------
|
|
rectification:
|
|
alpha: 1.0
|
|
interpolation: "cubic"
|
|
validation_feature_count: 500
|
|
validation_match_count: 10
|
|
epipolar_inlier_threshold_pixel: 5.0
|
|
min_epipolar_inlier_count: 3
|
|
max_epipolar_error_pixel: 5.0
|
|
min_valid_roi_ratio: 0.25
|
|
|
|
# ---------- SGBM ----------
|
|
sgbm:
|
|
min_disparity: 288
|
|
num_disparities: 736
|
|
block_size: 5
|
|
P1: 600
|
|
P2: 2400
|
|
disp12_max_diff: 1
|
|
uniqueness_ratio: 10
|
|
speckle_window_size: 100
|
|
speckle_range: 2
|
|
pre_filter_cap: 63
|
|
mode: "SGBM_3WAY"
|
|
|
|
# ---------- WLS ----------
|
|
wls:
|
|
lambda_value: 8000.0
|
|
sigma_color: 1.5
|
|
|
|
# ---------- disparity validation ----------
|
|
disparity_validation:
|
|
min_valid_pixel_ratio: 0.10
|
|
min_disparity_range: 50
|
|
max_nan_ratio: 0.90
|
|
|
|
# ---------- pointcloud ----------
|
|
pointcloud:
|
|
z_min_mm: 600
|
|
z_max_mm: 3000
|
|
expected_wd_range: [600, 3000]
|
|
min_num_points: 50000
|
|
max_z_std_mm: 800
|
|
min_bbox_extent_x_mm: 200
|
|
min_bbox_extent_y_mm: 100
|
|
sor_nb_neighbors: 30
|
|
sor_std_ratio: 2.0
|
|
voxel_downsample_min_points: 500000
|
|
voxel_size_mm: 0.5
|
|
roi_mask:
|
|
enabled: false
|
|
method: "hsv_threshold"
|
|
hsv_lower: [0, 0, 210]
|
|
hsv_upper: [180, 50, 255]
|
|
morph_close_kernel: 15
|
|
dilate_px: 100
|
|
min_area_ratio: 0.02
|
|
|
|
# ---------- 2D detection ----------
|
|
bolt_detect_2d:
|
|
mask_method: "ransac"
|
|
foam_brightness_threshold: 70
|
|
foam_morph_open_kernel: 21
|
|
foam_dilate_px: 0
|
|
bbox_margin_px: 60
|
|
bolt_morph_close_kernel: 15
|
|
bolt_min_area_px: 800
|
|
min_bolts: 1
|
|
max_bolts: 0
|
|
bolt_exclude_dilate_px: 0
|
|
ransac:
|
|
distance_thresh_mm: 8.0
|
|
max_iterations: 200
|
|
min_inlier_ratio: 0.15
|
|
sample_stride: 4
|
|
morph_close_kernel_px: 9
|
|
|
|
# ---------- plane ----------
|
|
plane:
|
|
max_residual_std_mm: 15.0
|
|
max_normal_to_axis_deg: 60
|
|
outlier_rejection_iterations: 5
|
|
outlier_mad_k: 2.5
|
|
|
|
# ---------- support gate ----------
|
|
support_gate:
|
|
enabled: true
|
|
margin_mm: 10.0
|
|
|
|
# ---------- bolt ----------
|
|
bolt:
|
|
min_height_mm: 5.0
|
|
max_height_mm: 250.0
|
|
extract_height_filter_mm: 200.0
|
|
height_tolerance_mm: 60.0
|
|
expected_diameter_mm: 16.0
|
|
min_points_per_bolt: 50
|
|
max_axis_plane_angle_deg: 30
|
|
extract_fallback: "bbox_projection"
|
|
|
|
# ---------- measurement ----------
|
|
measurement:
|
|
top_extraction_method: "percentile_on_axis"
|
|
top_percentile: 0.99
|
|
top_morphology: "flat_top"
|
|
height_from_plane: false
|
|
plane_use_sgbm: true
|
|
plane_sgbm_scale: 0.5
|
|
plane_max_samples: 40000
|
|
|
|
# ---------- diagnostics ----------
|
|
diagnostics:
|
|
enabled: true
|
|
blind_strip_warn_ratio: 0.25
|
|
min_roi_pointcloud_coverage_ratio: 0.001
|
|
|
|
# ---------- YOLO ----------
|
|
yolo:
|
|
enabled: true
|
|
model_path: "weights/best.rknn"
|
|
backend: "rknn"
|
|
task: "obb"
|
|
imgsz: 1024
|
|
conf: 0.5
|
|
dead_zone_min_valid_pts: 50
|
|
dead_zone_bbox_dilate_mm: 24.0
|
|
foam_bbox_dilate_mm: 16.0
|
|
local_stereo_fallback:
|
|
enabled: true
|
|
min_valid_points: 50
|
|
|
|
# ---------- ranging (binned) ----------
|
|
ranging:
|
|
z_min_mm: 900
|
|
z_max_mm: 4000
|
|
lrc_max_mm: 2.5
|
|
lrc_trusted_mm: 1.2
|
|
|
|
# ---------- evaluation ----------
|
|
evaluation:
|
|
height_max_mm: 2.0
|
|
height_p95_mm: 1.5
|
|
pair_max_mm: 2.0
|
|
pair_p95_mm: 1.5
|
|
repeatability_std_max_mm: 1.0
|
|
matching_max_distance_mm: 50.0
|
|
|
|
# ---------- pipeline ----------
|
|
pipeline:
|
|
fail_fast: true
|
|
resume_from_checkpoint: true
|
|
parallel_frames: false
|
|
save_intermediate: false
|
|
|
|
# ---------- logging ----------
|
|
logging:
|
|
level: "INFO"
|
|
log_to_file: true
|
|
log_file: "outputs/logs/pipeline.log"
|
|
|
|
# ---------- paths ----------
|
|
paths:
|
|
calibration_dir: "calib"
|
|
test_dir: "dataset/test"
|
|
groundtruth_csv: "dataset/groundtruth.csv"
|
|
output_dir: "outputs"
|
|
stereo_params_yaml: "outputs/stereo_params.yaml"
|