Files
VSAG_AUTO_AIM_PRACTICE_27RM/xmake.lua
T
mzxwww f3b06d6abe Add light bar detector and detect_test
- traditional CV pipeline referencing jlu_vision_26:
  HSV mask -> contour LightBar -> PCA corner refine -> pairing gates
- big/small armor classification (bar distance / bar length ratio)
- detect_test with synthetic selftest, 6/6 passed
- measured armor size 131.56x55mm, solver NaN guard + ITERATIVE fallback
2026-09-17 00:34:24 +08:00

67 lines
2.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
add_rules("mode.debug", "mode.release")
set_policy("generator.compile_commands", true)
set_languages("c++17")
-- 公共依赖:OpenCV + MindVision 相机 SDK
local ROOT = os.scriptdir()
rule("rm_deps")
on_load(function (target)
target:add("includedirs", ROOT .. "/inc")
target:add("includedirs", "/usr/local/include/opencv4")
target:add("includedirs", "/home/mzxiang/MindVisionSDK/include")
target:add("linkdirs", "/usr/local/lib")
target:add("linkdirs", "/home/mzxiang/MindVisionSDK/lib/x64")
target:add("rpathdirs", "/home/mzxiang/MindVisionSDK/lib/x64")
target:add("links", "opencv_core", "opencv_imgproc", "opencv_highgui",
"opencv_imgcodecs", "opencv_videoio", "opencv_calib3d",
"MVSDK")
end)
rule_end()
-- 主程序(自瞄本体)
target("27RM")
add_rules("rm_deps")
set_kind("binary")
-- 各工具有自己的 main 函数,从主程序中排除
add_files("src/*.cpp")
remove_files("src/capture_calib.cpp")
remove_files("src/calibrate.cpp")
remove_files("src/pose_test.cpp")
remove_files("src/detect_test.cpp")
-- 标定图采集工具
-- ./build/linux/x86_64/debug/capture_calib (MindVision 相机)
-- ./build/linux/x86_64/debug/capture_calib --usb 0 (USB 摄像头)
target("capture_calib")
add_rules("rm_deps")
set_kind("binary")
add_files("src/capture_calib.cpp", "src/camera_set.cpp")
-- 标定计算工具(读 calib_images/ 算出内参,存 camera_calib.yml)
target("calibrate")
add_rules("rm_deps")
set_kind("binary")
add_files("src/calibrate.cpp")
-- 几何链路验证工具(4 角点 → PnP → 距离/yaw/pitch)
-- ./build/linux/x86_64/debug/pose_test (相机 + 鼠标点角)
-- ./build/linux/x86_64/debug/pose_test --selftest (合成自检,无需相机)
-- ./build/linux/x86_64/debug/pose_test --image x.jpg --corners x1,y1 x2,y2 x3,y3 x4,y4
target("pose_test")
add_rules("rm_deps")
set_kind("binary")
add_files("src/pose_test.cpp", "src/camera_calib.cpp", "src/camera_set.cpp")
-- 灯条检测验证工具(检测 → 4 角点 → PnP → 距离/yaw/pitch)
-- ./build/linux/x86_64/debug/detect_test (相机实时)
-- ./build/linux/x86_64/debug/detect_test --selftest (合成自检,无需相机)
-- ./build/linux/x86_64/debug/detect_test --image x.jpg --once
target("detect_test")
add_rules("rm_deps")
set_kind("binary")
add_files("src/detect_test.cpp", "src/light_bar.cpp",
"src/camera_calib.cpp", "src/camera_set.cpp")